The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
Hello,
I wan't to create a page where a list of images is displayed. i read the article on how to create a page (https://vborg.vbsupport.ru/showthread.php?t=228112) The page with the text TEST is displayed, but now i wan't a list of images being displayed. There is a table in the database, where the name and URL of the image are. but i can't figure out where and how to fetch this list, and generate a <img> tag so these images are displayed. do i do this on the page or in the template ? need some advise or tutorials on how to do this. --------------- Added [DATE]1435413623[/DATE] at [TIME]1435413623[/TIME] --------------- i think i'm a bit further, but the array isn't filling. it seems that my read on the database is wrong. but can't figure out what. below a peace of the code. Code:
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'My Page Title';
/* Some Code, setting variables, (multidimensional) array */
$my_var = "Dit is een test berricht";
$lijst = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "rbs_banners");
echo 'test'.print_r(array_values($lijst)); // ===== just for debuging
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('TEST');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
$templater->register('my_var', $my_var);
$templater->register('lijst', $lijst);
print_output($templater->render());
|
|
#2
|
||||
|
||||
|
Read this article to learn how to access the database:
https://vborg.vbsupport.ru/showthread.php?t=119350 |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|