Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Is there a Wiki? Create extra pages?

  1. #1
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default 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.
    If it's not fun, stop doing it!

  2. #2
    Join Date
    Apr 2007
    Posts
    2,202

    Default Re: Is there a Wiki? Create extra pages?

    You only need to include config.php, remote the functions.php line, it will work.

  3. #3
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default 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);
    If it's not fun, stop doing it!

  4. #4
    Join Date
    Apr 2007
    Posts
    2,202

    Default Re: Is there a Wiki? Create extra pages?

    Refer the code for show_page.php

  5. #5
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default 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:
    If it's not fun, stop doing it!

  6. #6
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default 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.....
    If it's not fun, stop doing it!

  7. #7
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default 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.
    If it's not fun, stop doing it!

  8. #8
    Join Date
    Apr 2007
    Posts
    2,202

    Default 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.

  9. #9
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default 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.
    If it's not fun, stop doing it!

  10. #10
    Join Date
    May 2007
    Location
    Planet Earth
    Posts
    1,389

    Default Re: Is there a Wiki? Create extra pages?

    could it be something I need to add to htaccess?
    If it's not fun, stop doing it!

Page 1 of 2 12 LastLast

Similar Threads

  1. Create Thumbnail - START
    By admin in forum Frequently Asked Questions
    Replies: 6
    Last Post: 10-07-2008, 01:07 PM
  2. Adding Extra Servers
    By topfreaks in forum Installation Support
    Replies: 0
    Last Post: 06-30-2008, 08:18 PM
  3. How can we create members only pages outside ACP?
    By grynmoors in forum Template Modifications
    Replies: 4
    Last Post: 05-06-2008, 11:27 AM
  4. How create new field on database
    By pachouille in forum Template Modifications
    Replies: 2
    Last Post: 02-17-2008, 02:31 PM
  5. Extra Data fields in video upload and user profiles
    By dancairns in forum Template Modifications
    Replies: 0
    Last Post: 10-16-2007, 11:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •