vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Variables for thread title (https://vborg.vbsupport.ru/showthread.php?t=275312)

Przemoo 12-10-2011 06:21 PM

Variables for thread title
 
Hello, regarding to this thread - https://www.vbulletin.com/forum/show...-alt-attribute i need to know what variable is use in .php files for thread title ? i've tried "$thread[title]" but not working . thanks in advance

LifesGreatestGift 12-10-2011 06:51 PM

AdminCP>Plugins & Products>Add new plugin>

Product: vBulletin
Hook Location: postbit_display_complete
Title: add alt="" tags to images
PHP Plugin Code:
Code:

$this->post['message'] = str_replace('<img', '<img alt="your alt tags here"', $this->post['message']);
Plugin is active: yes

You will just need to figure out how to echo the title variable in there somehow.

Przemoo 12-10-2011 06:56 PM

that's the point, title variable. but i don't have any idea which variable i have2 use ;d

LifesGreatestGift 12-10-2011 07:18 PM

have you tried $post['title'] seeing as this is a posbit edit? or {vb:raw post.title}

not really sure how to include those into your custom PHP

HMBeaty 12-10-2011 07:22 PM

Maybe this?

PHP Code:

$this->post['message'] = str_replace('<img''<img alt="'.$post['title'].'"'$this->post['message']); 

--------------- Added [DATE]1323548963[/DATE] at [TIME]1323548963[/TIME] ---------------

Ok, I just tested the above code and worked just fine for me :)

LifesGreatestGift 12-10-2011 07:33 PM

it was the 2 . (periods) thanks HMBeaty :)

HMBeaty 12-10-2011 07:35 PM

Quote:

Originally Posted by TheWindows7Site (Post 2276581)
it was the 2 . (periods) thanks HMBeaty :)

Look closer ;)

Inside the 2 quotation marks, there are 2 single quotes as well :)

Przemoo 12-10-2011 08:51 PM

thank you, working perfectly :)


All times are GMT. The time now is 12:07 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.01938 seconds
  • Memory Usage 1,725KB
  • 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
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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