vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   str_replace Question That Seems REALLY Familiar (https://vborg.vbsupport.ru/showthread.php?t=305734)

Digital Jedi 12-11-2013 08:39 AM

str_replace Question That Seems REALLY Familiar
 
It's 5:30 in the morning. I slept for about three hours in my daughter's bed making sure she stopped jumping up like a prairie dog and yelling at the night light. (Don't ask. It's something she does. On school nights.) So I'm not sure why my plugin isn't working.

[minicode]parse_templates[/minicode]
PHP Code:

$picturebitLink '<a href=\"album.php?$session[sessionurl]albumid=$albuminfo[albumid]&amp;pictureid=$picture[pictureid]\">'
$hsLink $vbulletin->templatecache['highslide_album_link']; 
$vbulletin->templatecache['album_picturebit'] = str_replace($picturebitLink$hsLink$vbulletin->templatecache['album_picturebit']); 

I have this dim recollection that I ran into this issue once before way back when Boofoo was still with us. I think Superman or BoP said it had to do with the ? but couldn't understand why. Anyone run into this issue before? I'm going to sleep. Wake me when you've wrote my plugin for me...zzzzzzzzzzzzzzzzzzzzzzzzzzzzz.....

ozzy47 12-11-2013 10:03 AM

Perhaps try this:

PHP Code:

$picturebitLink '<a href="album.php?' $session['sessionurl'] . 'albumid=$albuminfo[albumid]&amp;pictureid=$picture[pictureid]">'
$hsLink $vbulletin->templatecache['highslide_album_link']; 
$vbulletin->templatecache['album_picturebit'] = str_replace($picturebitLink$hsLink$vbulletin->templatecache['album_picturebit']); 


Digital Jedi 12-11-2013 04:17 PM

Thanks. This doesn't appear to work for me, either. I suppose I could replace the link a bit at a time, but that seems messy (not to mention gives me weird looking templates.) So I guess it isn't just conditionals and line breaks that are a problem with str_replace.

Thank you for bearing with my 5AM silliness.

ozzy47 12-11-2013 07:13 PM

What is not working, the link, the replace, or all of it?

Digital Jedi 12-11-2013 07:16 PM

It's not replacing the link. I am curious as to why that doesn't work, but I went ahead and replaced the link in a couple of parts, instead of all at once.

ozzy47 12-11-2013 07:21 PM

Yeah that is curious, what hook were you using, so if I ever get board I can play around.

Digital Jedi 12-11-2013 07:52 PM

<i>parse_templates</i>, which is working for other str_replace functions I have in the same plugin.


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