The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
i am trying to get the favourite mod from the arcade hack to work on another part of my forum so far php correct but theres a problem with the script the image is not changing on click ? and ideas.
PHP Code:
|
#2
|
||||
|
||||
![]()
I'm not entirely sure, but I don't think you can change a src like that. I think you have to use Image objects, like this:
Code:
<script type="text/javascript"> var lastfav; var subfav = new Image(); var addfav = new Image(); subfav.src = 'images/thread/subfav.gif'; addfav.src = 'images/thread/addfav.gif'; // Favorites handling. function favsprocess() { if (xml.handler.readyState == 4 && xml.handler.status == 200 && xml.handler.responseText) { thisfav = document.getElementById('favs_' + lastfav); if (xml.handler.responseText==1) { thisfav.src = subfav.src; thisfav.alt = 'Remove Favourite'; thisfav.title = 'Remove Favourite'; } else if (xml.handler.responseText==2) { thisfav.src = addfav.src; thisfav.alt = 'Add Favourite'; thisfav.title = 'Add Favourite'; } } } function dofavs(threadid) { xml = new vB_AJAX_Handler(true); xml.onreadystatechange(favsprocess); lastfav = threadid; xml.send('tindex.php', 'do=processfav&threadid=' + threadid); } </script> -- hugh |
#3
|
|||
|
|||
![]()
worked a treat m8 thx
PHP Code:
the $tindex look like this 1223,3434,5252,5251 etc |
#4
|
||||
|
||||
![]()
Can you post the whole query?
The only thing I can think of without any context is that maybe you are using 'single quotes' rather than "double quotes", so $tindex isn't getting expanded. -- hugh |
#5
|
|||
|
|||
![]() PHP Code:
|
#6
|
||||
|
||||
![]()
Nothing obvious wrong with that.
You might want to try assigning the query to a variable and var_dumping() it before it executes, so you can copy and paste the literal query into somelike like phpMyAdmin or a mysql command line, and see what it actually generates. -- hugh |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|