Previous sNews versions > sNews 1.4 BETA
1.4 testing2 + db prefix bugfix. +funny bug
Patric Ahlqvist:
GREAT ! Thanks again, A. Hope Luka gives you plenty credit come release ;).
I will try this out tonite, haven't got access to my server during working hours. I'll get back to you.
Patric.
George Antoniadis:
lol! ^_^
no worries...
These are stuff that most likely Luka knows about and has allready fixed them... :)
These are just quick and dirty bugfixes for us to try a more stable 1.4 release! ;)
Patric Ahlqvist:
Yea, I understand that. I just felt that I'd like a nearly functional version to make designs to. Problems occur doing this if I can't see the different items on the page. So this won't go into "produktion" before a stable version hit's the streets, but I can develop the "looks" of it... and then just update snews.php.
So...thanks for letting me do that ;) - Patric.
Patric Ahlqvist:
Ok, analyzerx (I did it, I got your name right without looking ;))...
I swapped this:
--- Code: ---
// RIGHT
function right() {
$db = mysql_connect(s('dbhost'),s('dbuname'),s('dbpass'));
mysql_select_db(s('dbname')) or die(s('dberror'));
$query = "SELECT * FROM " .s('prefix'). "articles WHERE position = 2 ORDER BY id DESC";
$result = mysql_query($query);
while ($r = mysql_fetch_array($result)) {
if (isset($_SESSION['Username'])) { echo "". l(edit_article) ." ". l(delete_article) .""; }
if ($r['displaytitle'] == "YES") { echo "". $r['title'] .""; }
echo $r['text'];
}
}
// ARCHIVES
function archives() {
echo "". l('archives') ."";
echo "
". l('home') ."";
$query = "SELECT * FROM " .s('prefix'). "articles WHERE position = 1 AND category = 0 ORDER BY id DESC";
$result = mysql_query($query);
while ($r = mysql_fetch_array($result)) {
$date = date(s('date_format'), strtotime($r['date']));
echo " ". $r['title'] ." ". $date ."";
}
$db = mysql_connect(s('dbhost'),s('dbuname'),s('dbpass'));
mysql_select_db(s('dbname')) or die(s('dberror'));
$cat_query = "SELECT * FROM " .s('prefix'). "categories";
$cat_result = mysql_query($cat_query);
while ($c = mysql_fetch_array($cat_result)) {
echo "
". $c['name'] ." ". $c['description'] ."";
echo "" .$r['title']. " ";
$catid = $c['id'];
$query = "SELECT * FROM " .s('prefix'). "articles WHERE category = $catid";
$result = mysql_query($query);
while ($r = mysql_fetch_array($result)) {
$date = date(s(date), strtotime($r['date']));
echo " ". $r['title'] ." ". $date ."";
}}}
--- End code ---
with this:
--- Code: ---
// RIGHT
function right() {
$query = "SELECT * FROM " .s('prefix'). "articles WHERE position = 2 AND published = 1 ORDER BY id DESC";
$result = mysql_query($query);
while ($r = mysql_fetch_array($result)) {
if (isset($_SESSION['Logged_In'])) { echo l('edit'). " [ ". l('simple') ." ". l('advanced') ." ] ". l('delete_article') .""; }
if ($r['displaytitle'] == "YES") { echo "". $r['title'] .""; }
if ($r['textlimit'] == 0) { $textlimit = 999000; } else { $textlimit = $r['textlimit']; }
// PHP files inclusion routine
$fulltext = $r['text'];
$findme = "[include]";
$pos = strpos($fulltext, $findme);
$findme = "[/include]";
$pos2 = strpos($fulltext, $findme);
$file = substr($fulltext, $pos + 9, $pos2 - 9);
if ($pos2 > 0) {
$text = str_replace("[include]", "|&|", $fulltext);
$text = str_replace("[/include]", "|&|", $text);
$text = explode("|&|", $text);
$num = count($text);
for ($i = 0; ; $i++) {
if ($i == $num) {
break;
}
if (strpos($text[$i], '.php') === false AND strpos($text[$i], '.txt') === false AND strpos($text[$i], '.inc') === false) {
echo substr(stripslashes($text[$i]), 0, $textlimit);
} else {
include $text[$i];
}}} else {
echo substr(stripslashes($fulltext), 0, $textlimit);
}}}
--- End code ---
Was that right ? I do overwright the //Articles by doing that... I did it b'cause the only }}} I saw came after the Articles section of the code. Anyways, that didn't do the trick. I can still not post any text in "right" that becomes visible while logged out. I can still see it while editing the "right" post. :(
Jochum Meester:
I think you need to leave the archives-part in. Perhaps your PHP editor (different than notepad?) is changing }}} into:
}
}
}
Or something like that, I dunno.
My problem: the path to CSS is wrong because those /home/search-engine-friendly/ -links are there. A 'solucija' please :)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version