Lets you extract clickable quote from random news long text
Just put
<!--siteQuote--> before and after the part of the longtext you want to be quoted (in source mode)
go to
www.kontrax.net for example of use. (upper right corner)
Use class "siteQuote" for css
All groups Example:[[newsQuote]]
One group Example:[[newsQuote?group=2]]
Multi group Example: ( seperate groups with , )
[[newsQuote?group=2,5]]
if(isset($group)){
if(stripos($group, ',') === false){
$group =" AND group_id=".$group;
}else{
$mod_params = explode(',', $group);
$group =" AND group_id IN (".$mod_params[0];
for($i=1; $i<count($mod_params); $i++){
$group .=", ".$mod_params[$i];
}
$group .=")";
}
}else{
$group = '';
}
global $database, $wb;
$mod_query = $database->query("SELECT title, link, content_long FROM ".TABLE_PREFIX.
"mod_news_posts WHERE active='1'".$group.
" ORDER BY RAND() LIMIT 1");
$mod_list = " ";
while ( $row =& $mod_query->fetchRow()){
$mod_randomQuote = explode('<!--siteQuote-->', $row["content_long"]);
if(isset($mod_randomQuote[1])){
$mod_list = '<a class="siteQuote" href="'.WB_URL.PAGES_DIRECTORY.$row["link"].PAGE_EXTENSION.'" ';
$mod_list .= 'title="'.$row["title"].'">';
$mod_list .= $mod_randomQuote[1];
$mod_list .= '</a>';
}
}
return $mod_list;
FIX : Error fix when quote is not set
FIX : Now group is optional, if not supplied it will get all groups
FIX : Added multiple or all groups
PS. I will probably add more small fixes and features to this droplet later so drop back for updates