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 Themes
Author Message
jlajax
Ardent RavenCMS Supporter



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

PostPosted: Tue Nov 11, 2008 10:08 am Reply with quote

Howdy good people. I just discovered thememonster.com and I am curious what experiences folks have had with their phpNuke themes. Is there any difficulty integrating with RavenNukes(tm) version? My thanks for your responses.

RavensScripts
 
View user's profile Send private message
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Tue Nov 11, 2008 2:17 pm Reply with quote

Ravennukes themes are not THAT different from PHPnuke themes. It all depends on how they are written, just give it a try. One thing I would do first with any new theme is run a w3c validation on the output.

http://validator.w3.org/#validate_by_input

If they have a themes demo page, do a view source on the result page, copy the source to the validator and run it. If there's a lot of errors I'd run from the theme like it was the plague.
 
View user's profile Send private message Visit poster's website
jlajax







PostPosted: Tue Nov 11, 2008 6:33 pm Reply with quote

Many thanks for the referance. It is an eye opener. Me thinks I have a lot of reading to do.

RavensScripts
 
CodyG
Life Cycles Becoming CPU Cycles



Joined: Jan 02, 2003
Posts: 714
Location: Vancouver Island

PostPosted: Wed Nov 12, 2008 7:42 am Reply with quote

Reading, asking questions, and RavenNuke are all good.
Many themes are not good. If I was starting up a new site I would go for a css based theme.

_________________
"We want to see if life is ubiquitous." D.Goldin 
View user's profile Send private message
emmaphp
Worker
Worker



Joined: Aug 22, 2006
Posts: 192

PostPosted: Wed Jan 14, 2009 10:34 pm Reply with quote

Hi 'All',

I have just installed a new version of Raven Nuke 2.3.

I purchased a theme to use with tis, but it will not display correctly when selected.

Please can someone advise what the issue is, moreover what I need to do in order to remmedy the situation and be able to use this new theme?

The error messages are as follows:



Warning: themeheader(banners.php): failed to open stream: No such file or directory in /themes/ThemeName/theme.php on line 50

Warning: themeheader(): Failed opening 'banners.php' for inclusion (include_path='.:/include:/usr/lib/php') in /themes/ThemeName/theme.php on line 50

Fatal error: Call to undefined function: sql_query() in /themes/ThemeName/theme.php on line 54

am running
 
View user's profile Send private message
evaders99
Former Moderator in Good Standing



Joined: Apr 30, 2004
Posts: 3221

PostPosted: Thu Jan 15, 2009 12:53 am Reply with quote

banners.php is no longer in included in newer phpNuke releases and RavenNuke

change all references in your theme.php from
Code:


include("banners.php")

TO

echo ads(0);

_________________
- Star Wars Rebellion Network -

Need help? Nuke Patched Core, Coding Services, Webmaster Services 
View user's profile Send private message Visit poster's website
jakec
Site Admin



Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom

PostPosted: Thu Jan 15, 2009 1:26 am Reply with quote

I think you are also receiving an error with the SQL query which is likely to be related to the $dbi issue that has been discussed here in the forums. I believe there is now a sticky addressing this issue.
 
View user's profile Send private message
emmaphp







PostPosted: Thu Jan 15, 2009 2:26 am Reply with quote

Hi Evaders99 & Jakec,

Thanks for your responses to my original posting.

Evanders99, in the file theme.php, I tried changing the one instance of 'banners.php' as you described, but this did not work. Additionally, the one instance is actually coded as 'include("banners.php");' so I was not sure if I should make that...

include("echo ads(0);");

or

include echo ads(0);

I have tried both of the examples above, but still receive errors.

I have included the full theme.php code below and would much appreciate any further help with this.

Thanks in advance.

Code:
<?php


/************************************************************/
/* IMPORTANT NOTE FOR THEMES DEVELOPERS!                    */
/*                                                          */
/* When you start coding your theme, if you want to         */
/* distribute it, please double check it to fit the HTML    */
/* 4.01 Transitional Standard. You can use the W3 validator */
/* located at http://validator.w3.org                       */
/* If you don't know where to start with your theme, just   */
/* start modifying this theme, it's validate and is cool ;) */
/************************************************************/

/************************************************************/
/* Theme Colors Definition                                  */
/*                                                          */
/* Define colors for your web site. $bgcolor2 is generaly   */
/* used for the tables border as you can see on OpenTable() */
/* function, $bgcolor1 is for the table background and the  */
/* other two bgcolor variables follows the same criteria.   */
/* $texcolor1 and 2 are for tables internal texts           */
/************************************************************/

$bgcolor1 = "#000000";
$bgcolor2 = "#101010";
$bgcolor3 = "#efefef";
$bgcolor4 = "#cfcfbb";
$textcolor1 = "#FFFFFF";
$textcolor2 = "#FFFFFF";

include("themes/IndustryHollywood/tables.php");

/************************************************************/
/* Function themeheader()                                   */
/*                                                          */
/* Control the header for your site. You need to define the */
/* BODY tag and in some part of the code call the blocks    */
/* function for left side with: blocks(left);               */
/************************************************************/

function themeheader() {
    global $user, $banners, $sitename, $slogan, $cookie, $prefix, $dbi;
    cookiedecode($user);
    $username = $cookie[1];
    if ($username == "") {
        $username = "Anonymous";
    }
    echo "<body bgcolor=\"#505050\" text=\"#000000\" link=\"#363636\" vlink=\"#363636\" alink=\"#d5ae83\">";
    if ($banners == 1) {
   include("banners.php");
    }
    $topics_list = "<select name=\"new_topic\" onChange='submit()'>\n";
    $topics_list .= "<option value=\"\">All Topics</option>\n";
    $toplist = sql_query("select topicid, topictext from ".$prefix."_topics order by topictext", $dbi);
    while(list($topicid, $topics) = sql_fetch_row($toplist, $dbi)) {
    if ($topicid==$topic) { $sel = "selected "; }
   $topics_list .= "<option $sel value=\"$topicid\">$topics</option>\n";
   $sel = "";
    }
    if ($username == "Anonymous") {
   $theuser = "&nbsp;&nbsp;<a href=\"account-new_user.html\">Create an account";
    } else {
   $theuser = "&nbsp;&nbsp;Welcome $username!";
    }
    $public_msg = public_message();
    $tmpl_file = "themes/Theme_Name/header.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
    blocks(left);
    $tmpl_file = "themes/Theme_Name/left_center.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}

/************************************************************/
/* 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() {
    global $index, $foot1, $foot2, $foot3, $copyright, $totaltime;
    if ($index == 1) {
   $tmpl_file = "themes/Theme_Name/center_right.html";
   $thefile = implode("", file($tmpl_file));
   $thefile = addslashes($thefile);
   $thefile = "\$r_file=\"".$thefile."\";";
   eval($thefile);
   print $r_file;
   blocks(right);
    }
    $footer_message = "$foot1<br>$foot2<br>$foot3<br>$copyright<br>$totaltime";
    $tmpl_file = "themes/Theme_Name/footer.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}

/************************************************************/
/* Function themeindex()                                    */
/*                                                          */
/* This function format the stories on the Homepage         */
/************************************************************/

function themeindex ($aid, $informant, $time, $title, $counter, $topic, $thetext, $notes, $morelink, $topicname, $topicimage, $topictext) {
    global $anonymous, $tipath;
    $ThemeSel = get_theme();
    if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
   $t_image = "themes/$ThemeSel/images/topics/$topicimage";
    } else {
   $t_image = "$tipath$topicimage";
    }
    if ($notes != "") {
   $notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
    } else {
   $notes = "";
    }
    if ("$aid" == "$informant") {
   $content = "$thetext$notes\n";
    } else {
   if($informant != "") {
       $content = "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$informant\">$informant</a> ";
   } else {
       $content = "$anonymous ";
   }
   $content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
    }
    $posted = ""._POSTEDBY." ";
    $posted .= get_author($aid);
    $posted .= " "._ON." $time $timezone ($counter "._READS.")";
    $tmpl_file = "themes/Theme_Name/story_home.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}

/************************************************************/
/* Function themearticle()                                  */
/*                                                          */
/* This function format the stories on the story page, when */
/* you click on that "Read More..." link in the home        */
/************************************************************/

function themearticle ($aid, $informant, $datetime, $title, $thetext, $topic, $topicname, $topicimage, $topictext) {
    global $admin, $sid, $tipath;
    $ThemeSel = get_theme();
    if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
   $t_image = "themes/$ThemeSel/images/topics/$topicimage";
    } else {
   $t_image = "$tipath$topicimage";
    }
    $posted = ""._POSTEDON." $datetime "._BY." ";
    $posted .= get_author($aid);
    if ($notes != "") {
   $notes = "<br><br><b>"._NOTE."</b> <i>$notes</i>\n";
    } else {
   $notes = "";
    }
    if ("$aid" == "$informant") {
   $content = "$thetext$notes\n";
    } else {
   if($informant != "") {
       $content = "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$informant\">$informant</a> ";
   } else {
       $content = "$anonymous ";
   }
   $content .= ""._WRITES." <i>\"$thetext\"</i>$notes\n";
    }
    $tmpl_file = "themes/Theme_Name/story_page.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}

/************************************************************/
/* Function themesidebox()                                  */
/*                                                          */
/* Control look of your blocks. Just simple.                */
/************************************************************/

function themesidebox($title, $content) {
    $tmpl_file = "themes/Theme_Name/blocks.html";
    $thefile = implode("", file($tmpl_file));
    $thefile = addslashes($thefile);
    $thefile = "\$r_file=\"".$thefile."\";";
    eval($thefile);
    print $r_file;
}

?>
 
emmaphp







PostPosted: Thu Jan 15, 2009 3:22 am Reply with quote

Hi again 'all',

Using logic/comparison of the theme I am having problems with, with one that does work, I have managed to make the new theme work.

I replaced the following code:


if ($banners == 1) {
include("banners.php");

With:

ads(0);

Even though this appears to have been the correct solution, please would someone confirm this is so?

Additionally, as Jakec suggested, there was a second issue, with the SQL query $dbi

To resolve this, I followed the instructions at the following link:
[ Only registered users can see links on this board! Get registered or login! ]

I opened the file mainfile.php and uncommented the following code:

@require_once(INCLUDE_PATH.'includes/sql_layer.php');

$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);


Now, while this worked, there is a suggestion it is not best to do this. Moreover instead of uncommenting this old code, it is suggested we should instead 'upgrade the old code'. Please can someone tell me how I would do this, moreover if this is really necessary?

Thanks in advance, once again.
 
jakec







PostPosted: Thu Jan 15, 2009 6:40 am Reply with quote

emmaphp, this Sticky here explains how to convert the old code to the new SQL layer: [ Only registered users can see links on this board! Get registered or login! ]
 
jakec







PostPosted: Thu Jan 15, 2009 6:42 am Reply with quote

With regards you questions, is it necessary? We would advise that in future releases the code required to run the old database layer may be removed and therefore you may as well update the code now to avoid any headaches in the future. Wink
 
emmaphp







PostPosted: Thu Jan 15, 2009 6:05 pm Reply with quote

Thanks again for that speedy reply Jakec.

Now, here is what I have done so far, before you posted your last reply.

Working logically, I said to myself that all I am doing here is adding a new theme to the Raven Nuke 2.3 package. I like to think of this new theme as a new 'skin', so in other words it is only the facade and changes to this do not actually affect any running of the site structure, database or fundamental php code/'engine'.

So for this reason, logic suggested/s to me that if the supplied themes already work with the Raven Nuke 2.3 package, then the problem I have been having, is SOLELY with code within the new theme, (as we know).

So, before you sent your last reply confirming the 'sicky URL', what I simply did, was to check the code in all files in the new themes directory, searching for the string $dbi and replaced all instances of this with $db

There was only 1 instance of this and it was located in the themes.php file.

I then opened the file mainfile.php file and made sure the following lines of code were commented out again, (as they originally were):

//@require_once(INCLUDE_PATH.'includes/sql_layer.php');

//$dbi = sql_connect($dbhost, $dbuname, $dbpass, $dbname);


The final change was to locate any instances of the code sql_fetch_row and relplace this with $db->sql_fetchrow

Again, I found this to be SOLELY in the themes.php file and there were 2 instances of this.

Once all this was done, the theme began to operate without any further issues.

It would be great if you could verify my thoughts above and if logic still prevails here and my thought process was correct etc.

Thanks.
 
jakec







PostPosted: Fri Jan 16, 2009 1:31 am Reply with quote

OK all sounds good. I would recommmend turning on error reporting and database logging just to make sure everything is working fine, but fingers crossed that has fixed it.
 
emmaphp







PostPosted: Fri Jan 16, 2009 2:05 am Reply with quote

Thanks for that reply JakeC,

Hey guess what?!!!...

The reason I was able to be as detailed at the start of this thread, with the errors being received, is simply because when I selected the theme and it did not work, (just giving a blank page), I immediately switched on the error reporting option in the config.php file. Wink

Thanks for all your help with this thread and assisting to resolve the matter.


RavensScripts
 
jakec







PostPosted: Fri Jan 16, 2009 6:38 am Reply with quote

Error reporting in the config.php file may not show all SQL errors. You can also turn on database error logging in the rnconfig.php file. Remember to make the dblog file in the rnlogs directory writeable.

...but having said this I am sure everything is probably working well, because otherwise you would be seeing some oddities.
 
yourmother
Hangin' Around



Joined: Jan 17, 2010
Posts: 27

PostPosted: Tue Nov 09, 2010 6:10 am Reply with quote

If u want u can look for urself
ireally dk what ido wrong
if uwant i give u the specs in a pm?
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Themes

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 ©