TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   Creating a vB plug-in (http://www.talkphp.com/absolute-beginners/1749-creating-vb-plug.html)

Brook 12-16-2007 05:44 PM

Creating a vB plug-in
 
I was just wondering if someone could help me get my head around plug-ins with vb :-)

To start off with I thought I would try something simple, just pull in the latest posted threads into the header of thread pages.

I guess the first thing I need to find is a hook location
2nd, I need to know the query
And third, I need to display the results of that query.

1 + 2 I think I can manage, it's 3 that stumps me!

Hook location:

'showthread_start' (or is there a global header one for all pages?)

Query:

PHP Code:

SELECT threadidtitledateline 
FROM 
" . TABLE_PREFIX . "thread 
WHERE sticky
=AND visible=AND (forumid '16' OR forumid '17' OR forumid '18')
ORDER BY dateline DESC
LIMIT 10 

That will show me the latest 10 threads from forums 16,17,18, that are visible (ie not deleted) and not stickies.

Display:

I think I need to create a custom template for the block, and a custom template for the indvidual results (that goes inside the block template)... but I'm kindof stuck on the exact php code to use :'-( (html is not a problem tho)

Each returned result would simply go into a list item, something like this - but I'm not sure how to get the results in there:

PHP Code:

<li><a href='showthread.php?$session[sessionurl]t=$[threadid]'>$[title]</a></li

Can anyone help me with this please? I think it may be useful to other vB users too 8-)

Thanks in advance!


All times are GMT. The time now is 08:38 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0