| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,20 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+if(!defined("_CHARSET")) exit( );
|
|
| 4 |
+ $count = 0; |
|
| 5 |
+ $content = ""; |
|
| 6 |
+ $use_tpl = isset($blocks['random']['tpl']) && $blocks['random']['tpl'] ? true : false; |
|
| 7 |
+ $limit = isset($blocks['random']['limit']) && $blocks['random']['limit'] > 0 ? $blocks['random']['limit'] : 1; |
|
| 8 |
+ $randomquery = dbquery(_STORYQUERY." ORDER BY rand( ) DESC LIMIT $limit"); |
|
| 9 |
+ if($use_tpl && dbnumrows($randomquery) >0) $tpl->newBlock("randomblock");
|
|
| 10 |
+ while($stories = dbassoc($randomquery)) |
|
| 11 |
+ {
|
|
| 12 |
+ if(!isset($blocks['random']['allowtags'])) $stories['summary'] = strip_tags($stories['summary']); |
|
| 13 |
+ $stories['summary'] = truncate_text(stripslashes($stories['summary']), (isset($blocks['random']['sumlength']) ? $blocks['random']['sumlength'] : 75)); |
|
| 14 |
+ if(!$use_tpl) $content .= "<div class='randomstory'>".title_link($stories)." "._BY." ".author_link($stories)." ".$ratingslist[$stories['rid']]['name']."<br />".$stories['summary']."</div>"; |
|
| 15 |
+ else {
|
|
| 16 |
+ include(_BASEDIR."includes/storyblock.php"); |
|
| 17 |
+ } |
|
| 18 |
+ } |
|
| 19 |
+ if($use_tpl && dbnumrows($randomquery) >0) $tpl->gotoBlock("_ROOT");
|
|
| 20 |
+?> |
|
| 0 | 21 |
\ No newline at end of file |