Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 12-02-2009, 06:25 PM
Seven Skins's Avatar
Seven Skins Seven Skins is offline
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Search and str_replace

I was just wondring can {vb:raw navbits.breadcrumb} be search and replace by using the code below?

PHP Code:
$find "{vb:raw navbits.breadcrumb}";
$replace "Joe Blogs";
$myvar str_replace($find,$replace,$myvar); 
I have been trying to do this but no luck. I can search and replace normal HTML or Text.

Thanks

.
Reply With Quote
  #2  
Old 12-02-2009, 06:37 PM
BBR-APBT's Avatar
BBR-APBT BBR-APBT is offline
 
Join Date: Feb 2009
Location: Maryland
Posts: 946
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this in a plugin?

Try this code I got from one of Lynne's mods.
Code:
$find = '{vb:raw navbits.breadcrumb}';
$replace = "Joe Blogs". PHP_EOL;
$output = str_replace($find,$replace.$find, $output);
Reply With Quote
  #3  
Old 12-02-2009, 06:38 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No. You need to do search and replace on something that is 'real', not some variable that needs to be parsed.

edit: ". PHP_EOL" just gives a line break in the source code - php End Of Line.
Reply With Quote
  #4  
Old 12-02-2009, 06:45 PM
Seven Skins's Avatar
Seven Skins Seven Skins is offline
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK ... Is there any way I can add "{vb:raw my_text}" to the very top of footer template ... as the 1st line in footer template is "{vb:raw ad_location.ad_footer_start}".

.
Reply With Quote
  #5  
Old 12-02-2009, 06:51 PM
BBR-APBT's Avatar
BBR-APBT BBR-APBT is offline
 
Join Date: Feb 2009
Location: Maryland
Posts: 946
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Put it in the ad_footer_start template.
Reply With Quote
  #6  
Old 12-02-2009, 06:52 PM
Seven Skins's Avatar
Seven Skins Seven Skins is offline
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BBR-APBT View Post
Is this in a plugin?

Try this code I got from one of Lynne's mods.
Code:
$find = '{vb:raw navbits.breadcrumb}';
$replace = "Joe Blogs". PHP_EOL;
$output = str_replace($find,$replace.$find, $output);
I have tried this but does not work .... as Lynne said we need some thing real.
Yes it is a plugin.
I need to add "{vb:raw my_text}" on top of my footer template via plugin.

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

Quote:
Originally Posted by BBR-APBT View Post
Put it in the ad_footer_start template.
"{vb:raw my_text}" has another template in it so this is not going to work.
Reply With Quote
  #7  
Old 12-02-2009, 07:00 PM
BBR-APBT's Avatar
BBR-APBT BBR-APBT is offline
 
Join Date: Feb 2009
Location: Maryland
Posts: 946
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok re-ordered to place it just below
Code:
{vb:raw ad_location.ad_footer_start}
{vb:raw ad_location.global_above_footer}
and above
Code:
<div class="footercontainer">
This should do the trick.
Code:
$find = '<div class="footercontainer">';
$replace = "{vb:raw my_text}". PHP_EOL;
$output = str_replace($find,$replace.$find, $output);
Reply With Quote
  #8  
Old 12-02-2009, 07:17 PM
Seven Skins's Avatar
Seven Skins Seven Skins is offline
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am making a product to release here and I want the users to just install and use ... no template modifications if possible.

If the template modification is needed I will just ask them to add "{vb:raw my_text}" on top of the footer template. It saves me writing plugins loads of plugins.

Thanks for your help.

.
Reply With Quote
  #9  
Old 12-02-2009, 07:22 PM
BBR-APBT's Avatar
BBR-APBT BBR-APBT is offline
 
Join Date: Feb 2009
Location: Maryland
Posts: 946
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Seven Skins View Post
I am making a product to release here and I want the users to just install and use ... no template modifications if possible.

If the template modification is needed I will just ask them to add "{vb:raw my_text}" on top of the footer template. It saves me writing plugins loads of plugins.

Thanks for your help.

.
So did this work?
Code:
$find = '<div class="footercontainer">';
$replace = "{vb:raw my_text}". PHP_EOL;
$output = str_replace($find,$replace.$find, $output);
people help me I help others.
Reply With Quote
  #10  
Old 12-02-2009, 07:26 PM
Seven Skins's Avatar
Seven Skins Seven Skins is offline
 
Join Date: Sep 2008
Location: London, UK
Posts: 1,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes it works I did try this before but thats the 3rd line in footer template. When you put ads in ad_location templates .. it screws the layout specially if the ads are wide.

.
Reply With Quote
Reply

Thread Tools
Display Modes

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 06:27 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.18546 seconds
  • Memory Usage 2,257KB
  • Queries Executed 11 (?)
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
  • (6)bbcode_code
  • (1)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete