The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
About RSS Poster Hooks
Hi i want to write a plugin which is adds my wordpress posts a link which is rss posted on forum. And now i'm using rssfeeddata_postsave hook but how can i take new forum posts link?
|
#2
|
|||
|
|||
I can't quite follow what it is you want to do, but are you sure rssfeeddata_postsave if the right hook? It looks like that hook is called when you add an rss feed in the adminCP ("post" in this case means after it's saved and doesn't refer to posted messages).
|
#3
|
|||
|
|||
so, which hook i can use?
|
#4
|
|||
|
|||
Well, like I mentioned, I don't really understand what you want to do. It kind of sounds like you might need more than one plugin.
|
#5
|
|||
|
|||
Well, i'm trying again to explain. I'm using rss poster in vBulletin, it's getting data from my wordpress's rss feed. And opens a thread for each one. And i want to add this thread's link to end of my wordpress posts'. Is it sufficently clear?
|
#6
|
|||
|
|||
OK - there are no hooks in the rss poster code, but you might be able to use threadfpdata_postsave. That gets called every time a thread is created so you have to check something to make sure it's one of your wordpress threads. I think the feed url might be available using something like:
Code:
global $feed; if (is_array($feed) AND strncmp($feed['url'], 'something', len) == 0) { // add your link } |
#7
|
|||
|
|||
What about the rssposter_parse_rss? Is there any guide about hooks?
--------------- Added [DATE]1327827918[/DATE] at [TIME]1327827918[/TIME] --------------- Is this code works? Or what i have to do? Code:
global $feed; if (is_array($feed) AND strncmp($feed['url'], 'something', len) == 0) { if (!empty($threadinfo['item_id'])) { require_once(DIR . '/includes/class_bbcode.php'); $bbcode_parser = new vB_BbCodeParser($vbulletin, fetch_tag_list()); mysql_connect('localhost', 'root', ''); mysql_select_db('_wp'); mysql_query("update wp_posts set post_content=concat(post_content,'</ br></ br></ br> {feed:title}<a href=\"{feed:link}\"> {feed:title} </a>') where post_title = '{feed:title}'"); mysql_close(); } |
#8
|
|||
|
|||
Quote:
I don't know of any guide to hooks, but there could be one. I just look at the php code to see where they are. Quote:
PHP Code:
Also, you need to replace 'something' and 'len' in the above if statement to be something that would check to see if the feed url is the url of your wordpress feed. |
#9
|
|||
|
|||
PHP Code:
Code:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<a href=\"http://bburl.co/showthread.php?t=threadid\">link</a>) where id = 1794' at line 1 |
#10
|
|||
|
|||
Oh, I think the mysql line is missing quotes around the link string. So something like:
PHP Code:
(I fixed it above as well). |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|