Okay I have upgraded to phpBB 3.01 and upgraded via an update..... which went well considering the amount of modifications I have made... that said I'm having a problem with the Ad Management mod.... for some reason this part of the code within includes/functions.php
Code: Select all
// Start output Ad
$adID = '';
$forum_id = isset($f) ? $f : 0;
$sql = "SELECT a.code, a.ad_id, a.position, a.type, a.image, a.url, a.height, a.width
FROM " . AD_TABLE ." a, " . USER_GROUP_TABLE . " g
WHERE (a.max_views >= a.views OR a.max_views = '0')
AND (FIND_IN_SET(" .$forum_id. ", a.show_forums) > 0 OR a.show_all_forums = '1')
AND g.user_id = " . $user->data['user_id'] . "
AND FIND_IN_SET(g.group_id, a.groups)
AND FIND_IN_SET(" . $user->data['user_rank'] . ", a.ranks)
AND a.start_time < " . time() . "
AND a.end_time > " . time() . "
AND (a.clicks <= a.max_clicks OR a.max_clicks = '0')
ORDER BY rand()";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))
{
if ($row['type'] == 2)
{
$adcode[$row['position']] = '<a href="' . $phpbb_root_path . 'adclick.' . $phpEx . '?id=' . $row['ad_id'] . '"><img src="' . $row['image'] . '" height="' . $row['height'] . '" width="' . $row['width'] . '" alt="" /></a>';
}
else
{
$adcode[$row['position']] = html_entity_decode($row['code']);
}
$adID[$row['position']]['ID'] = $row['ad_id'];
}
$db->sql_freeresult($result);
// update views for every Ad
for ($i = 1; $i <= 6; $i++)
{
if (isset($adID[$i]['ad_id']))
{
$db->sql_query('UPDATE ' . AD_TABLE . ' SET views = views +1 WHERE ad_id = ' . $adID[$i]['ad_id']);
}
}
// End output Ad
Went missing in the update, so I added code again in right place and now recieve
Code: Select all
General Error
SQL ERROR [ mysqli ]
Unknown column 'a.ad_id' in 'field list' [1054]
SQL
SELECT a.code, a.ad_id, a.position, a.type, a.image, a.url, a.height, a.width FROM phpbb_ad a, phpbb_user_group g WHERE (a.max_views >= a.views OR a.max_views = '0') AND (FIND_IN_SET(0, a.show_forums) > 0 OR a.show_all_forums = '1') AND g.user_id = 2 AND FIND_IN_SET(g.group_id, a.groups) AND FIND_IN_SET(1, a.ranks) AND a.start_time < 1207734195 AND a.end_time > 1207734195 AND (a.clicks <= a.max_clicks OR a.max_clicks = '0') ORDER BY rand()
BACKTRACE
FILE: includes/db/mysqli.php
LINE: 143
CALL: dbal->sql_error()
FILE: includes/functions.php
LINE: 3460
CALL: dbal_mysqli->sql_query()
FILE: portal.php
LINE: 258
CALL: page_header()
i've since removed only that part of the code and site is functional but I have no ads.... any ideas please..
Regards Micheal
EDIT//// Okay my fault and partly mod authors as in instructions update for 2007-03-22- Version 0.2.0.... I had only installed 2008 did not think a new verson was out and changes had been made to mysql have now updated sql and all is okay... ......
