Vytvořil jsem si HCM, pro snadné odkazování na témata ve fórech, použití identické s HCM linkArt (odkaz na článek), třeba ho někdo z vás bude taky potřebovat.
<?php
/*--- kontrola jadra ---*/
if(!defined('_core')) {
exit;
}
/*--- definice funkce modulu ---*/
function _HCM_linkforum($id = null, $text = null, $nove_okno = false)
{
$id = intval($id);
$query = mysql_query("SELECT subject FROM `"._mysql_prefix."-posts` WHERE type=5 AND id=".$id);
if(isset($nove_okno) and _boolean($nove_okno)) {
$target = " target='_blank'";
} else {
$target = "";
}
if(mysql_num_rows($query) != 0) {
$query = mysql_fetch_assoc($query);
if(isset($text) and $text != "") {
$query['subject'] = $text;
}
return "<a href='index.php?m=topic&id=".$id."'".$target.">".$query['subject']."</a>";
}
}
?>
Použití
[hcm]linkforum,1,Text odkazu,0[/hcm][hcm]linkforum,(id tématu),(zobrazený text odkazu),(0/1 - do noveho okna)[/hcm]
<?php
/*--- kontrola jadra ---*/
if(!defined('_core')) {
exit;
}
/*--- definice funkce modulu ---*/
function _HCM_linkforum($id = null, $text = null, $nove_okno = false)
{
$id = intval($id);
$query = mysql_query("SELECT subject FROM `"._mysql_prefix."-posts` WHERE type=5 AND id=".$id);
if(isset($nove_okno) and _boolean($nove_okno)) {
$target = " target='_blank'";
} else {
$target = "";
}
if(mysql_num_rows($query) != 0) {
$query = mysql_fetch_assoc($query);
if(isset($text) and $text != "") {
$query['subject'] = $text;
}
return "<a href='index.php?m=topic&id=".$id."'".$target.">".$query['subject']."</a>";
}
}
?>
Použití
[hcm]linkforum,1,Text odkazu,0[/hcm][hcm]linkforum,(id tématu),(zobrazený text odkazu),(0/1 - do noveho okna)[/hcm]