$path = "/home/gcr/";
include $path."template.inc";
include $path."_funciones/vars.inc.txt";
require $path."forums/ipbsdk/ipbsdk_class.inc.php";
require $path."_funciones/generales.php";
$t = new Template("./");
$npagid = @$_GET['id'] ;
$SDK =& new IPBSDK();
if ($SDK->is_loggedin()) {
$info = $SDK->get_info();
$num_miembro = $info['id'];
};
$nsecid = 1 ;
$torneo = 34;
$nentradas = 63;
$ndownload = 13;
$galeria = "category_id = 57";
switch ($npagid) {
case 0:
$tmain = "inicio.html";
break;
case 1:
$tmain = "mapas.html";
break;
case 2:
$tmain = "participantes.html";
break;
case 3:
$tmain = "rondas.html";
break;
case 4:
$tmain = "posiciones.html";
break;
default:
$tmain = "inicio.html";
break;
}
$t->set_file(array(
"mainpage" => $tmain,
"tparticipantes" => "templates/template_participantes.htm",
"entradas" => $path."_templates/tVariosNews.htm"));
$link = mysql_connect("$dbHost", "$dbUser", "$dbPass")
or die("Could not connect : " . mysql_error());
mysql_select_db("$dbDatabase1") or die("Could not select database");
$query = "SELECT
ibf_topics.tid,
ibf_topics.title,
ibf_topics.starter_name,
ibf_topics.starter_id,
ibf_topics.start_date,
ibf_topics.last_poster_name,
ibf_topics.last_poster_id,
ibf_topics.posts,
ibf_topics.last_post,
ibf_posts.post,
ibf_topics.forum_id
FROM
ibf_topics,
ibf_posts
WHERE
ibf_topics.forum_id=63 AND
new_topic = 1 AND
ibf_posts.topic_id = ibf_topics.tid AND
ibf_topics.approved = 1
ORDER BY
ibf_topics.start_date DESC
LIMIT 10";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
$c = 0;
$n = 0;
$totaln = 10;
while (list( $tid,
$title,
$autor,
$starter_id,
$start_date,
$last_poster,
$last_poster_id,
$posts,
$last_post,
$text,
$foro) = mysql_fetch_row($result)) {
$title = strtolower ($title);
$title2 = $title;
$MAX_LENGTH = 40;
$str_to_count = html_entity_decode($title);
if (strlen($str_to_count) >= $MAX_LENGTH) {
$s2 = substr($str_to_count, 0, $MAX_LENGTH - 3);
$s2 .= "...";
$title = ($s2);
}
$a = 0;
$b = 0;
$a = strpos($text, '