TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 12-16-2007, 05:44 PM   #1 (permalink)
The Acquainted
Inquisitive 
 
Join Date: Jul 2005
Location: UK
Posts: 121
Thanks: 41
Brook is on a distinguished road
Default 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

Thanks in advance!
__________________
PS3 Forums on GameSlurp - the site for gaming fans!
Brook is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 12:13 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design