The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
||||
|
||||
[help] Displaying Variable after links
this should be my last request for help regarding this.
I am trying to show external link clicks next to links in post, like how twitter forums do: I have everything ready, I just need help getting the count to show next to links in post through plugins. plugin: postbit_display_complete Code:
$this->post['message'] = str_replace('href="', 'href="./out.php?link=', $this->post['message']); $this->post['signature'] = str_replace('href="', 'href="./out.php?link=', $this->post['signature']); out.php which captures the link to the database: PHP Code:
Something like this should return the results: Code:
$vbulletin->db->query_first(" SELECT SUM(hits) AS hits FROM " . TABLE_PREFIX . "redirect WHERE url = '$drc_url' "); Code:
$drclf = $vbulletin->db->query_first(" SELECT SUM(hits) AS hits FROM " . TABLE_PREFIX . "redirect WHERE url = 'http://google.com' "); and placed $drclf[hits] in header and it worked properly (just to test) I just don't know where to hook it without causing severe queries in every postbit, or maybe even a cron task, where it updates the count every so often, and how can I get it to show after every link without modifying core files. I just need some help getting the final result like the first IMG. sorry for all the help needed, I'm better when it comes to design lol. --------------- Added [DATE]1458967207[/DATE] at [TIME]1458967207[/TIME] --------------- really really need some help. I been working non stop on this I managed to get the location where i need the number i just cant get the result to display in it. and i know this is going to cause massive queries when ever i do get it working, so i need help figuring out another way to do it. in global_start i have: Code:
$drc_url = $_GET['link']; $drclf = $vbulletin->db->query_first(" SELECT SUM(hits) AS hits FROM " . TABLE_PREFIX . "redirect WHERE url = '$drc_url' "); then in postbit_display_complete is: Code:
$post['message']=preg_replace ('</a>' , '</a>('.$drclf[hits].')' , $post['message']); also my preg replace is f'd up and looks like <(this)> in posts <> shouldnt be in it but when i remove them i get an infinite load on showthread. this is just driving me insane and i didnt think it would be this difficult. all the data is ready, i just need to return it. end goal: Attachment 154574 the table: Attachment 154575 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|