vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Display results from Plugin (https://vborg.vbsupport.ru/showthread.php?t=210840)

Jaiibee 04-10-2009 09:58 AM

Display results from Plugin
 
Ok, so I have made my own plugin called "Custom Classifieds Listing", with a name of "Automated Classifieds Listings"

Code:

$sql = mysql_query('SELECT * FROM vb_classifieds_ads WHERE categoryid = 1');

while ($row = mysql_fetch_array($sql))
{
echo $row['title'];
}


That's what I've got. It display the only entry that's in that table, however it displays it at the top of the page before the header.

Ok, so basically, I want to know how to position this output in my templates.
I want to be able to say "$post[ccl_posthing]" and the results from that MySQL query is displayed.

I know this is very basic, and most likely covered where I haven't already looked, but any help would be greatly appreciated.
Thanks.

Lynne 04-10-2009 02:34 PM

Try:
PHP Code:

$post['ccl_posthing'] .= $row['title']; 


Jaiibee 04-11-2009 02:32 AM

So that goes into the plugin, and whenever I type $post['ccl_posthing'] in a template, it'll output the value retreived form $row['title'] ?

Lynne 04-11-2009 02:35 AM

That line would replace your echo line in your plugin. It should work in your template assuming you are using the correct plugin and your code is correct. Try it on your test site and see.


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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01084 seconds
  • Memory Usage 1,711KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete