IPB

ISO Image Creator

Welcome Guest ( Log In | Register )

> Custom pages mod help, Dug hole and lost the shovel
mjaves
post Apr 1 2003, 01:31 PM
Post #1


Helpful Member
Group Icon

Group: Members
Posts: 54
Joined: 4-March 03
From: Margete, Kent, United Kindom
Member No.: 165
 United Kingdom


Hi I have a mod called custom pages from sno which is great I've added my nav mod to it and have been trying to add a page views so it shows how many times the pages has been displayed the counter is working as page views field is updated when a page is called.

but I am having no end of trouble getting the info to display on the page at the bottem hopefully you will be able to help as have had no reply on ibresources.

The skin_pages.php code
CODE
class skin_pages {

function render_pages($content) {
global $ibforums;
return <<<EOF
<table cellpadding=0 cellspacing='1' border='0' width='<{tbl_width}>' align='center'>
<tr>
 <td width="100%" vAlign=top>
                    {$content}
 </td>
</tr>
</table>
EOF;
}

}


pages.php code
CODE
function Pages() {
           global $ibforums, $DB, $std, $print;

           require "./Skin/".$ibforums->skin_id."/skin_pages.php";
           $this->html = new skin_pages();
       $pg = strtolower($ibforums->input['pg']);
       //micks page view mod
       $countit = "views=views+1 ";
       $DB->query( "UPDATE ibf_pages SET ".$countit." WHERE alias = '$pg'");
       //end micks page view mod
       $DB->query("SELECT * FROM ibf_pages WHERE alias = '$pg'");
       if( $DB->get_num_rows( ) == 0 ) {
                               $std->Error( array( 'LEVEL' => 1, 'MSG' => '404') );
                       }
       $info = $DB->fetch_row();

       $seenit = $info['views'];
       $content = $info['content'];
       $this->output  = $this->html->render_pages($content);
       // done
                $this->page_title = $ibforums->vars['board_name']." -> ".$info['name'];
                //micks nav mod
                 If($info['lid'] == "" ) {
                    $this->nav        = array( $info['name'] );
                 } else {
                   $this->nav        = array ("<a href='".$ibforums->base_url."&{$info['lid']}'>{$info['lname']}</a>",
                                                                  $info['name']);
                 }
                //end micks nav mod


           $print->add_output("$this->output");
       $print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );
        }

}


this is only the main function so won't work without the globals.

I have tryed calling like render_pages($content, $seenit )

and have updated the skin render_pages so values will be passed correctly I think but got the usual error in page.

hope you will be able to help with this one.
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 21st May 2012 - 10:39 AM

  Page top

Webber Enhanced skin created by Im4eversmart of RuneHQ.

  Privacy Policy 1 2 3 4 5

IPS Driver Error

IPS Driver Error

There appears to be an error with the database.
You can try to refresh the page by clicking here