vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Forum Title as Image or Text (Depending on page) (https://vborg.vbsupport.ru/showthread.php?t=194875)

cinnamonbits 10-28-2008 11:35 PM

Forum Title as Image or Text (Depending on page)
 
Hey there everyone. I'm a novice when it comes to php and even more so when it comes to vBulletin's plugin and hook system. I would be grateful if anyone could help me with a problem I'm having.

On my forum's index page, I would like to have the titles of the forums appear as linkable images. How I figured I'd do this is simply edit the Forum Title to be an image. Yet, I realized that it was an image anywhere the forum title appeared.

I then attempted to create a plugin which would decipher whether or not the forum title was being called on the index.php page. If so, it would show the image, and if not, it would show the text title. This is the code I attempted to use in the plugin:

PHP Code:

$currentFileName $_SERVER['PHP_SELF'];

$page_parts Explode('/'$currentFileName);

$button_page_name $page_parts[count($parts) - 1]; 

if (
$button_page_name == "index.php"

   
$north_button "<img src=\"images/buttons/site_buttons/north_button.png\" border=\"0\">"


else 

   
$north_button "North"


I then went to the forum settings and attempted to set the forum title to:

PHP Code:

<?php echo $north_button?>

This did not work, and I must say that I am thoroughly perplexed as to what I should do. Thank you in advance for any guidance.

Rich 10-29-2008 02:26 AM

I would use template conditions if I were trying to do that. Something along these lines:

Code:

<if condition="THIS_SCRIPT == 'index'">Show Image<else />Show text</if>


All times are GMT. The time now is 05:55 AM.

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.00964 seconds
  • Memory Usage 1,715KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete