Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

Guide: 7.01 - 7.02 theme.php changes

I've made a list of the theme.php changes/additions from v. 7.01 to v. 7.02. So this guide should help you upgrade your 7.01 theme to 7.02, if you want to give it a go yourself!

Notice that this guide only concerns the theme.php, and is covering the basic upgrade of your theme, but I will advice you to also read this thread, here on Main, about the new style CSS options in the 7.02 series:
Guide:: New PHP-Fusion 7.02 Style Classes
CodeDownload  

---------------------------------------------------------------------------------------------------------------------------------
>>> 7.01 - 7.02 Theme changes, in theme.php (comparing the old, 7.01, with the new, 7.02 theme.php from the Theme 'Gillette') <<<
---------------------------------------------------------------------------------------------------------------------------------

1) Code change, in function render_page:
----------------------------------------

Ex. old code:
-------------

function render_page($license = false) {
   
   global $settings, $main_style, $locale;


Ex. new code:
-------------

function render_page($license = false) {
   
   global $settings, $main_style, $locale, $mysql_queries_time;

--------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------

2) NEW code-addition - Add this, just after the //Footer-code's end, but inside the function render_page code:
--------------------------------------------------------------------------------------------------------------
   
   /*foreach ($mysql_queries_time as $query) {
      echo $query[0]." QUERY: ".$query[1]."<br />";
   }*/

----------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------

3) NEW code-addition, function render_comments - Add this, just after the function render_page code's end:
----------------------------------------------------------------------------------------------------------

/* New in v7.02 - render comments */
function render_comments($c_data, $c_info){
   global $locale, $settings;
   opentable($locale['c100']);
   if (!empty($c_data)){
      echo "<div class='comments floatfix'>\n";
         $c_makepagenav = '';
         if ($c_info['c_makepagenav'] !== FALSE) {
         echo $c_makepagenav = "<div style='text-align:center;margin-bottom:5px;'>".$c_info['c_makepagenav']."</div>\n";
      }
         foreach($c_data as $data) {
           $comm_count = "<a href='".FUSION_REQUEST."#c".$data['comment_id']."' id='c".$data['comment_id']."' name='c".$data['comment_id']."'>#".$data['i']."</a>";
         echo "<div class='tbl2 clearfix floatfix'>\n";
         if ($settings['comments_avatar'] == "1") { echo "<span class='comment-avatar'>".$data['user_avatar']."</span>\n"; }
           echo "<span style='float:right' class='comment_actions'>".$comm_count."\n</span>\n";
         echo "<span class='comment-name'>".$data['comment_name']."</span>\n<br />\n";
         echo "<span class='small'>".$data['comment_datestamp']."</span>\n";
   if ($data['edit_dell'] !== false) { echo "<br />\n<span class='comment_actions'>".$data['edit_dell']."\n</span>\n"; }
         echo "</div>\n<div class='tbl1 comment_message'>".$data['comment_message']."</div>\n";
      }
      echo $c_makepagenav;
      if ($c_info['admin_link'] !== FALSE) {
         echo "<div style='float:right' class='comment_admin'>".$c_info['admin_link']."</div>\n";
      }
      echo "</div>\n";
   } else {
      echo $locale['c101']."\n";
   }
   closetable();   
}

-----------------------------------------------------------------------------
-----------------------------------------------------------------------------

4) Code change, in function render_news, affecting the news category images:
-----------------------------------------------------------------------------

Ex. old code:
-------------

   echo "<td class='main-body middle-border'>".$news."</td>\n";

Ex. new code:
-------------

   echo "<td class='main-body middle-border'>".$info['cat_image'].$news."</td>\n";

---------------------------------------------------------------------------------------
>>> theme.php changes END! <<<
---------------------------------------------------------------------------------------


------------------------------------------------------------------------
>>> New Footer Copyright code-variation possibilities, in theme.php: <<<
------------------------------------------------------------------------

1) Footer Copyright kode can now be displayed in 1 or 2 lines, and assigned a class:
------------------------------------------------------------------------------------

Usage:

// Default 2 lines
showcopyright()

// Only one line
showcopyright("", true)

Or:

// Only one line
showcopyright($class = "", $nobreak = true)

--------------------------------------------
>>> Footer Copyright code-variation END! <<<
--------------------------------------------

I tried it with Blue4U theme and it worked fine, but the button "Read more" disappeared, only empty box, not clickable :(
I've just upgraded the D-Blog theme, on one of my sites, like descriped above, and had no problems doing that - it works just fine, so maybe you've made a mistake somehow?

If you want support on the Blue4U theme, please use the support thread for that. Okay?

Besides that, I asked the guys out there for a confirmation on this "theme upgrade guide", if I got it right, and I'm still waiting for that answer - so there's no use following it untill, I get that confirmation! ;)

UPDATE: I've just upgraded the Blue4U theme, following my own guide, and it worked just fine. No errors on the 'Read More' button! So you must have made a mistake when trying to upgrade the theme. So you must try upgrading it, one more time! ;)
I'm sorry for bothering, everything is OK, I just expected something like separate button because in the same line as "read more", "reads" etc. there is a light-blue box on the right that dragged my attention away. That's probably because I got cold just on Christmas and I don't feel very well. Thanks for the great tutorial, I needed it.
No problem mate! Just glad to hear that it worked like it should - the second time around. ;)
And thanks to you, for the feedback. :)

EDIT: Changed the first post to be more descriptive concerning the Guide, and refering to the new 7.02 style classes as well!
Thread Information
Author
Posted In
Replies
5 posts
Views
3738 times
Last Post
Last updated on 8 years ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: Harly, Kot