vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   DB & Templates (https://vborg.vbsupport.ru/showthread.php?t=101267)

OneShot 11-21-2005 09:42 AM

DB & Templates
 
Well, I finally got around to try my hands on converting a module I originally wrote for phpNuke to vBulletin 3.5.1.

I want to start by converting the roster system : http://www.usvn.net/modules.php?name=navpers&sw=roster including a nice ACP integration and more. Big plans so to speak. However Im currently stuck at the point on how to display the results I generate in my PHP file properly in the forum. Anybody has a nice Step-by-Step tutorial or hints on how to do that?

So basically I have a DB call in a PHP file and how can I make it appear within vBulletin? I looked over the available Tutorials here and found most of the steps, however there is something im apparently missing, so hopefully somebody can help me along.

Cheers
OS

c'mon guys (and gals) I really need some help here - I'm going ape.

PHP Code:

$sqlroster "SELECT callsign FROM clan_service";
$result $db->query_first($sqlroster);
$service_name $db->fetch_array($result); 

Now the PHP part works, sort of. So I get an array -> $service_name. However I cant display the contents of it on the page. I'm currently using as basis the code from the Mod tutorial over at the 3.5 Tutorial forum for making basic pages within vB.

Again any help, even if it was "Hey dummy look at this and this thread, this question has been asked a hundred times already" would be ok. As long as I get some answers.

Thanks in Advance
OS

Marco van Herwaarden 11-21-2005 09:01 PM

If you use query_first (as opposed to query_read), $result will alsready contain the row data, not need for a fetch anymore.

Just use $result['callsign'] in your PHP or your template.

OneShot 11-21-2005 09:32 PM

Thanks, that did the trick.


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

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.01014 seconds
  • Memory Usage 1,715KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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