Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-05-2003, 05:24 PM
mike095 mike095 is offline
 
Join Date: Aug 2003
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Different "New Thread" graphic for each forum - without creating new templates

In vbulletin 2.2.1, we want different "New Thread" graphics for each forum.

In the template called "forumdisplay_newthreadlink"

The original code shows

<a href="newthread.php?s=$session[sessionhash]&action=newthread&forumid=$foruminfo[forumid]">

<img src="{newthreadimage}" border="0" alt="Post New Thread"></a><br>

-----------------------------------------
How can we change the image tag to be dependent on the $foruminfo[forumid]

The could might be something like:

//------------------------------------------------------------;
switch($foruminfo[forumid])
{
case "84":
<img src="/images/image84.gif" border="0" alt="Post New Thread"></a><br>
break;
//--- break prevents the code from running other cases;
case "5":
<img src="/images/image5.gif" border="0" alt="Post New Thread"></a><br>
break;
case "3":
<img src="/images/image3.gif" border="0" alt="Post New Thread"></a><br>
break;
default:
<img src="{newthreadimage}" border="0" alt="Post New Thread"></a><br>
break;
}//-- end switch;

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

but this doesn't work as an in-line script. Any ideas of a script that would switch out the button code based on the forum id?

Thanks in advance
Reply With Quote
  #2  
Old 08-05-2003, 08:57 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Put this in the proper part of forumdisplay.php
PHP Code:
switch($foruminfo['forumid'])
{
    case 
"84":
        
$newthreadimage="images/image84.gif";
    break;
    case 
"5":
        
$newthreadimage="images/image5.gif";
    break;
    case 
"3":
        
$newthreadimage="images/image3.gif";
    break;
    default:
        
$newthreadimage="images/reply.gif";
    break;

Open up forumdisplay_newthreadlink template, and find
PHP Code:
{newthreadimage
Replace it with
PHP Code:
$newthreadimage 
Reply With Quote
  #3  
Old 08-05-2003, 10:55 PM
mike095 mike095 is offline
 
Join Date: Aug 2003
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it worked - thanks !
Reply With Quote
  #4  
Old 08-05-2003, 11:04 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem, glad I could help
Reply With Quote
  #5  
Old 08-06-2003, 12:13 AM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

demo/ss?
Reply With Quote
  #6  
Old 08-06-2003, 12:15 AM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It just changes your newthread button depending on which image you choose for which forumid.
Reply With Quote
  #7  
Old 08-06-2003, 10:12 AM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The easiest thing to do here would be to to add a new field to the forum table

- miSt
Reply With Quote
  #8  
Old 08-07-2003, 04:35 AM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

or edit the template

Code:
img src="newreply{forumid}.gif"
:shrug:
Reply With Quote
  #9  
Old 08-07-2003, 10:48 AM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

^ The best idea i've heard all day

[high]* Mist wonders how he forgets the easy things like this
[/high]

I think you may have to use a variable instead but that's a good principle - you'll have to make a new image for EVERY forum you have though unfortunately

- miSt
Reply With Quote
  #10  
Old 08-07-2003, 02:48 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep that's why my way is still better

You can have an else statement, and you don't have to name your reply buttons your forumids
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:40 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04497 seconds
  • Memory Usage 2,251KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete