Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Other
Author Message
jlajax
Ardent RavenCMS Supporter



Joined: Oct 12, 2006
Posts: 244
Location: Jacksonville, Florida

PostPosted: Sun Aug 11, 2013 2:16 pm Reply with quote

Greetings good people,
I think I am very close to accomplishing something I have been working on. All appears to be correct yet I do not have a functional menu. My goal is to add three lines to the head of the DeepBlue Theme and a script to the footer. I am trying to replicate in RN 2.5 what I can do in html very easily. I think I am close.

I added the lines to header.php that I need in the header and they do in fact appear in the source code as well as appear to be correct in fact the menu does display in the proper positions. I added the script to footer.php and it appears in the source code and the site seems to function correctly. I see no errors in the logs or in the CMS as it cycles from page to page.

The problem is the menu is not functioning as it is supposed to. The drop down menu does not drop. I am frazzled on this thing. In reading the source code the color scheme of my editor says all is good. If I make a typo it highlights the error. I have tried swapping | ‘ | and | “ |. I can cut and paste the source for the menu itself into an html doc and it works fine. Any suggestions on what I don’t know that I need to. Oh and I finally started studying php in earnest long overdue to be sure but I am hooked on this RavenNuke CMS and want to understand it better than I already do. You folks are the best!

RavensScripts RavensScripts RavensScripts RavensScripts RavensScripts RavensScripts
 
View user's profile Send private message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1772

PostPosted: Mon Aug 12, 2013 4:38 am Reply with quote

Remove at first all added lines in the header.php and footer.php because these files have only the core-code inside. Do not change it for customize your theme!

If you want add a extension for only one theme, then do it in the theme.php directly. In your theme you have a function themeheader() for the header and a function themefooter() for footer to place your html code. If you must add needed css-styles, then you can add it in the style.css of your theme.

You can load javascript code easily at the end of the body with:
[ Only registered users can see links on this board! Get registered or login! ]

Code:
addJSToBody('path/to_your/jsfile.js', 'file');


or:

Code:
$myjscode  = '<script type="text/javascript">' . PHP_EOL

       . '/* your js code here */' . PHP_EOL
       . '</script>' . PHP_EOL;
addJSToBody($myjscode,'inline');


You can add this in the function themefooter() before the closing brace:


Code:
function themefooter() {

    echo '<br />';
    if (defined('INDEX_FILE') && INDEX_FILE===true) {
        echo    '</td>
            <td><img src="themes/DeepBlue/images/pixel.gif" width="10" height="1" border="0" alt="" />
            </td>
            <td valign="top" width="150" bgcolor="#d3e2ea" align="left">'."\n";
                    blocks('r');
// blocks right inserts two whole tables from themesidebox
        echo    '</td>';
        echo    '<td><img src="themes/DeepBlue/images/pixel.gif" width="6" height="1" border="0" alt="" />
                </td>';
        }
    else {
        echo
                '</td>
                <td colspan="2"><img src="themes/DeepBlue/images/pixel.gif" width="10" height="1" border="0" alt="" />
                </td>';
            }
echo            '</tr>
        </table>'."\n";
        echo '<br />';
        footmsg();
        echo '</td></tr></table>';
        # add here your js code
        addJSToBody('path/to_your/jsfile.js', 'file');
}

_________________
Github: RavenNuke 
View user's profile Send private message
jlajax







PostPosted: Fri Aug 16, 2013 10:38 am Reply with quote

Looks straight forward enough. I am learning here.

RavensScripts RavensScripts RavensScripts RavensScripts RavensScripts RavensScripts
 
jlajax







PostPosted: Sat Aug 17, 2013 6:46 pm Reply with quote

Code:


function themeheader(
// add spryAssets JS to head
addJSToBody('includes/SpryAssets/SpryMenuBar.js', 'file');
// add CSS to head
addCSSToHead ('includes/SpryAssets/SpryMenuBarHorizontal.css', 'file');
addCSSToHead ('includes/SpryAssets/SpryMenuBarVertical.css.css', 'file');
// end spryAssets adds
                )


This is what I understood you to say but I am wrong. In reading the wiki I thought adding

Code:


<?php
// add spryAssets JS to head
addJSToBody('includes/SpryAssets/SpryMenuBar.js', 'file');
// add CSS to head
addCSSToHead ('includes/SpryAssets/SpryMenuBarHorizontal.css', 'file');
addCSSToHead ('includes/SpryAssets/SpryMenuBarVertical.css.css', 'file');
// end spryAssets adds
?>


might be what I need to add in custom_head.php

In the first case it gave me an error and in the second case the page loaded, the menu displayed as an unordered list instead of a menu bar. I also tried the full URL to the files and that didn't work either. Am I close?
 
jlajax







PostPosted: Sat Aug 17, 2013 6:55 pm Reply with quote

The other question that comes to mind is do I need to add htmlemenities() trim() isset() into a custom head or theameheader()?

RavensScripts RavensScripts RavensScripts RavensScripts RavensScripts RavensScripts
 
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Sat Aug 17, 2013 6:59 pm Reply with quote

addCSSToHead has to be used prior to including header.php, so I bet that is your issue (the themeheader function is called after header.php is included). Try moving those outside of the themeheader function to the top of your theme.php (not inside one of the functions). You can also create an includes/addons/head-anynameyouwant.php file and place the addCSSToHead there.

The addJSToBody is ok where it is, as it can be used any time prior to including footer.php.. or place on the includes/addons/head-anynameyouwant.php file...
 
View user's profile Send private message Visit poster's website
jlajax







PostPosted: Sun Aug 18, 2013 8:24 am Reply with quote

Half of it is working. The CSS is displaying as intended in the source code the JS however still isn't functioning. I have tried the following variations on the off chance I don't understand something (imagine that). I feel like I am truly armed just enough to be dangerous. I sure can crash things fast. Heres what I have tried and it looks simple enough but I still don't have something right.

Code:


function themeheader(
// add spryAssets JS to head
// addJSToBody('includes/SpryAssets/SpryMenuBar.js', 'file');
// addJSToBody('/includes/SpryAssets/SpryMenuBar.js', 'file');
//addJSToBody('../includes/SpryAssets/SpryMenuBar.js', 'file');
) {
 
spasticdonkey







PostPosted: Sun Aug 18, 2013 9:54 am Reply with quote

If you view the source of the html of your page, do you see the file being loaded (near the bottom)

Is the SpryAssets file located at yoursite.com/includes/SpryAssets/SpryMenuBar.js and if you visit the url does the script display? With addJSToBody you always want the path relative to the server root, so your first example should be correct as long as the file is located as above.

If the file is loading properly the next possibility is some kind of JavaScript conflict. From what I can tell Spry is a feature of dreamweaver? Looks like they stopped supporting the script and released it to the public in 2008. [ Only registered users can see links on this board! Get registered or login! ] [ Only registered users can see links on this board! Get registered or login! ]

In a quick look (didn't have time to try it) it looks like they are doing browser sniffing and likely applying browser specific fixes and code. The problem could be those fixes are circa 2006-2008. Does the menu work in any browser?
 
jlajax







PostPosted: Sun Aug 18, 2013 10:33 am Reply with quote

[quote="spasticdonkey"]If you view the source of the html of your page, do you see the file being loaded (near the bottom)[/qoute]

The page causes arrors, if I turn off error reporting with addJSToBody('includes/SpryAssets/SpryMenuBar.js', 'file'); active I get a white page. The error reported is:

Parse error: syntax error, unexpected '(', expecting '&' or T_VARIABLE in /*****/content/**/********/html/dev/html/themes/DeepBlue/theme.php on line 79
The full url produces the same error

Code:


function themeheader(
// add spryAssets JS to head
addJSToBody('http://www.*****.com/html/includes/SpryAssets/SpryMenuBar.js', 'file');
) {


spasticdonkey wrote:
Is the SpryAssets file located at yoursite.com/includes/SpryAssets/SpryMenuBar.js and if you visit the url does the script display? With addJSToBody you always want the path relative to the server root, so your first example should be correct as long as the file is located as above.


Yes if I call the script through the url it displays. The path structure is the same as for the rest of the code I added and the menu is displaying as it should. The JS isn't working

spasticdonkey wrote:
If the file is loading properly the next possibility is some kind of JavaScript conflict. From what I can tell Spry is a feature of dreamweaver? Looks like they stopped supporting the script and released it to the public in 2008. [ Only registered users can see links on this board! Get registered or login! ] [ Only registered users can see links on this board! Get registered or login! ]



spasticdonkey wrote:
In a quick look (didn't have time to try it) it looks like they are doing browser sniffing and likely applying browser specific fixes and code. The problem could be those fixes are circa 2006-2008. Does the menu work in any browser?


Yes SpryAssets are an old standby. They work fine in html pages and php splash pages as well. There is a z-index issue with IE otherwise Chrome, Safri, Firefox, Opera all display the menu fine. I have lots of pages out there that use the SpryAssets framework for menus. My own splash page among them.
[/code]
 
wHiTeHaT
Life Cycles Becoming CPU Cycles



Joined: Jul 18, 2004
Posts: 579

PostPosted: Sun Aug 18, 2013 10:46 am Reply with quote

Why don't you just post your full theme.php
So we can see better what you already did.
Also make sure that you not forget to take out old code from your header.php , custom_header.php or any other file you edited to get your menu working.
 
View user's profile Send private message Send e-mail
jlajax







PostPosted: Sun Aug 18, 2013 11:31 am Reply with quote

Code:


<?php

// BEGIN: Added in v2.40.00 - Mantis Issue 0001043
//$index = 0;
//if (!defined('INDEX_FILE')) define('INDEX_FILE', true); // Set to FALSE to hide right blocks
//if (defined('INDEX_FILE') AND INDEX_FILE===true) {
// auto set right blocks for pre patch 3.1 compatibility
//   $index = 1;
//}
// END: Added in v2.40.00 - Mantis Issue 0001043
// display errors added by ed for debugging comment out in production mode
 ini_set ('display_errors', 1);
// turn on error reporting
 error_reporting (E_ALL | E_STRICT);
// added by jlajax to set default time zone
date_default_timezone_set('America/New_York'); // set time zone for site
// add CSS to head
addCSSToHead ('includes/SpryAssets/SpryMenuBarHorizontal.css', 'file') . "\n";
addCSSToHead ('includes/SpryAssets/SpryMenuBarVertical.css.css', 'file') . "\n";
// end spryAssets adds
$bgcolor1 = '#EEEEEE';
$bgcolor2 = '#EEEEEE';
$bgcolor3 = '#EEEEEE';
$bgcolor4 = '#EEEEEE';
$textcolor1 = '#000000';
$textcolor2 = '#000000';

function OpenTable() {
    global $bgcolor1, $bgcolor2;
    echo '<table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="'.$bgcolor2.'"><tr><td>'."\n";
    echo '<table width="100%" border="0" cellspacing="1" cellpadding="8" bgcolor="'.$bgcolor1.'"><tr><td>'."\n";
}

function CloseTable() {
    echo '</td></tr></table></td></tr></table>'."\n";
}

function OpenTable2() {
    global $bgcolor1, $bgcolor2;
    echo '<table border="0" cellspacing="1" cellpadding="0" bgcolor="'.$bgcolor2.'" align="center"><tr><td>'."\n";
    echo '<table border="0" cellspacing="1" cellpadding="8" bgcolor="'.$bgcolor1.'"><tr><td>'."\n";
}

function CloseTable2() {
    echo '</td></tr></table></td></tr></table>'."\n";
}
function FormatStory($thetext, $notes, $aid, $informant) {
    global $anonymous;
    $content = '';
    $thetext = '<div>'.$thetext.'</div>';
    if (!empty($notes)) {
        $notes = '<br /><b>'._NOTE.'</b>&nbsp;<div>'.$notes.'</div>';
    } else {
        $notes = '';
    }
    if ($aid == $informant) {
        $content = $thetext.$notes;
    } else {
        if(!empty($informant)) {
            global $admin, $user;
            if (is_user($user)||is_admin($admin)) $content = '<a href="modules.php?name=Your_Account&amp;op=userinfo&amp;username='.$informant.'"><i>'.$informant.'</i></a> ';
            else $content = $informant.' ';//Raven 10/16/2005
        } else {
            $content = $anonymous.' ';
        }
        $content .= '<i>'._WRITES.':</i>&nbsp;&nbsp;'.$thetext.$notes;
    }
    echo $content;
}

 
/************************************************************/
/* Function themeheader()                                   */
/************************************************************/


function themeheader(
// add spryAssets JS to head
addJSToBody('http://www.someDomain.com/html/includes/SpryAssets/SpryMenuBar.js', 'file');
) {
   global $module_name, $banners, $admin, $user, $name, $sitename, $index, $admin_file, $nukeurl, $addJSTBody, $slogan, $nukeNAV;

    echo '<body bgcolor="#ffffff" text="#000000" link="#EEEEEE"><br />';
    if ($banners) {
        echo ads(0);
        echo '<br />';
    }
// begin nukeNav
   echo '<div style="float: left; position: relative; left: 50%;"><div style="position:relative;left:-50%;">'.$nukeNAV.'</div></div><br /><br />'.chr(10);
// end nukeNav
// the first table below is simply to "wrap the whole page so it centers; it is closed at the
// bottom of themefooter ... tried align=center but that causes problems with IE.
    echo
        '<table align="center" border="0" cellpadding="0" cellspacing="0" width="1000">
        <tr><td>
        <table border="0" cellpadding="0" cellspacing="0" width="1000">'."\n"
            .'<tr>
                <td width="100%" align="left">'."\n"
                    .'<table border="0" cellpadding="0" cellspacing="0" width="1000">'."\n"
                        .'<tr>
                            <td width="100%" align="left">'."\n"
                                .'<!--begin header table -->
    <table width="100%" border="0" cellspacing="0" cellpadding="0" height="310">
      <tr>
        <td class="HeaderBack" height="260"></td>
      </tr>
      <tr>
        <td><!--begin menu --><ul id="MenuBar1" class="MenuBarHorizontal">
                <li><a href="http://www.someDomain.com/html/">Home</a></li>
              <li><a class="MenuBarItemSubmenu" href="#">Tax Assistance</a>
                <ul>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=1">Unfiled Returns</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=38">Tax Settlement</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=19">Wage Garnishment</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=28">Removal of Lein</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=3">Removal of Levy</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=29">Revenue Officer Representation</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=15">Expectations</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=10">Cost of Services</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=4#Representation">Audit Representation</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=4#Reconsideration">Audit Reconsideration</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=25">Hardship Non Collectable</a></li>
                </ul>
              </li>
              <li><a class="MenuBarItemSubmenu" href="http://www.someDomain.com/html/modules.php?name=Content&pa=list_pages_categories&cid=2">Tax Problems</a>
                <ul>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=9">IRS Notices</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=9">IRS Collections</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=38">Unpaid Taxes</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=1">Unfiled Returns</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=1">Tax Preparation</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=9">Individual Tax Notices</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=9">Business Tax Notices</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=20">Tax Penalties</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=19">Wage Garnishments</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=35">Tax Settlement Options</a></li>
                </ul>
              </li>
              <li><a class="MenuBarItemSubmenu" href="#">Tax Representation</a>
                <ul>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=19">How It Works</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=38">Settlement Help</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=2">Offer In Compromise</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=20">Penalty Abatement Help</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=5">Bank Levy Help</a>
                  <ul>                 
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=5#Prevention">Prevention and Removal of IRS Bank Levies</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=5#Anticipating">Anticipating and Preventing IRS Bank Levies</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=5#Bank_Levy">What a Bank Levy Means to You</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=5#Released">How to Have Your Bank Levy Released</a></li>
                  </ul>
                  </li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=19">Wage Garnishment Help</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=18#Innocent">Innocent Spouse Help</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=18#Injured">Injured Spouse Help</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=4">Tax Audit Help</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=19">Tax Levy Help</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=28">Tax Lein Help</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=1">Tax Return Filing</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=25">Currently Non Collectable Help</a></li>
                </ul>
                </li>
              <li><a class="MenuBarItemSubmenu" href="#">About Us</a>
                <ul>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=FAQ">FAQ</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Forums">Tax Blog</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Tax_Tips">Tax Tips</a></li>
                  <li><a class="MenuBarItemSubmenu" href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=21">Licensed Profesionals</a>
                  <ul>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=21#Attorney">Qualified Attorney</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=21#CPA">CPA</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=21#EA">Enrolled Agent</a></li>
                  </ul>
                  </li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=34">Tax Scams</a>
                  <ul>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=34#Identity">Identity Theft</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=34#Phishing">Phishing Scams</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=34#Preparer">Return Preparer Fraud</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=34#Hiding">Hiding Income Offshore</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=34#Free">Free money from the IRS and tax scams involving Social Security</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=34#False">False/Inflated Income and Expenses</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=34#False_Form">False Form 1099 Refund Claims</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=34#Frivolous">Frivolous Arguments</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=34#Falsely_Claiming_Zero_Wages">Falsely Claiming Zero Wages</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=34#Abuse_Charitable_Organizations_Deductions">Abuse of Charitable Organizations and Deductions</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=34#Disguised_Corporate_Ownership">Disguised Corporate Ownership</a></li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Content&pa=showpage&pid=34#Misuse_Trusts">Misuse of Trusts</a></li>
                  </ul>
                  </li>
                  <li><a href="http://www.someDomain.com/html/modules.php?name=Topics">In The News</a></li>
                </ul>
                </li>
                <li><a class="MenuBarItemSubmenu" href="#">Contact&nbsp;Us</a>
              <ul>
                <li><a href="http://www.someDomain.com/html/modules.php?name=Contact_Us">E-Mail</a></li>
              <li><a href="http://www.someDomain.com/html/">Home</a></li>             
              <li><a href="http://www.someDomain.com/html/modules.php?name=Your_Account">Log&nbsp;In</a></li>
              <li><a href="http://www.someDomain.com/html/modules.php?name=Forums">Tax&nbsp;Blog</a></li>             
              <li><a href="http://www.someDomain.com/html/modules.php?name=Content">Content</a></li>             
              <li><a href="http://www.someDomain.com/html/modules.php?name=Downloads&cid=1">Downloads</a></li>
              </ul></li>
            </ul><!--end menu --></td>
      </tr>
    </table><!--end header table -->'."\n"
                .'</td>
            </tr>
            <tr>
                <td width="100%" align="left">
                    <table width="100%" cellspacing="0" cellpadding="0" border="0">
                        <tr>
                            <td bgcolor="#EEEEEE" align="left">'."\n";
                            $public_msg = public_message();
                            echo "$public_msg" . '<br />';
                            echo
                        '</td>
                    </tr>
                    </table>
                </td>
        </tr>
        </table>'
        .'<table width="1000" cellpadding="0" bgcolor="#ff0000" cellspacing="0" border="0">'."\n"
    //row not closed
            .'<tr valign="top">'."\n"
                .'<td><img src="themes/DeepBlue/images/pixel.gif" width="6" height="1" border="0" alt="" />
                </td>'."\n"
                .'<td width="150" bgcolor="#EEEEEE" valign="top" align="left">'."\n";
                        blocks('l');
                        echo
                '</td>
                <td><img src="themes/DeepBlue/images/pixel.gif" width="10" height="1" border="0" alt="" />
                </td>';
// td not closed
echo            '<td width="100%">'."\n";
}

/************************************************************/
/* Function themefooter()                                   */
/*                                                          */
/* Control the footer for your site. You don't need to      */
/* close BODY and HTML tags at the end. In some part call   */
/* the function for right blocks with: blocks(right);       */
/* Also, $index variable need to be global and is used to   */
/* determine if the page your're viewing is the Homepage or */
/* and internal one.                                        */
/************************************************************/

function themefooter(
                /* added by jlajax */
               
/* end jlajax add */
                ) {
    echo '<br />';
    if (defined('INDEX_FILE') && INDEX_FILE===true) {
        echo    '</td>
            <td><img src="themes/DeepBlue/images/pixel.gif" width="10" height="1" border="0" alt="" />
            </td>
            <td valign="top" width="150" bgcolor="#EEEEEE" align="left">'."\n";
                    blocks('r');
// blocks right inserts two whole tables from themesidebox
        echo    '</td>';
        echo    '<td><img src="themes/DeepBlue/images/pixel.gif" width="6" height="1" border="0" alt="" />
                </td>';
        }
    else {
        echo
                '</td>
                <td colspan="2"><img src="themes/DeepBlue/images/pixel.gif" width="10" height="1" border="0" alt="" />
                </td>';
            }
echo            '</tr>
        </table>'."\n";
        echo '<br />';
        footmsg();
        echo '</td></tr></table>';
}

function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
    global $anonymous, $tipath;
    $ThemeSel = get_theme();
   if (file_exists(NUKE_THEMES_DIR . $ThemeSel . '/images/topics/' . $topicimage)) {
      $t_image = 'themes/' . $ThemeSel . '/images/topics/' . $topicimage;
   } else {
      $t_image = $tipath . $topicimage;
   }
    echo
        '<table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td bgcolor="#000000">'."\n"
                    .'<table border="0" cellpadding="0" cellspacing="1" width="100%">
                        <tr><td bgcolor="#EEEEEE">'."\n"
                            .'<table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <td bgcolor="#EEEEEE">'."\n"
.'<img src="themes/DeepBlue/images/dot.gif" border="0" alt="" />
                                    </td>
                                    <td width="100%" bgcolor="#EEEEEE" align="left">
                                    <span class="option"><b>&nbsp;'.$title.'</b></span>
                                    </td>
                                </tr>'."\n"
                                .'<tr>
                                    <td colspan="2" bgcolor="#EEEEEE"><br />'."\n"
                                        .'<table border="0" width="98%" align="center">
                                            <tr>
                                                <td align="left">'."\n"
.'<a href="modules.php?name=News&amp;new_topic='.$topic.'"><img src="'.$t_image.'" alt="'.$topictext.'" border="0" align="right" /></a>';
    FormatStory($thetext, $notes, $aid, $informant);
    echo
                                                '</td>
                                            </tr>
                                        </table>'."\n"
                                    .'</td>
                                </tr>
                            </table><br />'."\n"
                        .'</td>
                    </tr>
                    <tr>
                        <td bgcolor="#EEEEEE" align="center">'."\n"
                            .'<font class="tiny">'._POSTEDBY.' ';
                            formatAidHeader($aid);
                        echo ' '._ON.' '. $time .'('.$counter .' '._READS.')<br /></font>'."\n"
                            .'<font class="content">'.$morelink.'</font>'."\n"
    .'<img src="themes/DeepBlue/images/pixel.gif" border="0" height="2" alt="" />'."\n"
                        .'</td>
                    </tr></table>'."\n"
                .'</td>
            </tr>
        </table><br />'."\n";
}

function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext, $notes) {
    global $admin, $sid, $tipath;
    $ThemeSel = get_theme();
   if (file_exists(NUKE_THEMES_DIR . $ThemeSel . '/images/topics/' . $topicimage)) {
      $t_image = 'themes/' . $ThemeSel . '/images/topics/' . $topicimage;
   } else {
      $t_image = $tipath . $topicimage;
   }
    echo
    '<table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
            <td bgcolor="#000000">'."\n"
                .'<table border="0" cellpadding="0" cellspacing="1" width="100%">
                    <tr>
                        <td bgcolor="#EEEEEE" align="left">'."\n"
                            .'<table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <td bgcolor="#EEEEEE" align="left">'."\n"
    .'<img src="themes/DeepBlue/images/dot.gif" border="0" alt="" />
                                    </td>
                                    <td width="100%" bgcolor="#EEEEEE"><span class="option"><b>&nbsp;'.$title.'</b></span>
                                    </td>
                                </tr>'."\n"
                            .'<tr>
                                <td colspan="2" bgcolor="#EEEEEE"><br />'."\n"
                                    .'<table border="0" width="98%" align="center">
                                        <tr>
                                            <td align="left">'."\n";
                                    echo '<a href="modules.php?name=News&amp;new_topic='.$topic.'"><img src="'.$t_image.'" alt="'.$topictext.'" border="0" align="right" /></a>';
                                            FormatStory($thetext, $notes, $aid, $informant);
                                        echo
                                            '</td>
                                        </tr>
                                    </table>'."\n"
                                .'</td>
                            </tr>
                        </table><br />'."\n"
                    .'</td>
                </tr>
            </table>'."\n"
        .'</td>
    </tr>
</table>
<br /><br />'."\n";
}

function themesidebox($title, $content) {
    // note:  this gets called by the mainfile render blocks function when side is left or right
    // thus the table that's in legacy themefooter when index file is set is extraneous
echo    '<table border="0" width="150" cellpadding="0" cellspacing="0">'
            .'<tr>
                <td class="table_title" width="150" height="20">'
                    .'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <span class="whitetitle">'.$title.'</span>'
                .'</td>
            </tr>';
echo        '</table>
        <table border="1" cellpadding="1" cellspacing="0" width="150">'
            .'<tr>
                <td width="150" bgcolor="#ffffff">'
                        .$content
                .'</td>
            </tr>
        </table>
        <br />';
}

?>
 
spasticdonkey







PostPosted: Sun Aug 18, 2013 11:43 am Reply with quote

Looks like there are extra curly braces that shouldn't be there in themeheader, closing the function early and likely leading to other code errors.

addJSToBody('http://www.someDomain.com/html/includes/SpryAssets/SpryMenuBar.js', 'file');
) {

edit: or I guess they aren't both curly, but seeing the same issue in themefooter

edit again: took me awhile to see what was going on but you nested the code in the wrong place. don't remove any of the braces. Change themeheader and themefooter back to

function themeheader() {

function themefooter() {

You had placed your edits as parameters of the function instead of inside the function itself. Try adding your edits after the global statements inside the function, i.e.


function themeheader() {
global $module_name, $banners, $admin, $user, $name, $sitename, $index, $admin_file, $nukeurl, $addJSTBody, $slogan, $nukeNAV;

// add spryAssets JS to head
addJSToBody('includes/SpryAssets/SpryMenuBar.js', 'file');
 
jlajax







PostPosted: Sun Aug 18, 2013 3:25 pm Reply with quote

That added the JS to the very bottom of the page, just before the body tag. The script doesn't work but all the code required is displaying with the correct path. I am presuming the JS loading at the bottom of the page is the issue am I correct? I appreciate your help I truly do.
 
spasticdonkey







PostPosted: Sun Aug 18, 2013 3:56 pm Reply with quote

It's possible the script needs to be loaded in the head of the document; or is somehow conflicting with other JavaScript on the page. To try it in the head, move the addJSToBody code from your themeheader function, up to where your CSS files are added at the top of your theme. then change addJSToBody to addJSToHead. i.e.

// add JS/CSS to head
addCSSToHead ('includes/SpryAssets/SpryMenuBarHorizontal.css', 'file') . "\n";
addCSSToHead ('includes/SpryAssets/SpryMenuBarVertical.css.css', 'file') . "\n";
addJSToHead('includes/SpryAssets/SpryMenuBar.js', 'file');


This may add the script prior to jquery, but since it doesn't rely on it you should be ok. If that doesn't fix it and you have verified all the files are loading correctly, then you likely have a JavaScript conflict somewhere. Surprisingly IE9-IE10 has a decent JavaScript debugger under "Developer Tools" and choose the "Script" tab. Refresh your page and you may be able to pinpoint where (or which file) your JavaScript is breaking. There are also tools for/within Firefox/Chrome, etc...
 
jlajax







PostPosted: Sun Aug 18, 2013 8:34 pm Reply with quote

My thanks for the lesson. I have successfully installed the scripts. They are appearing as they should in the source code and I can click through and see the scripts from the source code links. The menu still isn't working but I learned what I was trying to learn. I am assuming then that there are conflicts that I have neither the time nor the skill to diagnose and fix. I did learn what I was trying to learn. You folks are the best of the best! I couldn’t ask for better teachers.


RavensScripts RavensScripts RavensScripts RavensScripts RavensScripts RavensScripts
 
jlajax







PostPosted: Mon Aug 19, 2013 10:53 pm Reply with quote

Code:


Tenacity Rules I got it working. Here is my fix. Is it a good hack?
I placed all the required files in a customMenu.html. The menu always has worked in html. customMenu.html is a complete html page with the scripts included in their proper places. After verifying that it worked I moved it to DeepBlue root and called it in theme.php with include(‘customMenu.html’); I even got the php when I split the table right on the first try!  Ohhh Yeah It works!!!!! Yipeeeeee.. What say you good folks of my solution?



RavensScripts RavensScripts RavensScripts RavensScripts RavensScripts RavensScripts RavensScripts RavensScripts
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Other

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©