ageurtse
06-27-2015, 06:01 AM
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 1435413623 at 1435413623 ---------------
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.
// ###### 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());
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 1435413623 at 1435413623 ---------------
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.
// ###### 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());