The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Using loops in custom pages.
I'm using https://vborg.vbsupport.ru/showthread.php?t=62164 to creat my own custom page. I've changed some parts thoo. I use this code instead.
Code:
eval('$HTML = "' . fetch_template($templatename) . '";'); eval('print_output("' . fetch_template($shelltemplatename) . '");'); Code:
if ($_REQUEST['do'] == 'addrequest') { $templatename = 'job_add_request'; $walle = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "jobs WHERE id = 1"); eval('$test = "'. $walle[test] .'";'); } I would like the $test variable in the template to print out the result from "SELECT * FROM " . TABLE_PREFIX . "jobs". And perhaps some html around the result itself. Like. <div>$test</div><div>$test</div> etc.. Anyone know how to do that? |
#2
|
||||
|
||||
You need to use two templates. The first one formats the individual records. The second one outputs the final result.
PHP Code:
HTML Code:
<div>$sub['test']</div> HTML Code:
My Results {$wall} |
#3
|
|||
|
|||
Quote:
|
#4
|
||||
|
||||
Quote:
|
#5
|
|||
|
|||
Ok, yet another problem. I would like to print out 6 categories from the databas.
Code:
$result = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "jobs WHERE act = 1"); Code:
$resultRequest = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "jobs WHERE act = 0 and category = '". $category['category'] ."' LIMIT 5"); Code:
+-----------------------+-----------------------+-----------------------+ | Category 1 | Category 2 | Category 3 | +-----------------------+-----------------------+-----------------------+ | Content in | Content in | Content in | | Category 1 | Category 2 | Category 3 | +-----------------------+-----------------------+-----------------------+ | Category 4 | Category 5 | Category 6 | +-----------------------+-----------------------+-----------------------+ | Content in | Content in | Content in | | Category 4 | Category 5 | Category 6 | +-----------------------+-----------------------+-----------------------+ |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|