Announcement

Collapse
No announcement yet.

Forum Icons & Conditions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Aros
    replied
    Thank you Jake!

    Code:
    			<if condition="in_array($thread['forumid'],$GLOBALS[fmarket3])"><span class="smallfont">[market]</span></if>
    Seemed to have worked, despite an error it gave me. I never proceeded because of the error it gave me. It does work without any PHP errors in the page.

    Leave a comment:


  • Jake Bunce
    replied
    I see a missing parenthesis, marked in red:

    Code:
    <if condition="in_array($thread['forumid'],$fmarket2)"><span class="smallfont">[market]</span></if>
    And in the post by noppid I see an extra one, marked in red:

    Code:
    <if condition="in_array($thread['forumid'],$fcommun))"><span class="smallfont">[market]</span></if>
    As for the error about the second parameter, you might need to use the global scope on the second parameter, depending on which template contains the conditional:

    Code:
    <if condition="in_array($thread['forumid'],$GLOBALS[fcommun])"><span class="smallfont">[market]</span></if>
    And finally, I have seen instances where the template won't save because of that in_array() error, even though the second parameter is indeed correct. Try saving the template despite the error and see if it works. If you get errors on your forums after saving the template, then edit the template and remove the conditional.

    Leave a comment:


  • Aros
    replied
    Originally posted by Jake Bunce
    I haven't tested my instructions with 3.0.5, but they should work.
    Could you check the Thread I specified please? I'm clearly having problems, with conditionals I formed quite correct as fas as I'm concerned. Definitly need some help as to why this would or wouldn't work.

    Leave a comment:


  • Jake Bunce
    replied
    Originally posted by Aros
    Jake, does this still work in vB3.0.5? I'm having trouble getting in_array to work with 2 previously set variables; http://www.vbulletin.com/forum/showthread.php?t=126191
    I haven't tested my instructions with 3.0.5, but they should work.

    Leave a comment:


  • Jake Bunce
    replied
    Originally posted by stormblast-
    Hi,

    I didn't get how exactly this is being done. I got about 100 Boards, now 2 of those should have a unique icon.

    Then it's no good idea to replace _all_ the code in forumhome_forumbit_level1_post (and 2), is it? Then i'd have to set every forum in phpinclude?
    The template conditional makes it so the code inside the conditional only shows up for the forums you specify.

    I also posted this thread a while ago which might be of help.

    Leave a comment:


  • Aros
    replied
    Originally posted by Jake Bunce
    What I would do is setup an array of forumids in the phpinclude_start template and use the in_array() function in the templates to check for matches. This way you only have to edit the phpinclude_start template when you add more forumids.

    Go to your:

    Admin CP -> Styles & Templates -> Style Manager -> « » -> PHP Include Code Templates » -> phpinclude_start

    Add this code to that template:

    PHP Code:
    $forumicon = array(2491216); 
    The numbers inside the parenthesis are the forumids of the forums for which you want icons to show. Change these numbers appropriately, separating them by commas as shown above.

    Then in your forumhome_forumbit_level1_post and forumhome_forumbit_level2_post templates, replace the current conditions with this:

    Code:
    <if condition="in_array($forum['forumid'], $GLOBALS['forumicon'])">
    	YOUR CODE HERE
    </if>
    If you want to add an icon to a new forum, just add its forumid to your phpinclude_start template.
    Jake, does this still work in vB3.0.5? I'm having trouble getting in_array to work with 2 previously set variables; http://www.vbulletin.com/forum/showthread.php?t=126191

    Leave a comment:


  • stormblast-
    replied
    Hi,

    I didn't get how exactly this is being done. I got about 100 Boards, now 2 of those should have a unique icon.

    Then it's no good idea to replace _all_ the code in forumhome_forumbit_level1_post (and 2), is it? Then i'd have to set every forum in phpinclude?

    Leave a comment:


  • Stachel
    replied
    Originally posted by Jake Bunce
    relative to the current level
    Ohhhhhhhh that's tricky! Seems like the key thing is "relative to the current level."

    Thanks Jake!

    Stachel

    Leave a comment:


  • Jake Bunce
    replied
    Originally posted by Stachel
    What is the diff between what forumbit_Level1... controls vs what level2 controls?
    The level 1 templates are used for forums at the first level relative to the current level. Level 2 templates are used for level 2 forums.

    For example, on this page "vBulletin 3" is a level 1 forum while "vBulletin 3 Suggestions and Feedback" is a level 2 forum. On this page "vBulletin 3 Suggestions and Feedback" is a level 1 forum.

    Leave a comment:


  • Stachel
    replied
    Thanks Vigile!

    What is the diff between what forumbit_Level1... controls vs what level2 controls?

    Leave a comment:


  • Vigile
    replied
    cause its not in forumhome.

    look for forum_$forum[statusicon].gif to find where your forum icons are referenced.

    Leave a comment:


  • Stachel
    replied
    Jake Thanks!

    Thanks Jake! That diff in variable names would have tripped me up for sure.

    I was about to start implementing this, but something bizarre...

    The current icons that appear *now* on my forum are:
    - forum_new.gif (when new posts exists - the brighter red version)
    - forum_old.gif (no new posts)

    But when I search for forum_new.gif, I **only** get a hit in help_bbcodes template.

    How can this be?

    It's not even referenced in forumhome template.

    Stachel

    Leave a comment:


  • Jake Bunce
    replied
    With the forumids specified in the phpinclude_start template, you can use that condition in any template to check the forumid.

    The only thing that might change is the variable for the forumid in the condition. For forumdisplay and showthread pages you need to use $forumid instead of $forum[forumid]:

    Code:
    <if condition="in_array($forumid, $GLOBALS['forumicon'])">
    	YOUR CODE HERE
    </if>

    Leave a comment:


  • Stachel
    replied
    Heyyyyy, I bet I could use that conditional that Jake wrote to display a custom header row above the breadcrumb area when

    forumdisplay.php happens!
    Right?!?

    Leave a comment:


  • Stachel
    replied
    Wow I wanna do this!!

    Jake Bunce that is too clever!

    Ogmuk, I like your naming convention for the logo files - that makes it work easily too. Can you post the forumhome_forumbit_level1_post and forumhome_forumbit_level2_post code that you ended out using?


    Right now when there are new posts, my forum icon is a reddened version of the forum icon when there are no newposts. I really like that. Can I still do that with this?

    i.e., If I customize each forum to the person's logo, can I show

    instead of: forum_new.gif, forum_old.gif
    show: forum23_new.gif, forum23_old.gif

    Stachel

    Leave a comment:

Related Topics

Collapse

Working...
X