Skip to content

Commit

Permalink
Merge branch 'v1.7.8' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
auge8472 committed Apr 27, 2019
2 parents b7f6220 + da26fff commit 2bf5572
Show file tree
Hide file tree
Showing 25 changed files with 1,389 additions and 1,157 deletions.
8 changes: 5 additions & 3 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ INSTALLATION
The script requires PHP > 4.1 and a MySQL database.

* The file forum.zip contains a folder with the script files ("forum").
* Load up the complete folder on your server.
* Load up the complete folder to your server.
* The file db_settings.php requires write permission! Set this with your FTP programm
(CHMOD 666).
* Start install.php on your server (http://www.domain.tld/forum/install.php).
* Start install.php on your server (http://www.example.net/forum/install.php).
* Fill in the form completely.
* After installing, remove the file install.php from the server!
* You can now log in with the name and password you specefied at the installation.
* The file db_settings.php doesn't require write permission anymore! Remove it with your FTP programm
(CHMOD 444 or 644).
* You can now log in with the name and password you specified during the installation.
In the "admin area" you can then customize the forum.
* To customize the layout, edit the files template.html and style.css.
9 changes: 5 additions & 4 deletions README
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
my little forum
version 1.7.6 - 2008-05-31
Copyright (C) 2008 mylittleforum.net
http://mylittleforum.net/
version 1.7.8 - 2019-04-27
Copyright (C) 2004-2008 mylittleforum.net
Copyright (C) 2009-2018 auge8472.de
https://www.projekt-mlf.de/

Installation:
For installation instructions please refer to the INSTALL document.

License:
This product is distributed under the GPL. Please read through the file
This product is distributed under the GPL 2. Please read through the file
LICENSE for more informations about this license.

574 changes: 283 additions & 291 deletions admin.php

Large diffs are not rendered by default.

58 changes: 29 additions & 29 deletions board.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php
###############################################################################
# my little forum #
# Copyright (C) 2004 Alex #
# Copyright (C) 2004-2008 Alex #
# http://www.mylittlehomepage.net/ #
# Copyright (C) 2009-2019 H. August #
# https://www.projekt-mlf.de/ #
# #
# This program is free software; you can redistribute it and/or #
# modify it under the terms of the GNU General Public License #
Expand Down Expand Up @@ -48,32 +50,30 @@
// database request
if ($categories == false) // no categories defined
{
$result=mysql_query("SELECT id, pid, tid, user_id, UNIX_TIMESTAMP(time + INTERVAL ".$time_difference." HOUR) AS xtime,
UNIX_TIMESTAMP(last_answer + INTERVAL ".$time_difference." HOUR) AS la_time,
UNIX_TIMESTAMP(last_answer) AS last_answer, name, subject, category, marked, fixed, views FROM ".$db_settings['forum_table']." WHERE pid = 0 ORDER BY fixed DESC, ".$order." ".$descasc." LIMIT ".$ul.", ".$settings['topics_per_page'], $connid);
$result=mysqli_query($connid, "SELECT id, pid, tid, user_id, UNIX_TIMESTAMP(time + INTERVAL ". $time_difference ." HOUR) AS xtime,
UNIX_TIMESTAMP(last_answer + INTERVAL ". $time_difference ." HOUR) AS la_time,
UNIX_TIMESTAMP(last_answer) AS last_answer, name, subject, category, marked, fixed, views FROM ". $db_settings['forum_table'] ." WHERE pid = 0 ORDER BY fixed DESC, ". $order ." ". $descasc ." LIMIT ". intval($ul) .", ". intval($settings['topics_per_page']));
if(!$result) die($lang['db_error']);
}
elseif (is_array($categories) && $category == 0) // there are categories and all categories should be shown
{
$result=mysql_query("SELECT id, pid, tid, user_id, UNIX_TIMESTAMP(time + INTERVAL ".$time_difference." HOUR) AS xtime,
UNIX_TIMESTAMP(last_answer + INTERVAL ".$time_difference." HOUR) AS la_time,
UNIX_TIMESTAMP(last_answer) AS last_answer, name, subject, category, marked, fixed, views FROM ".$db_settings['forum_table']." WHERE pid = 0 AND category IN (".$category_ids_query.") ORDER BY fixed DESC, ".$order." ".$descasc." LIMIT ".$ul.", ".$settings['topics_per_page'], $connid);
$result=mysqli_query($connid, "SELECT id, pid, tid, user_id, UNIX_TIMESTAMP(time + INTERVAL ". $time_difference ." HOUR) AS xtime,
UNIX_TIMESTAMP(last_answer + INTERVAL ". $time_difference ." HOUR) AS la_time,
UNIX_TIMESTAMP(last_answer) AS last_answer, name, subject, category, marked, fixed, views FROM ". $db_settings['forum_table'] ." WHERE pid = 0 AND category IN (". $category_ids_query .") ORDER BY fixed DESC, ". $order ." ". $descasc ." LIMIT ". intval($ul) .", ". intval($settings['topics_per_page']));
if(!$result) die($lang['db_error']);
}
elseif (is_array($categories) && $category != 0 && in_array($category, $category_ids)) // there are categories and only one category should be shown
{
$result=mysql_query("SELECT id, pid, tid, user_id, UNIX_TIMESTAMP(time + INTERVAL ".$time_difference." HOUR) AS xtime,
UNIX_TIMESTAMP(last_answer + INTERVAL ".$time_difference." HOUR) AS la_time,
UNIX_TIMESTAMP(last_answer) AS last_answer, name, subject, category, marked, fixed, views FROM ".$db_settings['forum_table']." WHERE category = '".mysql_escape_string($category)."' AND pid = 0 ORDER BY fixed DESC, ".$order." ".$descasc." LIMIT ".$ul.", ".$settings['topics_per_page'], $connid);
$result=mysqli_query($connid, "SELECT id, pid, tid, user_id, UNIX_TIMESTAMP(time + INTERVAL ". $time_difference ." HOUR) AS xtime,
UNIX_TIMESTAMP(last_answer + INTERVAL ". $time_difference ." HOUR) AS la_time,
UNIX_TIMESTAMP(last_answer) AS last_answer, name, subject, category, marked, fixed, views FROM ". $db_settings['forum_table'] ." WHERE category = ". intval($category) ." AND pid = 0 ORDER BY fixed DESC, ". $order ." ". $descasc ." LIMIT ". intval($ul) .", ". intval($settings['topics_per_page']));
if(!$result) die($lang['db_error']);
// how many entries?
$pid_result = mysql_query("SELECT COUNT(*) FROM ".$db_settings['forum_table']." WHERE pid = 0 AND category = '".mysql_escape_string($category)."'", $connid);
list($thread_count) = mysql_fetch_row($pid_result);
mysql_free_result($pid_result);
$pid_result = mysqli_query($connid, "SELECT COUNT(*) FROM ". $db_settings['forum_table'] ." WHERE pid = 0 AND category = ". intval($category));
list($thread_count) = mysqli_fetch_row($pid_result);
mysqli_free_result($pid_result);
}

$category = stripslashes($category);

$subnav_1='<a class="textlink" href="posting.php?view=board&amp;category='.$category.'" title="'.$lang['new_entry_linktitle'].'">'.$lang['new_entry_linkname'].'</a>';
$subnav_2 = '';
if (isset($_SESSION[$settings['session_prefix'].'user_id'])) $subnav_2 .= '<a href="index.php?update=1&amp;view=board&amp;category='.$category.'"><img src="img/update.gif" alt="" title="'.$lang['update_time_linktitle'].'" width="9" height="9" onmouseover="this.src=\'img/update_mo.gif\';" onmouseout="this.src=\'img/update.gif\';" /></a>';
Expand Down Expand Up @@ -118,37 +118,37 @@
</tr>
<?php
$i=0;
while ($zeile = mysql_fetch_assoc($result)) {
while ($zeile = mysqli_fetch_assoc($result)) {
// count replies:
$pid_resultc = mysql_query("SELECT COUNT(*) FROM ".$db_settings['forum_table']." WHERE tid = ".$zeile["tid"], $connid);
list($answers_count) = mysql_fetch_row($pid_resultc);
$pid_resultc = mysqli_query($connid, "SELECT COUNT(*) FROM ". $db_settings['forum_table'] ." WHERE tid = ". intval($zeile["tid"]));
list($answers_count) = mysqli_fetch_row($pid_resultc);
$answers_count = $answers_count - 1;
mysql_free_result($pid_resultc);
mysqli_free_result($pid_resultc);

// data for link to last reply:
if ($settings['last_reply_link'] == 1)
{
$last_answer_result = mysql_query("SELECT name, id FROM ".$db_settings['forum_table']." WHERE tid = ".$zeile["tid"]." ORDER BY time DESC LIMIT 1", $connid);
$last_answer = mysql_fetch_assoc($last_answer_result);
mysql_free_result($last_answer_result);
$last_answer_result = mysqli_query($connid, "SELECT name, id FROM ". $db_settings['forum_table'] ." WHERE tid = ". intval($zeile["tid"]) ." ORDER BY time DESC LIMIT 1");
$last_answer = mysqli_fetch_assoc($last_answer_result);
mysqli_free_result($last_answer_result);
}

// highlight mods and admins:
$mark_admin = false;
$mark_mod = false;
if ($settings['admin_mod_highlight'] == 1 && $zeile["user_id"] > 0)
{
$userdata_result=mysql_query("SELECT user_type FROM ".$db_settings['userdata_table']." WHERE user_id = '".$zeile["user_id"]."'", $connid);
$userdata_result=mysqli_query($connid, "SELECT user_type FROM ". $db_settings['userdata_table'] ." WHERE user_id = ". intval($zeile["user_id"]));
if (!$userdata_result) die($lang['db_error']);
$userdata = mysql_fetch_assoc($userdata_result);
mysql_free_result($userdata_result);
$userdata = mysqli_fetch_assoc($userdata_result);
mysqli_free_result($userdata_result);
if ($userdata['user_type'] == "admin") $mark_admin = true;
elseif ($userdata['user_type'] == "mod") $mark_mod = true;
}
?>
<tr>
<td class="<?php if($i % 2 == 0) echo "a"; else echo "b"; ?>"><?php
?><a class="<?php if ((isset($_SESSION[$settings['session_prefix'].'newtime']) && $_SESSION[$settings['session_prefix'].'newtime'] < $zeile["last_answer"]) || (($zeile["pid"]==0) && empty($_SESSION[$settings['session_prefix'].'newtime']) && $zeile["last_answer"] > $last_visit)) echo "threadnew"; else echo "thread"; ?>" href="board_entry.php?id=<?php echo $zeile["tid"]; if ($page != 0 || $category != 0 || $order != "last_answer" || $descasc != "DESC") echo '&amp;page='.$page.'&amp;category='.$category.'&amp;order='.$order.'&amp;descasc='.$descasc; ?>"><?php echo htmlsc(stripslashes($zeile["subject"])); ?></a><?php
?><a class="<?php if ((isset($_SESSION[$settings['session_prefix'].'newtime']) && $_SESSION[$settings['session_prefix'].'newtime'] < $zeile["last_answer"]) || (($zeile["pid"]==0) && empty($_SESSION[$settings['session_prefix'].'newtime']) && $zeile["last_answer"] > $last_visit)) echo "threadnew"; else echo "thread"; ?>" href="board_entry.php?id=<?php echo $zeile["tid"]; if ($page != 0 || $category != 0 || $order != "last_answer" || $descasc != "DESC") echo '&amp;page='.$page.'&amp;category='.$category.'&amp;order='.$order.'&amp;descasc='.$descasc; ?>"><?php echo htmlsc($zeile["subject"]); ?></a><?php
if ($zeile["fixed"] == 1) { ?> <img src="img/fixed.gif" width="9" height="9" title="<?php echo $lang['fixed']; ?>" alt="*" /><?php }
if ($settings['all_views_direct'] == 1) { echo " <span class=\"small\">"; if ($settings['thread_view']==1) {?><a href="forum_entry.php?id=<?php echo $zeile["tid"]; ?>"><img src="img/thread_d.gif" alt="[Thread]" title="<?php echo $lang['open_in_thread_linktitle']; ?>" width="12" height="9" onmouseover="this.src='img/thread_mo.gif';" onmouseout="this.src='img/thread_d.gif';" /></a><?php } if ($settings['mix_view'] == 1) { ?><a href="mix_entry.php?id=<?php echo $zeile["tid"]; ?>"><img src="img/mix_d.gif" alt="[Mix]" title="<?php echo $lang['open_in_mix_linktitle']; ?>" width="12" height="9" onmouseover="this.src='img/mix_mo.gif';" onmouseout="this.src='img/mix_d.gif';" /></a>&nbsp;<?php }echo "</span>"; } ?></td>
<?php if ($categories!=false && $category == 0) { ?>
Expand All @@ -157,9 +157,9 @@
<td class="<?php if($i % 2 == 0) echo "a"; else echo "b"; ?>"><?php
if (isset($_SESSION[$settings['session_prefix'].'user_id']) && $zeile["user_id"] > 0)
{
$sult = str_replace("[name]", htmlsc(stripslashes($zeile["name"])), $lang['show_userdata_linktitle']); ?><a href="user.php?id=<?php echo $zeile["user_id"]; ?>" title="<?php echo $sult; ?>"><?php
$sult = str_replace("[name]", htmlsc($zeile["name"]), $lang['show_userdata_linktitle']); ?><a href="user.php?id=<?php echo $zeile["user_id"]; ?>" title="<?php echo $sult; ?>"><?php
}
?><span class="small"><?php if ($mark_admin==true) { ?><span class="admin-highlight"><?php } elseif ($mark_mod==true) { ?><span class="mod-highlight"><?php } echo htmlsc(stripslashes($zeile["name"])); if ($mark_admin==true || $mark_mod=="true") { ?></span><?php } ?></span><?php
?><span class="small"><?php if ($mark_admin==true) { ?><span class="admin-highlight"><?php } elseif ($mark_mod==true) { ?><span class="mod-highlight"><?php } echo htmlsc($zeile["name"]); if ($mark_admin==true || $mark_mod=="true") { ?></span><?php } ?></span><?php

if ($zeile["user_id"] > 0 && $settings['show_registered'] ==1)
{
Expand All @@ -184,7 +184,7 @@
<?php $i++;
}
?></table><?php
mysql_free_result($result);
mysqli_free_result($result);
if(isset($_SESSION[$settings['session_prefix'].'user_type']) && $_SESSION[$settings['session_prefix'].'user_type']=='admin')
{
?><p class="marked-threads-board"><img src="img/marked.gif" alt="[x]" width="9" height="9" /> <?php echo $lang['marked_threads_actions']; ?> <a href="admin.php?action=delete_marked_threads&amp;refer=board"><?php echo $lang['delete_marked_threads']; ?></a> - <a href="admin.php?action=lock_marked_threads&amp;refer=board"><?php echo $lang['lock_marked_threads']; ?></a> - <a href="admin.php?action=unlock_marked_threads&amp;refer=board"><?php echo $lang['unlock_marked_threads']; ?></a> - <a href="admin.php?action=unmark&amp;refer=board"><?php echo $lang['unmark_threads']; ?></a> - <a href="admin.php?action=invert_markings&amp;refer=board"><?php echo $lang['invert_markings']; ?></a> - <a href="admin.php?action=mark_threads&amp;refer=board"><?php echo $lang['mark_threads']; ?></a></p><?php
Expand Down
Loading

0 comments on commit 2bf5572

Please sign in to comment.