Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

Forumlar / Cotonti / Bugs / Non exist pool error

mysql warning

Almaz
#11913 2009-04-30 14:13
At the reference to nonexistent votings there is SQL an error.
For example:
http://www.cotonti.com/polls.php?id=55&comments=1

Makeshift:
Create a file polls.first.php and put it in a folder news plugin (plugins/news/) and reinstall it

<?PHP

/* ====================
Seditio - Website engine
Copyright Neocrome
http://www.neocrome.net

[BEGIN_SED]
File=plugins/news/polls.first.php
Version=122
Updated=2008-feb-18
Type=Plugin
Author=Neocrome
Description=
[END_SED]

[BEGIN_SED_EXTPLUGIN]
Code=news
Part=pools
File=polls.first
Hooks=polls.first
Tags=
Minlevel=0
Order=10
[END_SED_EXTPLUGIN]

==================== */

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

$voteid = sed_import('id','G','ALP', 8);

$sqlvote = sed_sql_query("SELECT COUNT(*) FROM $db_polls WHERE poll_id = '".$voteid."'");
$voteexist = sed_sql_result($sqlvote, 0, 'COUNT(*)');

if ($voteexist < 1 && $voteid <> 'viewall')
	{
	require_once($cfg['system_dir']."/lang/$lang/message.lang.php");

	$title = $L['msg404_title'];
	$body = $L['msg404_body'];

	$plug_head .= '<meta name="robots" content="noindex" />';
	$plug_title = $title." - ";

	require_once $cfg['system_dir'] . '/header.php';

	$t = new XTemplate(sed_skinfile('message'));

	$errmsg = $title;
	$title .= ($usr['isadmin']) ? " (#".$msg.")" : '';

	$t->assign("MESSAGE_TITLE", $title);
	$t->assign("MESSAGE_BODY", $body);

	$t->parse("MAIN");
	$t->out("MAIN");

	require_once $cfg['system_dir'] . '/footer.php';
	exit;
	}
?>

Bu konu Almaz tarafından düzenlendi(2009-07-04 18:39, 12 yıllar önce)