Fatal error: Call to a member function on a non-object in /home/maximstudios/public_html/proposals/productionco/includes/blocks/recentupdownload.php on line 51
Here is the code for the block:
Code
$blocks_modules['recentupdownload'] = array(
'func_display' => 'blocks_updownload_block',
'func_add' => 'blocks_updownload_add',
'func_edit' => 'blocks_updownload_edit',
'func_update' => 'blocks_updownload_update',
'text_type' => 'Recent UpDownload v3',
'text_type_long' => 'Recent UpDownload v3',
'allow_multiple' => true,
'form_content' => false,
'form_refresh' => false,
'show_preview' => true
);
pnSecAddSchema('Recent_UpDownload::', 'Block title::');
function blocks_updownload_block($row) {
include_once 'modules/UpDownload/includes/config.php';
$dbconn =& pnDBGetConn(true);
$pntable =& pnDBGetTables();
$content .= "<div style=\"padding-top:3px;\">";
$maindownload = 0;
$column = &$pntable['updownload_categories_column'];
$result =& $dbconn->Execute("SELECT $column[cid], $column[title], $column[cdescription]
FROM $pntable[updownload_categories]
ORDER BY $column[title]");
$numcats = $result->PO_RecordCount();
// Main categories
$content .= "<div style=\"text-align:left\">";
$count = 0;
while(list($cid, $title, $cdescription) = $result->fields) {
$result->MoveNext();
$cresult = $dbconn->Execute("SELECT count(*) FROM ".$pntable['updownload_downloads'].
" WHERE ".$pntable['updownload_downloads_column']['cid']."=".pnVarPrepForStore($cid));
list($cnumrows) = $cresult->fields;
$content .= "<div><h4 class=\"blocktitle\">".pnVarPrepForDisplay($title)."</h4></div>";
if (pnModGetVar('UpDownload', 'newdownloadgraphic')==1) {
categorynewdownloadgraphic($cid);
}
$column = &$pntable['updownload_subcategories_column'];
$sql = "SELECT $column[sid], $column[title]
FROM $pntable[updownload_subcategories]
WHERE $column[cid]=".pnVarPrepForStore($cid)."
ORDER BY $column[title]";
$result2 =& $dbconn->Execute($sql);
$space = 0;
while(list($sid, $stitle) = $result2->fields) {
$column = &$pntable['updownload_downloads_column'];
$resultnew =& $dbconn->Execute("SELECT count(*) FROM $pntable[updownload_downloads] WHERE $column[sid]=$sid");
list($numsubcats) = $resultnew->fields;
$content .= "<div><a href=\"index.php?name=UpDownload&req=viewsdownload&sid=$sid\">".pnVarPrepForDisplay($stitle)."</a></div>";
$space++;
$result2->MoveNext();
}
}
$content .= "</div>";
$row['content'] = $content;
return themesideblock($row);
}
'func_display' => 'blocks_updownload_block',
'func_add' => 'blocks_updownload_add',
'func_edit' => 'blocks_updownload_edit',
'func_update' => 'blocks_updownload_update',
'text_type' => 'Recent UpDownload v3',
'text_type_long' => 'Recent UpDownload v3',
'allow_multiple' => true,
'form_content' => false,
'form_refresh' => false,
'show_preview' => true
);
pnSecAddSchema('Recent_UpDownload::', 'Block title::');
function blocks_updownload_block($row) {
include_once 'modules/UpDownload/includes/config.php';
$dbconn =& pnDBGetConn(true);
$pntable =& pnDBGetTables();
$content .= "<div style=\"padding-top:3px;\">";
$maindownload = 0;
$column = &$pntable['updownload_categories_column'];
$result =& $dbconn->Execute("SELECT $column[cid], $column[title], $column[cdescription]
FROM $pntable[updownload_categories]
ORDER BY $column[title]");
$numcats = $result->PO_RecordCount();
// Main categories
$content .= "<div style=\"text-align:left\">";
$count = 0;
while(list($cid, $title, $cdescription) = $result->fields) {
$result->MoveNext();
$cresult = $dbconn->Execute("SELECT count(*) FROM ".$pntable['updownload_downloads'].
" WHERE ".$pntable['updownload_downloads_column']['cid']."=".pnVarPrepForStore($cid));
list($cnumrows) = $cresult->fields;
$content .= "<div><h4 class=\"blocktitle\">".pnVarPrepForDisplay($title)."</h4></div>";
if (pnModGetVar('UpDownload', 'newdownloadgraphic')==1) {
categorynewdownloadgraphic($cid);
}
$column = &$pntable['updownload_subcategories_column'];
$sql = "SELECT $column[sid], $column[title]
FROM $pntable[updownload_subcategories]
WHERE $column[cid]=".pnVarPrepForStore($cid)."
ORDER BY $column[title]";
$result2 =& $dbconn->Execute($sql);
$space = 0;
while(list($sid, $stitle) = $result2->fields) {
$column = &$pntable['updownload_downloads_column'];
$resultnew =& $dbconn->Execute("SELECT count(*) FROM $pntable[updownload_downloads] WHERE $column[sid]=$sid");
list($numsubcats) = $resultnew->fields;
$content .= "<div><a href=\"index.php?name=UpDownload&req=viewsdownload&sid=$sid\">".pnVarPrepForDisplay($stitle)."</a></div>";
$space++;
$result2->MoveNext();
}
}
$content .= "</div>";
$row['content'] = $content;
return themesideblock($row);
}
Its driving me nuts. Cant seem to find what would cause it. Hope someone can help.
