Is there a Wiki? Create extra pages?
I need to know how to add extra pages, other than what you can do in the admin panel. I need to create extra pages that require access to the database to display certain information (I need to add my own .php pages).
I found this: http://labs.buyscripts.in/projects/vsha ... HP_scripts
...but that code is not working. The page I created is not displaying the header,footer, etc and the database information I am referencing is not displaying on the page.
Re: Is there a Wiki? Create extra pages?
You only need to include config.php, remote the functions.php line, it will work.
Re: Is there a Wiki? Create extra pages?
Oh, yeah, I figured that out...but now for my next problem.
I get a page, but there's no header, footer, etc and the database information I am trying to access is not displayed.
the code here for v2.6
viewtopic.php?f=8&t=1155
does not work for 2.7...at least I haven't figured it out yet.
Fatal error: Class 'STemplate' not found in /home/-----/public_html/---------/vshare27/xxxxx.php on line 10
Line 10 is this: STemplate::assign('err',$err);
Re: Is there a Wiki? Create extra pages?
Refer the code for show_page.php
Re: Is there a Wiki? Create extra pages?
oh duh. I was looking thru the files for an example and didn't even think to look at that one. Thanks. :oops:
Re: Is there a Wiki? Create extra pages?
Here's what I have:
mypage.php is in my vshare root. mypage.tpl is in my templates folder with the rest of them.
Code:
<?php
/******************************************************************************
*
* COMPANY: BuyScripts.in
* PROJECT: vShare Youtube Clone
* VERSION: 2.7
* LISENSE: http://buyscripts.in/vshare-license.html
* WEBSITE: http://buyscripts.in/youtube_clone.html
*
* This program is a commercial software and any kind of using it must agree
* to vShare license.
*
******************************************************************************/
require './include/config.php';
$sql = "SELECT * FROM `pages` WHERE
`page_name`='" . mysql_clean($_GET['name']) . "'";
$result = mysql_query($sql) or mysql_die($sql);
if (mysql_num_rows($result) != 1)
{
show_page_not_found();
}
$page_info = mysql_fetch_assoc($result);
if ($page_info['page_members_only'] == 1)
{
User::is_logged_in();
}
function show_page_not_found()
{
header("HTTP/1.0 404 Not Found");
echo "<html><head><title>Page Not Found</title></head><body>Page Not Found</body></html>";
exit(0);
}
$smarty->assign('err', $err);
$smarty->assign('html_title', $page_info['page_title']);
$smarty->assign('content', $page_info['page_content']);
$smarty->assign('html_description', $page_info['page_description']);
$smarty->assign('html_keywords', $page_info['page_keywords']);
$smarty->display('./templates/header.tpl');
$smarty->display('./templates/mypage.tpl');
$smarty->display('./templates/footer.tpl');
db_close();
In mypage.tpl I have my php code wrapped around the {php} and {/php} tags and nothing else on the page other than my php script. I keep getting "Page not Found" error. Not sure where I'm going wrong.....
Re: Is there a Wiki? Create extra pages?
I even tried inserting the php code directly into mypage.php instead of using the mypage.tpl but I'm still getting "page not found"...I tried different paths to the header and footer, but I get "page not found" on anything I try.
Re: Is there a Wiki? Create extra pages?
Replace
Code:
$smarty->display('./templates/header.tpl');
$smarty->display('./templates/mypage.tpl');
$smarty->display('./templates/footer.tpl');
With
Code:
$smarty->display('header.tpl');
$smarty->display('mypage.tpl');
$smarty->display('footer.tpl');
Don't have to specify templates folder, that is default smarty tpl folder.
Re: Is there a Wiki? Create extra pages?
That's the first thing I tried...which is why I tried other paths...No joy....
page not found.
Re: Is there a Wiki? Create extra pages?
could it be something I need to add to htaccess?