Forums / Cotonti / Support / SeeAlso Plugin

Porting to Cotonti needed

TwistedGA
#11257 2009-04-10 00:39
The seealso.page.php file :
<?php
/* ====================
[BEGIN_SED]
File=plugins/extended/seealso/seealso.page.php
Type=Plugin
[END_SED]

[BEGIN_SED_EXTPLUGIN]
Code=seealso
Part=page
File=seealso.page
Hooks=page.tags
Tags=
Minlevel=0
Order=10
[END_SED_EXTPLUGIN]
==================== */

if( !defined('SED_CODE') ) { die("Wrong URL."); }

$sql = sed_sql_query("SELECT page_id, page_state, page_cat, page_title, page_desc, page_author FROM $db_pages WHERE page_state=0 AND page_id != ".$pag['page_id']." AND \"(".eregi_replace(",", "|", $pag['page_extra4']).")\" REGEXP Replace(page_extra4, \",\", \"|\") ORDER BY page_date desc", "SeeAlso/get related");


if (sed_num_rows($sql)>0)
        {
        while ($row = sed_sql_fetcharray($sql))
                {
		$sa_author = sed_cc($row['page_author']);
		$sa_pageid = $row['page_id'];
		$sa_pagecat = sed_cc($row['page_cat']);
		$sa_pagedesc = sed_cc($row['page_desc']);
		$sa_pagetitle = sed_cc($row['page_title']);
                $sa_pagelink = "<a href=\"page.php?id=".$sa_pageid."\" title='".$sa_pagedesc."'>".$sa_pagecat.$cfg['separator'].$sa_pagetitle."</a>";
		$catpath = sed_build_catpath($sa_pagecat, "<a href=\"list.php?c=%1\$s\" title=\"%2\$s\">%2\$s</a>");
		$catpath = $catpath." ".$cfg['separator']." <a href=\"page.php?id=".$sa_pageid."\" title=\"".$sa_pagetitle."\">".$sa_pagetitle."</a>";
                $t-> assign(array(
                        "SEEALSO_AUTHOR" => $sa_author,
                        "SEEALSO_PAGE_ID" => $sa_pageid,
                        "SEEALSO_PAGECAT" => $sa_pagecat,
                        "SEEALSO_PAGETITLE" => $sa_pagetitle,
                        "SEEALSO_PAGELINK" => $catpath
                        ));
                $t->parse("MAIN.SEEALSO.SEEALSO_ROW");
                }
        }
        else
        {
        $t->parse("MAIN.COMMENTS.SEEALSO_EMPTY");
        }

$t->parse("MAIN.SEEALSO");
?>

The seeaslo.setup.php file :
<?php
/* ====================
[BEGIN_SED]
File=plugins/extended/seealso/seealso.setup.php
Type=Plugin
[END_SED]

[BEGIN_SED_EXTPLUGIN]
Code=seealso
Name=See also (Related pages)
Description=Adds "See also:" and list of related pages by keywords
Version=0.1
Date=2005/05/15
Author=Kpoxa (vrihedd@yandex.ru)
Copyright=
Notes=
Config=
SQL=
[END_SED_EXTPLUGIN]

[BEGIN_SED_EXTPLUGIN_CONFIG]
[END_SED_EXTPLUGIN_CONFIG]
==================== */

if( !defined('SED_CODE') ) { die("Wrong URL."); }

?>

Make a backup of the originals and try this. I only see one other thing that might cause a problem as it is, if you still have issues, try removing :::, "SeeAlso/get related":::: form the $sql = line. If that doesnt solve it let me know and I'll actually take it into my test site and figure out what the problem is.
[color=#CC0000]Lazymod[/color] [color=#000000]Studios[/color]