Dangundam?

Posted by KING OF NIGERIA | 19 Apr, 2009


The fuck is this shit?

I hate Smarty

Posted by KING OF NIGERIA | 21 Jan, 2009

So during the past two days, I tried to code in a feature that allows me to create multi-page posts, because Lifetype doesn't already have it. My biggest mistake was trying to code the feature into a Smarty template. After much trial and error, I came up with this:

This piece of shit that I wasted like ten hours of my life on{dynamic}{php}

$postthingy = $this->get_template_vars('post');
// $geturl = $this->get_template_vars('url');
// $geturl2 = $geturl->postPermalink($postthingy);
$parsedpost = explode("[@page@]",$postthingy->getText());
$pagecount = count($parsedpost);
$getpage=$_GET["postpage"];
$geturl = 'op='.$_GET["op"].'&articleId='.$_GET["articleId"].'&blogId='.$_GET["blogId"];

if($pagecount > 0 and $parsedpost[$getpage]){

$postyy = $parsedpost[$getpage];

$postyy .= '<br/><br/><p>Pages: <a href="?'.$geturl.'&postpage=0">1</a>';
for ($i=1; $i<$pagecount; $i++)
{
$ipagenumber=$i+1;
$postyy .= ' | <a href="?'.$geturl.'&postpage='.$i.'">'.$ipagenumber.'</a>';
}

$postyy .= '</p>';

$this->assign('postendd',$postyy);

}else{
$this->assign('postendd',$parsedpost[0]);
}

{/php}{/dynamic} {$postendd}

I'd go into more detail about it, but it's 12AM and my head kinda hurts, so long story short, Smarty and Lifetype have some issues with caching and subsequently, the script doesn't work. If it comes down to it, I guess I could use Javascript to implement a multi-page function. Also, I suck at coding, because I haven't done it in a while, so if anyone can offer any advice, that'd be great.