Code: Select all
do {
// what item did the user won??
if ($itemtype == 'C')
{
$items_array = explode("##", $items_ch);
$newrand = rand(1,10);
$itemfound = $items_array[$newrand];
}
if ($itemtype == 'UC')
{
$items_array = explode("##", $items_ch);
$newrand = rand(1,10);
$itemfound = $items_array[$newrand];
}
if ($itemtype == 'R')
{
$items_array = explode("##", $items_ch);
$newrand = rand(1,10);
$itemfound = $items_array[$newrand];
}
if ($itemtype == 'VR')
{
$items_array = explode("##", $items_ch);
$newrand = rand(1,10);
$itemfound = $items_array[$newrand];
}
if (preg_match("/^@([A-Za-z]+[\_*|\s*|\-*|\&*|\(*|\)*]*)+/", $itemfound, $matches)) {
$temp_avatar_name = preg_replace("\@", "", $matches[0]);
$find_item_sql = "select * from phpbb_shops where name=".$item_avatar_name;
if ( !($find_item_result = $db->sql_query($find_item_sql)) )
{
message_die(GENERAL_MESSAGE, 'Fatal Error: '.mysql_error());
}
$find_item = mysql_fetch_array($find_item_result);
if (mysql_num_rows($find_item_result) < 1) { message_die(GENERAL_MESSAGE, 'No such item exists!'); }
$temp_find_item = "ß".$find_item['item_image_dir']."Þ";
$temp_user_bought_avatar = $row['user_bought_avatar'];
if (substr_replace($temp_user_bought_avatar, $temp_find_item, strpos($temp_user_bought_avatar, $temp_find_item), strlen($temp_find_item))) {
$item_repeat = 1;
}
else {
$item_repeat = 0;
}
}
else {
$item_repeat = 0;
}
}
while ($item_repeat != 0);
Thanks.