The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Connecting to mysql when you click
Hi,
I try to add "broken link" function into one of plugins. In postbit plugin when you click the text, it add your ip and titleid into mysql. But i don't know what should i write for a href. In the thread if i click the link, it doesnt work but writing the link to the web browser address bar and clicking ENTER. It Works... like this: https://vborg.vbsupport.ru/showthrea...=67731?do=link Code:
<plugin active="1" executionorder="5"> <title>Broken Link</title> <hookname>postbit_display_start</hookname> <phpcode><![CDATA[ $linkler = $this->registry->db->query_read("SELECT * FROM broken_link where url LIKE '$post[threadid]'"); $sonuc=mysql_num_rows($linkler); if ($_REQUEST['do'] == 'link' && $sonuc < 1) { $broken_gonder = $this->registry->db->query_read("INSERT INTO broken_link (ip, url) VALUES ('".$_SERVER["REMOTE_ADDR"]."', '".$post[threadid]."')"); } ]]></phpcode> </plugin> Code:
<template name="showthread_extra_fields" templatetype="template" date="1140414721" username="uname" version="1"><![CDATA[] <if condition="$sonuc == 0"> <a href="/showthread.php?t=$post[threadid]?do=link" onClick="alert('It's OK')">Report Broken Link</a> </if> ]></template> |
#2
|
|||
|
|||
When you say it doesn't work, what do you mean? Does anything happen at all when you click it?
Edit: also, your "It's OK" message contains a single quote (apostrophe), so that makes the quotes mismatched. |
#3
|
|||
|
|||
Quote:
When i click, only alert message comes.. Nothing adds into database.. |
#4
|
|||
|
|||
Any help ?
|
#5
|
|||
|
|||
I don't know why it wouldn't work if the url is correct. Have you ever used the Firebug addon for FireFox? It might let you see if a call is being made, or if there are any javascript errors occuring. Have you tried it without any onClick? (Probably you added that later as a test).
Also, the url you have above has two '?' in it, I think what you want is: Code:
href="/showthread.php?t=$post[threadid]&do=link" but I don't think that would keep it from working at all (it should still at least reload the page, I think). |
Благодарность от: | ||
cagatayh |
#6
|
|||
|
|||
Quote:
Code:
href="/showthread.php?t=$post[threadid]&do=link" Thanks a lot |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|