/** * Obtiene las descargas patrocinadas dependiendo * del número de descargas establecidas en la configuración * Param * * @$xoopsModuleConfig['sponsor_downs'] = Limita el numero de resultados * * @return = No retorno. Establece el array Smarty sponsors */ function rmdp_get_sponsor() { global $xoopsDB, $xoopsTpl, $myts, $xoopsModuleConfig; list($num) = $xoopsDB->fetchRow($xoopsDB->query("SELECT COUNT(*) FROM " . $xoopsDB->prefix("rmdp_partners"))); if ($num >= $xoopsModuleConfig['sponsor_downs']) { $do = $xoopsModuleConfig['sponsor_downs']; } elseif ($num >= 1 && $num < $xoopsModuleConfig['sponsor_downs']) { $do = $num; } else { return; } $num = $num - 1; $numero = array(); for ($i = 0; $i <= $num; $i++) { $numero[$i] = $i; } $values = array(); mt_srand((double) microtime() * 1000000); for ($i = 0; $i <= $do - 1; $i++) { $item = mt_rand(0, count($numero) - 1); //Elemento a obtener $search = $numero[$item]; // Obtenmos el numero inicial del spaonsor array_splice($numero, $item, 1); $result = $xoopsDB->query("SELECT * FROM " . $xoopsDB->prefix("rmdp_partners") . " LIMIT {$search}, 1 ;"); $row = $xoopsDB->fetchArray($result); $xoopsTpl->append('sponsors', array('id' => $row['id_soft'], 'desc' => $myts->makeTareaData4Show(substr($row['text'], 0, $xoopsModuleConfig['len_desc'])), 'title' => rmdp_download_name($row['id_soft']))); } $xoopsTpl->assign('lang_sponsornews', _RMDP_SPONSOR_NEWS); }
$xoopsOption['template_main'] = 'rmdp_shots.html'; /** * Obtenemos las pantallas de una descarga **/ $result = $xoopsDB->query("SELECT * FROM " . $xoopsDB->prefix('rmdp_shots') . " WHERE id_soft='{$id}'"); while ($row = $xoopsDB->fetchArray($result)) { $fecha = date($xoopsModuleConfig['dateformat'], $row['fecha']); $isnew = rmdp_element_isnew($row['fecha'], $xoopsModuleConfig['shotnew']); $xoopsTpl->append('shots', array('id' => $row['id_shot'], 'small' => $row['small'], 'link' => rmdp_shot_link($row['id_shot'], $row['big']), 'desc' => $row['text'], 'fecha' => $fecha, 'isnew' => $isnew, 'hits' => $row['hits'])); } $xoopsTpl->assign('img_width', $xoopsModuleConfig['imgshotsw']); } // Obtenemos las descargas patrocinadas rmdp_get_sponsor(); rmdp_get_favorites(0); rmdp_get_popular(0); // Creamos la barra de localización $location_bar = "<a href='" . XOOPS_URL . "/modules/rmdp/'>" . $xoopsModuleConfig['rmdptitle'] . "</a> > "; list($idc, $nombre) = $xoopsDB->fetchRow($xoopsDB->query("SELECT id_cat, nombre FROM " . $xoopsDB->prefix("rmdp_software") . " WHERE id_soft='{$id}'")); $location_bar .= rmdp_get_location($idc); $location_bar .= '<a href="down.php?id=' . $id . '">' . $nombre . '</a> > '; $location_bar .= '<a href="shots.php?id=' . $id . '">' . _RMDP_LOCATION_SHOT . '</a>'; $xoopsTpl->assign('location_bar', $location_bar); // Opciones de lenguaje $xoopsTpl->assign('lng_shotsof', sprintf(_RMDP_DOWN_SHOTS, rmdp_download_name($id))); $xoopsTpl->assign('total_cols', $xoopsModuleConfig['shotcols']); $xoopsTpl->assign('lang_download_now', _RMDP_DOWNLOAD_NOW); $xoopsTpl->assign('lang_our_favorites', _RMDP_OUR_FAVORITES); $xoopsTpl->assign('lang_popular_soft', _RMDP_POPULAR_SOFT); $xoopsTpl->assign('lng_favmsg', sprintf(_RMDP_FAVORITE_TEXT, $xoopsModuleConfig['favo_downs'])); include 'footer.php';