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.