vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Miscellaneous Hacks - Dynamic Amazon Links (https://vborg.vbsupport.ru/showthread.php?t=163393)

RedWingFan 06-04-2009 07:34 PM

Never mind that last bit above--I am now using the modified version of the plugin's PHP file above (post #85 by Hidden Gamma), and I see the modified lines. (I had manually made changes, but missed two lines.) So the regex is fine as is.

Nonetheless, I ran the plugin as a regular PHP file (removed the function syntax), assigned $text manually, and found out that the plugin's PHP file is rewriting the URL correctly, with our associate ID in it. So, the problem does not appear to be with the functions_amazon_links.php file.

And those with .co.jp and .co.uk should be happy to know that those URLs are rewriting properly as well (the domains show up properly).

So for some reason, the rewritten code is not making it to the posts, either when made as a new thread, a normal reply, or a quick reply.

Someone with access to a web server can test this themselves also. Comment out this line at the top of the file:

PHP Code:

// function amazon_links($text) { 

Right below it, use something like this:

PHP Code:

$text "[url=\"http://www.amazon.co.uk/No-Line-Horizon-U2/dp/B001O0EQ5U/ref=sr_1_1?ie=UTF8&s=music&qid=1243921433&sr=1-1\"]Click Here[/url]"

At the bottom of the file, comment out these two lines:

PHP Code:

//    return $text;
// } 

...and add this line below it:

PHP Code:

print $text

Run this file in the browser, and you'll see the output with the correct country's associate ID inserted, and the correct domains in the URL.

So my hiccup has to do with the hook location...? Or the PHP code that calls the plugin? This plugin file works, but changes don't end up in the finished post. Once I solve that, I'm golden.

One added bonus: we have one or two members who "innocently" :rolleyes: post Amazon links to a CD, with their own Associates ID inserted in the URL. This will kill that, and save my staff having to sniff these out.

SirHappy 06-20-2009 03:16 PM

thx. works in 3.8.3.

jca2112 07-31-2009 06:57 PM

This doesn't work for me in vB 3.8.3.

Any help updating this for 3.8.3 (and adding support for sites like Amazon.co.uk) is appreciated.

meeja 08-31-2009 10:24 AM

Does this mod work for 3.8.4?

derrene 12-13-2009 04:55 PM

Quote:

Originally Posted by meeja (Post 1877109)
Does this mod work for 3.8.4?

work

RedWingFan 12-13-2009 10:23 PM

I haven't gotten it to work in ANY version.

Uninstalled.

Phillip Chapman 01-01-2010 06:34 PM

Does anyone know if this mod will work in vB 4.0 or will it need to be updated for the new version? Thanks in advance.

Claygp 01-14-2010 11:31 PM

Quote:

Originally Posted by Phillip Chapman (Post 1944208)
Does anyone know if this mod will work in vB 4.0 or will it need to be updated for the new version? Thanks in advance.

Works perfect for me on 4.0.1 after the upgrade from 3.8.4. I didn't even have to disable it or enable it or anything. :D

derrene 03-06-2010 08:24 AM

4.0.2 works too

drudge99 08-12-2010 04:44 PM

Does anyone have this installed with 4.0.6?


All times are GMT. The time now is 04:28 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.01143 seconds
  • Memory Usage 1,740KB
  • 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
  • (4)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete