Posted: Wed 9. Nov 2005, 13:52
Doublecheck that the function is really in front.func.inc.php.
The phpwcms support forum will help to find answers to your questions. The small but strong community is here since more than 10 years.
https://forum.phpwcms.org/
Kosse wrote:Only Frold, Pappnase and OG have superpowers, they're the heroes
Nice update JensZ, many many many thanks, cool!
Cheers
Code: Select all
Fatal error: Cannot redeclare utf2html() (previously declared in /mnt/Target01/324460/324463/www.abraira.com/web/content/include/inc_front/front.func.inc.php:3030) in /mnt/Target01/324460/324463/www.abraira.com/web/content/include/inc_front/ext.func.inc.php on line 81
Code: Select all
if(!function_exists("utf2html"))
{
function utf2html()
{
// ... body of function here
}
}
Code: Select all
Fatal error: Cannot redeclare utf2html() (previously declared in /mnt/Target01/324460/324463/www.abraira.com/web/content/include/inc_front/front.func.inc.php:3031) in /mnt/Target01/324460/324463/www.abraira.com/web/content/include/inc_front/ext.func.inc.php on line 81
Code: Select all
// taken from http://www.php.net/manual/en/function.utf8-decode.php
// vpribish at shopping dot com, 10-Sep-2004 08:55
function utf2html($str) {
$ret = '';
$max = strlen($str);
$last = 0; // keeps the index of the last regular character
for ($i=0; $i < $max; $i++) {
$c = $str{$i};
$c1 = ord($c);
if ($c1>>5 == 6) { // 110x xxxx, 110 prefix for 2 bytes unicode
$ret .= substr($str, $last, $i-$last); // append all the regular characters we've passed
$c1 &= 31; // remove the 3 bit two bytes prefix
$c2 = ord($str{++$i}); // the next byte
$c2 &= 63; // remove the 2 bit trailing byte prefix
$c2 |= (($c1 & 3) << 6); // last 2 bits of c1 become first 2 of c2
$c1 >>= 2; // c1 shifts 2 to the right
$ret .= "&#" . ($c1 * 100 + $c2) . ";"; // this is the fastest string concatenation
$last = $i+1;
}
}
return $ret . substr($str, $last, $i); // append the last batch of regular characters
}
Code: Select all
// taken from http://www.php.net/manual/en/function.utf8-decode.php
// vpribish at shopping dot com, 10-Sep-2004 08:55
if(!function_exists("utf2html")) {
function utf2html($str) {
$ret = '';
$max = strlen($str);
$last = 0; // keeps the index of the last regular character
for ($i=0; $i < $max; $i++) {
$c = $str{$i};
$c1 = ord($c);
if ($c1>>5 == 6) { // 110x xxxx, 110 prefix for 2 bytes unicode
$ret .= substr($str, $last, $i-$last); // append all the regular characters we've passed
$c1 &= 31; // remove the 3 bit two bytes prefix
$c2 = ord($str{++$i}); // the next byte
$c2 &= 63; // remove the 2 bit trailing byte prefix
$c2 |= (($c1 & 3) << 6); // last 2 bits of c1 become first 2 of c2
$c1 >>= 2; // c1 shifts 2 to the right
$ret .= "&#" . ($c1 * 100 + $c2) . ";"; // this is the fastest string concatenation
$last = $i+1;
}
}
return $ret . substr($str, $last, $i); // append the last batch of regular characters
}
}
Code: Select all
Fatal error: Call to undefined function: getimagecaption() in /mnt/Target01/324460/324463/www.abraira.com/web/content/include/inc_front/content.article.inc.php on line 155
Code: Select all
....
function getContentPartTopLink($param=0) {
global $template_default;
$toplink = '';
if($param) {
if($template_default["article"]["top_sign_before"].$template_default["article"]["top_sign_after"]) {
$toplink .= $template_default["article"]["top_sign_before"];
$toplink .= '<a href="#top">'.$template_default["article"]["top_sign"].'</a>';
$toplink .= $template_default["article"]["top_sign_after"];
} else{
$toplink .= '<br /><a href="#top">' . $template_default["article"]["top_sign"] . '</a>';
}
}
return $toplink;
}
function getContentPartAlias($crow) {
global $db;
$alias = unserialize($crow["acontent_form"]);
if(!empty($alias['alias_ID'])) {
$alias['alias_ID'] = intval($alias['alias_ID']);
$sql_alias = "SELECT * FROM ".DB_PREPEND."phpwcms_articlecontent WHERE acontent_id=";
$sql_alias .= $alias['alias_ID'] . " AND acontent_trash=0 LIMIT 1";
if($alias_result = mysql_query($sql_alias, $db)) {
if($alias_row = mysql_fetch_assoc($alias_result)) {
if(empty($alias['alias_block'])) {
$alias_row['acontent_block'] = $crow['acontent_block'];
}
if(empty($alias['alias_spaces'])) {
$alias_row['acontent_before'] = $crow['acontent_before'];
$alias_row['acontent_after'] = $crow['acontent_after'];
}
if(empty($alias['alias_title'])) {
$alias_row['acontent_title'] = $crow['acontent_title'];
$alias_row['acontent_subtitle'] = $crow['acontent_subtitle'];
}
if(empty($alias['alias_toplink'])) {
$alias_row['acontent_top'] = $crow['acontent_top'];
}
$crow = $alias_row;
}
mysql_free_result($alias_result);
}
}
return $crow;
}
?>
// Jens for News Flash
// $article_list: comma-separated list of article IDs
// $dbcon: database connection
function get_newsflash_articles_data($article_list, $dbcon)
{
//returns the complete active and public article data as array (basic infos only)
//so it is reusable by many functions -> lower db access
$data = array();
$returnData = array();
$sql = "SELECT *, UNIX_TIMESTAMP(article_tstamp) AS article_date FROM ".DB_PREPEND."phpwcms_article ";
$sql .= "WHERE article_id in (".$article_list.") ";
// VISIBLE_MODE: 0 = frontend (all) mode, 1 = article user mode, 2 = admin user mode
switch(VISIBLE_MODE) {
case 0: $sql .= " AND article_public=1 AND article_aktiv=1";
break;
case 1: $sql .= " AND article_uid=".$_SESSION["wcs_user_id"];
break;
//case 2: admin mode no additional neccessary
}
$sql .= " AND article_deleted=0 AND article_begin < NOW() AND article_end > NOW() ";
if($result = mysql_query($sql, $dbcon))
{
while($row = mysql_fetch_assoc($result))
{
$data[$row["article_id"]] = array(
"article_id" => $row["article_id"],
"article_cid" => $row["article_cid"],
"article_title" => $row["article_title"],
"article_subtitle" => $row["article_subtitle"],
"article_keyword" => $row["article_keyword"],
"article_summary" => $row["article_summary"],
"article_redirect" => $row["article_redirect"],
"article_date" => $row["article_date"],
"article_username" => $row["article_username"],
"article_sort" => $row["article_sort"],
"article_notitle" => $row["article_notitle"],
"article_created" => $row["article_created"],
"article_image" => unserialize($row["article_image"]),
"article_timeout" => $row["article_cache"],
"article_nosearch" => $row["article_nosearch"],
"article_nositemap" => $row["article_nositemap"],
"article_aliasid" => $row["article_aliasid"],
"article_headerdata"=> $row["article_headerdata"],
"article_morelink" => $row["article_morelink"]
);
// now check for article alias ID
if($row["article_aliasid"]) {
$aid = $row["article_id"];
$alias_sql = "SELECT *, UNIX_TIMESTAMP(article_tstamp) AS article_date FROM ".DB_PREPEND."phpwcms_article ";
$alias_sql .= "WHERE article_deleted=0 AND article_id=".intval($row["article_aliasid"]);
if(!$row["article_headerdata"]) {
switch(VISIBLE_MODE) {
case 0: $alias_sql .= " AND article_public=1 AND article_aktiv=1";
break;
case 1: $alias_sql .= " AND article_uid=".$_SESSION["wcs_user_id"];
break;
}
$alias_sql .= " AND article_begin < NOW() AND article_end > NOW()";
}
$alias_sql .= " AND article_deleted=0 LIMIT 1";
if($alias_result = mysql_query($alias_sql, $dbcon)) {
if($alias_row = mysql_fetch_assoc($alias_result)) {
$data[$aid]["article_id"] = $alias_row["article_id"];
// use alias article header data
if(!$row["article_headerdata"]) {
$data[$aid]["article_title"] = $alias_row["article_title"];
$data[$aid]["article_subtitle"] = $alias_row["article_subtitle"];
$data[$aid]["article_keyword"] = $alias_row["article_keyword"];
$data[$aid]["article_summary"] = $alias_row["article_summary"];
$data[$aid]["article_redirect"] = $alias_row["article_redirect"];
$data[$aid]["article_date"] = $alias_row["article_date"];
$data[$aid]["article_image"] = unserialize($alias_row["article_image"]);
}
}
mysql_free_result($alias_result);
}
}
}
// reorder according to article list
$articleOrder = explode(",", $article_list);
foreach($articleOrder as $key => $value)
{
$returnData[$key] = $data[$value];
}
mysql_free_result($result);
}
return $returnData;
}
// -------------------------------------------------------------
// added by jens for newsflash v2
function get_newsflash_article_list($aList)
{
$s = "";
$newList = array();
if(!is_array($aList))
{
return $s;
}
foreach($aList as $key => $value)
{
$prefix = substr($value,0,1);
$id = intval(substr($value,1));
if($prefix == 'c') // category
{
// get order
$sql = "SELECT acat_order FROM ".DB_PREPEND."phpwcms_articlecat WHERE acat_id = ".$id;
$result = mysql_query($sql, $GLOBALS['db']);
$row = mysql_fetch_assoc($result);
mysql_free_result($result);
$ao = get_order_sort($row["acat_order"]);
// read from database
$sql = "SELECT article_id, article_cid, article_title FROM ".DB_PREPEND."phpwcms_article ";
$sql .= "WHERE article_cid=".$id." AND article_public = 1 AND article_aktiv = 1 AND ";
$sql .= "article_deleted=0 AND article_begin<NOW() AND article_end>NOW() ";
$sql .= "ORDER BY ".$ao[2];
if($result = mysql_query($sql, $GLOBALS['db']))
{
while($row = mysql_fetch_assoc($result))
{
if(!in_array($row["article_id"], $newList))
{
array_push($newList, $row["article_id"]);
}
}
mysql_free_result($result);
}
}
else if($prefix == 'a') // article
{
if(!in_array($id, $newList))
{
array_push($newList, substr($value,1));
}
}
}
$s = implode(",", $newList);
return $s;
}
?>
Code: Select all
Fatal error: Call to undefined function: get_newsflash_article_list() in /home/content/s/p/o/spotlightla/html/phpwcms_template/inc_script/frontend_render/newsflash.php on line 33