Browse code

3.5.6 efiction version

Jimako authored on 2024/03/09 16:09:42
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,61 @@
1
+<?php
2
+
3
+// ----------------------------------------------------------------------
4
+// eFiction 3.2
5
+// Copyright (c) 2007 by Tammy Keefer
6
+// Valid HTML 4.01 Transitional
7
+// Based on eFiction 1.1
8
+// Copyright (C) 2003 by Rebecca Smallwood.
9
+// http://efiction.sourceforge.net/
10
+// ----------------------------------------------------------------------
11
+// LICENSE
12
+//
13
+// This program is free software; you can redistribute it and/or
14
+// modify it under the terms of the GNU General Public License (GPL)
15
+// as published by the Free Software Foundation; either version 2
16
+// of the License, or (at your option) any later version.
17
+//
18
+// This program is distributed in the hope that it will be useful,
19
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
+// GNU General Public License for more details.
22
+//
23
+// To read the license please visit http://www.gnu.org/copyleft/gpl.html
24
+// ----------------------------------------------------------------------
25
+
26
+if(!defined("_CHARSET")) exit( );
27
+
28
+	if(isset($blocks['news']['num'])) $numupdated = $blocks['news']['num'];
29
+	else $numupdated = 1;
30
+	if(file_exists("$skindir/newsbox.tpl")) $news = new TemplatePower( "$skindir/newsbox.tpl" );
31
+	else $news = new TemplatePower( _BASEDIR."default_tpls/newsbox.tpl" );
32
+	if(file_exists(_BASEDIR."blocks/news/".$language.".php")) include_once(_BASEDIR."blocks/news/".$language.".php");
33
+	else include_once(_BASEDIR."blocks/news/en.php");
34
+
35
+	$news->prepare();
36
+	$newsquery = dbquery("SELECT nid, author, title, story, time as date, comments FROM ".TABLEPREFIX."fanfiction_news ORDER BY time DESC LIMIT $numupdated");
37
+	$count = 0;
38
+	while($stories = dbassoc($newsquery)) {
39
+
40
+		//create a new number_row block
41
+		$news->newBlock("newsbox");
42
+		
43
+		//assign values
44
+		if(!empty($blocks['news']['sumlength']) && isNumber($blocks['news']['sumlength'])) $newsStory = truncate_text($stories['story'], $blocks['news']['sumlength'])."<div class='newsReadMore'><a href='news.php?action=newsstory&amp;nid=".$stories['nid']."'>"._READMORE."</a></div>";
45
+		else $newsStory = format_story($stories['story']);
46
+		$news->assign("newstitle" , $stories['title'] );
47
+		$news->assign("newsstory" , $newsStory);
48
+		$news->assign("newsauthor", $stories['author'] );
49
+		$news->assign("newsdate", date("$dateformat $timeformat", $stories['date']) );
50
+		$news->assign("oddeven", ($count % 2 ? "even" : "odd"));
51
+		$news->assign("newsid", $stories['nid']);
52
+		$news->assign("skindir", $skindir);
53
+		if($newscomments)
54
+			$news->assign("newscomments", "<a href=\"news.php?action=newsstory&amp;nid=".$stories['nid']."\">".$stories['comments']." "._COMMENTS."</a>");
55
+		if(isADMIN) 
56
+			$news->assign("adminoptions", "<a href=\"admin.php?action=news&amp;form=".$stories['nid']."\">"._EDIT."</a> | <a href=\"admin.php?action=news&amp;delete=".$stories['nid']."\">"._DELETE."</a>");
57
+		$count++;
58
+	}
59
+	$news->gotoBlock("_ROOT");
60
+	$content = $news->getOutputContent( );
61
+?>
0 62
\ No newline at end of file