Hello!
I tried to install the mod, followed the instruction, but I always get the error message "unexpected $ in .... viewtopic.php at line 1676".
Code: Select all
// Again this will be handled by the templating
// code at some point
//
if($i == 0)
{
$row_color = ( !($num_post % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($num_post % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$inline_ad_code = '';
if (($i == $board_config['ad_after_post'] - 1) || (($board_config['ad_every_post'] != 0) && ($i + 1) % $board_config['ad_every_post'] == 0))
{
$display_ad = true;
}
else
{
$display_ad = false;
}
//This if statement should keep server processing down a bit
if ($display_ad)
{
if ($board_config['ad_who'] == 'all' || ($board_config['ad_who'] == 'guest' && $userdata['user_id'] == -1) || ($board_config['ad_who'] == 'reg' && $userdata['user_id'] != -1))
{
$display_ad = true;
}
else
{
$display_ad = false;
}
$ad_no_forums = explode(",", $board_config['ad_no_forums']);
for ($a=0; $a < count($ad_no_forums); $a++){
if ($forum_id == $ad_no_forums[$a]){
$display_ad = false;
break;
}
}
if ($board_config['ad_no_groups'] != '')
{
$ad_no_groups = explode(",", $board_config['ad_no_groups']);
$sql = "SELECT 1
FROM " . USER_GROUP_TABLE . "
WHERE user_id=" . $userdata['user_id'] . " AND (group_id=0";
for ($a=0; $a < count($ad_no_groups); $a++){
$sql .= " OR group_id=" . $ad_no_groups[$a];
}
$sql .= ")";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query ad information', '', __LINE__, __FILE__, $sql);
}
if ($row = $db->sql_fetchrow($result)){
$display_ad = false;
}
}
if (($board_config['ad_post_threshold'] != '') &&($userdata['user_posts'] >= $board_config['ad_post_threshold']))
{
$display_ad = false;
}
}
//check once more, for server performance
if ($display_ad)
{
$sql = "SELECT a.ad_code
FROM " . ADS_TABLE . " a";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query ad information', '', __LINE__, __FILE__, $sql);
}
$adRow = array();
while( $row = $db->sql_fetchrow($result) )
{
$adRow[] = $row;
}
$adindex = rand(1, $db->sql_numrows($result)) - 1;
$db->sql_freeresult($result);
$inline_ad_code = $adRow[$adindex]['ad_code'];
}
//Online/Offline
Code: Select all
'DELETE_IMG' => $delpost_img,
'DELETE' => $delpost,
'L_SPONSOR' => $lang['Sponsor'],
'INLINE_AD' => $inline_ad_code,
'USER_WARNINGS' => $user_warnings,
'CARD_IMG' => $card_img
Code: Select all
'U_B_CARD' => $b_card_img,
'S_CARD' => append_sid("card.".$phpEx),
'U_POST_ID' => $postrow[$i]['post_id'])
);
if ($display_ad){
if (!$board_config['ad_old_style'] && $display_ad)
{
$template->assign_block_vars('postrow.switch_ad',array());
}
else
{
$template->assign_block_vars('postrow.switch_ad_style2',array());
}
}
display_post_attachments($postrow[$i]['post_id'], $postrow[$i]['post_attachment']);
}
Any idea?
Desert Dancer