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.

My 2 cents on 9's forums list


Print Track
The list would look cleaner if it was a dropdown and not all on 1 page..see what I mean here:

http://www.frackemall.com/nebula/infusions/forum/index.php

Just a thought!

17 replies

Woah. Run a Custom Template then to your liking. Here is how:

Create a new file in Septenary Theme / Templates folder. Call it custom_forum_item.php.

The code (copied from Forum Infusion/Templates/forum_main.php):

CodeDownload  

/**
    * Switch between different types of forum list containers
    * @param $data
    * @param $i
    */
   function render_forum_item($data, $i) {
      global $locale;
      if ($i > 0) {
         echo "<div id='forum_".$data['forum_id']."' class='forum-container'>\n";
      } else {
         echo "<div id='forum_".$data['forum_id']."' class='panel panel-default'>\n";
         echo "<div class='panel-body'>\n";
      }
      echo "<div class='pull-left forum-thumbnail'>\n";
      if ($data['forum_image'] && file_exists(FORUM."images/".$data['forum_image'])) {
         echo thumbnail(FORUM."images/".$data['forum_image'], '50px');
      } else {
         echo "<div class='forum-icon'>".$data['forum_icon_lg']."</div>\n";
      }
      echo "</div>\n";
      echo "<div class='overflow-hide'>\n";
      echo "<div class='row m-0'>\n";
      switch ($data['forum_type']) {
         case '3':
            echo "<div class='col-xs-12 col-sm-12'>\n";
            echo "<a class='display-inline-block forum-link' href='".$data['forum_link']['link']."'>".$data['forum_link']['title']."</a>\n<span class='m-l-5'>".$data['forum_new_status']."</span><br/>";
            echo $data['forum_description'] ? "<div class='forum-description'>".$data['forum_description']."</div>\n" : '';
            echo ($data['forum_moderators'] ? "<span class='forum-moderators text-smaller'><strong>".$locale['forum_0007']."</strong>".$data['forum_moderators']."</span>\n" : "")."\n";
            if (isset($data['child'])) {
               echo "<div class='clearfix sub-forum'>\n";
               foreach ($data['child'] as $cdata) { // <---------- THIS IS LOOP ALL CHILD OUT

// CHANGE THIS PART
echo "CHANGE THIS PART";

                  echo "<i class='entypo level-down'></i>\n";
                  echo "<span class='nowrap'>\n";
                  if (isset($cdata['forum_type'])) {
                     echo $data['forum_icon'];
                  }
                        echo "<a href='".INFUSIONS."forum/index.php?viewforum&amp;forum_id=".$cdata['forum_id']."&amp;parent_id=".$cdata['forum_cat']."' class='forum-subforum display-inline-block m-r-10'>".$cdata['forum_name']."</a></span>";

                  echo "<br/>\n";

// END CHANGE;

               }
               echo "</div>\n";
            }
            echo "</div>\n";
            break;
         default:
            echo "<div class='col-xs-12 col-sm-6'>\n";
            echo "
            <a class='display-inline-block forum-link' href='".$data['forum_link']['link']."'>".$data['forum_link']['title']."</a>\n<span class='m-l-5'>".$data['forum_new_status']."</span><br/>";
            echo $data['forum_description'] ? "<div class='forum-description'>".$data['forum_description']."</div>\n" : '';
            echo ($data['forum_moderators'] ? "<span class='forum-moderators text-smaller'><strong>".$locale['forum_0007']."</strong>".$data['forum_moderators']."</span>\n" : "")."\n";
            if (isset($data['child'])) {
               echo "<div class='clearfix sub-forum'>\n";
               echo "<div class='pull-left'>\n";
               echo "<i class='entypo level-down'></i>\n";
               echo "</div>\n";
               echo "<div class='overflow-hide'>\n";
               foreach ($data['child'] as $cdata) {
                  if (isset($cdata['forum_type'])) {
                     echo $data['forum_icon'];
                  }
                        echo "<a href='".INFUSIONS."forum/index.php?viewforum&amp;forum_id=".$cdata['forum_id']."&amp;parent_id=".$cdata['forum_cat']."' class='forum-subforum display-inline-block m-r-10'>".$cdata['forum_name']."</a><br/>";
               }
               echo "</div>\n";
               echo "</div>\n";
            }
            echo "</div>\n";
            echo "<div class='hidden-xs col-sm-3 col-md-2 p-l-0 text-right'>\n";
            echo "<div class='text-lighter count'>".$data['forum_postcount_word']."</div>\n";
            echo "<div class='text-lighter count'>".$data['forum_threadcount_word']."</div>\n";
            echo "</div><div class='forum-lastuser hidden-xs hidden-sm col-md-4'>\n";
            if ($data['forum_lastpostid'] == 0) {
               echo $locale['forum_0005'];
            } else {
               echo "<div class='clearfix'>\n";
               if (!empty($data['last_post']['avatar'])) echo "<div class='pull-left lastpost-avatar m-t-5'>".$data['last_post']['avatar']."</div>";
               echo "<div class='overflow-hide'>\n";
               echo "<span class='forum_profile_link'>".$data['last_post']['profile_link']." ".$data['last_post']['time']."</span>\n";
               echo "<a class='lastpost-goto' href='".$data['last_post']['post_link']."' title='".$data['thread_subject']."'><i class='fa fa-external-link-square'></i></a><br />\n";
               echo fusion_first_words(strip_tags($data['last_post']['message']), 10);
               echo "</div>\n</div>\n";
            }
            echo "</div>\n";
      }
      echo "</div>\n"; // end row
      echo "</div>\n"; // end overflow-hide
      if ($i > 0) {
         echo "</div>\n";
      } else {
         echo "</div>\n</div>\n";
      }
   }



Then, go to theme.php file of Septenary..

Find:
CodeDownload  

// Declare custom codes functions here
include THEME."templates/custom_news.php";



Include your custom template. Add after the custom_news.php

CodeDownload  

include THEME."templates/custom_forum_item.php";

Beauty lies in the eyes of the beholder... you should do whatever you think fit. That's why default ones are only done for "presentation" only.

I'll be always helping everyone out to familiarize with PHP-Fusion 9.. just ask anyway no matter how trivial the questions are.
Thank You Chan....Looks like I'm going to have to update the theme, files look different. I've never used github, so here goes.
Grabbed all files from github and made the changes, now to upload.... :-):D
Line 31 of theme.php blew up. Line is:

CodeDownload  
const THEME_BULLET = "<img src='".THEME."images/bullet.png' class='bullet'  alt='&raquo;' />";



I noticed a period before THEME, is that supposed to be there?
Uhm, i'm not sure where you're referring to but constant must be echo in enclosed (colon dot) --> ".xxxx."

if there are nothing in front between 2 php codes, no need to add colon dot.
CodeDownload  

echo THEME."folder/";



If there are something in between 2 php codes, need to add colon dot.

CodeDownload  

echo "<a href='      ".THEME."/folder/me.gif       '> ". THEME ." </a>";



Except for string:

CodeDownload  

echo $string; // is ok
echo "I am not a php $string is ok";

Ok Chan, that did answer my question. I'll reinstall and post the error that I get when I run the theme....
The error:

Parse error: syntax error, unexpected '.', expecting ',' or ';' in /hermes/walnaweb14a/b538/pow.daimonbok/htdocs/nebula/themes/Septenary/theme.php on line 35

This is the section of theme.php // Definition of Constant

Below is what's on line 35 of theme.php

const THEME_BULLET = "<img src='".THEME."images/bullet.png' class='bullet' alt='&raquo;' />";
Rechecked all the code using an online php code checker, found no problems, but theme blows up. Can't figure that out????
Still can't get it to work....don't know if I need to update some other file in RC3 to stop the errors with the new theme lay out....
Upgrade your server PHP Version? Latest is 7.0 now
I'll send an e-mail to customer service about the problem....don't know if they'll act on it...

Quote

Upgrade your server PHP Version? Latest is 7.0 now
- by Chan


Are most new functions in 9 going to need php 7?
No, they ought to run fine on 5.6 at least minimum.

For the constant error, it's an easy fix, please show me your error logs.
Ok, added all of this and nothing changed.
This is fixed too?

Quote

This is fixed too?
- by Chan


No, I replied after I uploaded and received no errors, should have checked to see if it accomplished the task before posting, but at least there were no errors...
author daimonbok1
forumModifications and Requests - 9
replies18 posts
viewed5,737 times
activeLast updated on 3 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: Chan, daimonbok1