$sql = "SELECT * FROM " . $db->prefix('pw_works') . " WHERE public=1 AND catego=" . $work->category() . " AND id_work<>'" . $work->id() . "' ORDER BY RAND() LIMIT 0," . $mc['num_otherworks']; } $result = $db->query($sql); $categos = array(); $clients = array(); while ($row = $db->fetchArray($result)) { $wk = new PWWork(); $wk->assignVars($row); if (!isset($categos[$wk->category()])) { $categos[$wk->category()] = new PWCategory($wk->category()); } if (!isset($clients[$wk->client()])) { $clients[$wk->client()] = new PWClient($wk->client()); } echo "1 - "; $tpl->append('other_works', array('id' => $wk->id(), 'title' => $wk->title(), 'desc' => $wk->descShort(), 'linkcat' => $categos[$wk->category()]->link(), 'catego' => $categos[$wk->category()]->name(), 'client' => $clients[$wk->client()]->name(), 'link' => $wk->link(), 'created' => formatTimeStamp($wk->created(), 's'), 'image' => XOOPS_UPLOAD_URL . '/works/ths/' . $wk->image(), 'views' => $wk->views(), 'metas' => $wk->get_metas())); } RMEvents::get()->run_event('works.load.other.works', $work); } $tpl->assign('lang_desc', __('Description', 'works')); $tpl->assign('lang_catego', __('Category', 'works')); $tpl->assign('lang_client', __('Customer', 'admin_works')); $tpl->assign('lang_start', __('Begins', 'works')); $tpl->assign('lang_period', __('Time length', 'works')); $tpl->assign('lang_comment', __('Comment', 'works')); $tpl->assign('lang_cost', __('Price', 'works')); $tpl->assign('lang_others', __('Related Works', 'works')); $tpl->assign('lang_date', __('Date', 'works')); $tpl->assign('lang_images', __('Work Images', 'works')); $tpl->assign('lang_site', __('Web site', 'works')); $tpl->assign('lang_mark', __('Featured', 'works'));