1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 12:48:26 +02:00

Switch to include_lan()

This commit is contained in:
marj
2009-11-19 09:52:35 +00:00
parent d8436b9f18
commit 5961e8cba4
5 changed files with 90 additions and 88 deletions

View File

@@ -9,15 +9,14 @@
* Forum Posting * Forum Posting
* *
* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_post.php,v $ * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_post.php,v $
* $Revision: 1.40 $ * $Revision: 1.41 $
* $Date: 2009-11-18 01:05:36 $ * $Date: 2009-11-19 09:52:35 $
* $Author: e107coders $ * $Author: marj_nl_fr $
*/ */
require_once('../../class2.php'); require_once('../../class2.php');
$lan_file = e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_post.php'; include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_post.php');
include(file_exists($lan_file) ? $lan_file : e_PLUGIN.'forum/languages/English/lan_forum_post.php');
if (isset($_POST['fjsubmit'])) if (isset($_POST['fjsubmit']))
{ {

View File

@@ -9,9 +9,9 @@
* *
* *
* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_uploads.php,v $ * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_uploads.php,v $
* $Revision: 1.5 $ * $Revision: 1.6 $
* $Date: 2009-11-18 01:05:36 $ * $Date: 2009-11-19 09:52:35 $
* $Author: e107coders $ * $Author: marj_nl_fr $
*/ */
require_once("../../class2.php"); require_once("../../class2.php");
@@ -21,8 +21,7 @@ if(!USER)
header("location:".e_BASE.$PLUGINS_DIRECTORY."forum/forum.php"); header("location:".e_BASE.$PLUGINS_DIRECTORY."forum/forum.php");
exit; exit;
} }
$lan_file = e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_uploads.php'; include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_uploads.php');
include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN.'forum/languages/English/lan_forum_uploads.php');
if(is_array($_POST['delete'])) if(is_array($_POST['delete']))
{ {

View File

@@ -9,22 +9,22 @@
* *
* *
* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/newforumposts_menu_config.php,v $ * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/newforumposts_menu_config.php,v $
* $Revision: 1.4 $ * $Revision: 1.5 $
* $Date: 2009-11-18 01:05:36 $ * $Date: 2009-11-19 09:52:35 $
* $Author: e107coders $ * $Author: marj_nl_fr $
*/ */
$eplug_admin = TRUE; $eplug_admin = TRUE;
require_once("../../class2.php"); require_once('../../class2.php');
if (!getperms("1")) { if (!getperms('1'))
header("location:".e_BASE."index.php"); {
exit ; header('location:'.e_BASE.'index.php');
exit();
} }
require_once(e_ADMIN."auth.php"); require_once(e_ADMIN.'auth.php');
$lan_file = e_PLUGIN."forum/languages/".e_LANGUAGE."/lan_newforumposts_menu.php";
require_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."forum/languages/English/lan_newforumposts_menu.php");
include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_newforumposts_menu.php');
if (isset($_POST['update_menu'])) { if (isset($_POST['update_menu'])) {
while (list($key, $value) = each($_POST)) { while (list($key, $value) = each($_POST)) {
if ($value != NFP_9) { if ($value != NFP_9) {

View File

@@ -1,4 +1,4 @@
<?php <?php
/* /*
* e107 website system * e107 website system
* *
@@ -9,27 +9,25 @@
* *
* *
* $Source: /cvs_backup/e107_0.8/e107_plugins/newforumposts_main/admin_config.php,v $ * $Source: /cvs_backup/e107_0.8/e107_plugins/newforumposts_main/admin_config.php,v $
* $Revision: 1.3 $ * $Revision: 1.4 $
* $Date: 2009-11-18 01:05:53 $ * $Date: 2009-11-19 09:52:35 $
* $Author: e107coders $ * $Author: marj_nl_fr $
*/ */
require_once("../../class2.php"); require_once ('../../class2.php');
require_once(e_HANDLER."userclass_class.php"); if(!getperms('1'))
{
$lan_file = e_PLUGIN."newforumposts_main/languages/".e_LANGUAGE.".php"; header('location:'.e_BASE.'index.php');
if (file_exists($lan_file)) { exit();
require_once($lan_file);
} else {
require_once(e_PLUGIN."newforumposts_main/languages/English.php");
} }
if (!getperms("1")) {
header("location:".e_BASE."index.php"); require_once (e_HANDLER.'userclass_class.php');
exit ;
} include_lan(e_PLUGIN.'newforumposts_main/languages/'.e_LANGUAGE.'.php');
require_once(e_ADMIN."auth.php"); require_once (e_ADMIN.'auth.php');
if (isset($_POST['updatesettings'])) { if(isset($_POST['updatesettings']))
{
$pref['nfp_display'] = $_POST['nfp_display']; $pref['nfp_display'] = $_POST['nfp_display'];
$pref['nfp_caption'] = $_POST['nfp_caption']; $pref['nfp_caption'] = $_POST['nfp_caption'];
$pref['nfp_amount'] = $_POST['nfp_amount']; $pref['nfp_amount'] = $_POST['nfp_amount'];
@@ -39,13 +37,13 @@ if (isset($_POST['updatesettings'])) {
save_prefs(); save_prefs();
$message = "".NFPM_L14.""; $message = "".NFPM_L14."";
} }
if ($message) { if($message)
{
$ns->tablerender("", "<div style='text-align:center'><b>$message</b></div>"); $ns->tablerender("", "<div style='text-align:center'><b>$message</b></div>");
} }
$text = "<div style='text-align:center'> $text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?".e_QUERY."' id='menu_conf_form'> <form method='post' action='".e_SELF."?".e_QUERY."' id='menu_conf_form'>
<table style='width:85%' class='fborder'> <table style='width:85%' class='fborder'>
@@ -53,10 +51,7 @@ $text = "<div style='text-align:center'>
<tr> <tr>
<td style='width:40%' class='forumheader3'>".NFPM_L4."</td> <td style='width:40%' class='forumheader3'>".NFPM_L4."</td>
<td style='width:60%' class='forumheader3'> <td style='width:60%' class='forumheader3'>
<select class='tbox' name='nfp_display'>" .($pref['nfp_display'] == "0" ? "<option value='0' selected='selected'>".NFPM_L5."</option>" : "<option value='0'>".NFPM_L5."</option>") <select class='tbox' name='nfp_display'>".($pref['nfp_display'] == "0" ? "<option value='0' selected='selected'>".NFPM_L5."</option>" : "<option value='0'>".NFPM_L5."</option>").($pref['nfp_display'] == "1" ? "<option value='1' selected='selected'>".NFPM_L6."</option>" : "<option value='1'>".NFPM_L6."</option>").($pref['nfp_display'] == "2" ? "<option value='2' selected='selected'>".NFPM_L7."</option>" : "<option value='2'>".NFPM_L7."</option>")."</select>
.($pref['nfp_display'] == "1" ? "<option value='1' selected='selected'>".NFPM_L6."</option>" : "<option value='1'>".NFPM_L6."</option>")
.($pref['nfp_display'] == "2" ? "<option value='2' selected='selected'>".NFPM_L7."</option>" : "<option value='2'>".NFPM_L7."</option>")
."</select>
</td> </td>
</tr> </tr>
@@ -76,13 +71,13 @@ $text = "<div style='text-align:center'>
<tr> <tr>
<td class='forumheader3' style='width:40%'>".NFPM_L15." </td> <td class='forumheader3' style='width:40%'>".NFPM_L15." </td>
<td class='forumheader3' style='width:60%'>". ($pref['nfp_posts'] ? "<input type='checkbox' name='nfp_posts' value='1' checked='checked' />" : "<input type='checkbox' name='nfp_posts' value='1' />")." <td class='forumheader3' style='width:60%'>".($pref['nfp_posts'] ? "<input type='checkbox' name='nfp_posts' value='1' checked='checked' />" : "<input type='checkbox' name='nfp_posts' value='1' />")."
</td> </td>
</tr> </tr>
<tr> <tr>
<td class='forumheader3' style='width:40%'>".NFPM_L10.": </td> <td class='forumheader3' style='width:40%'>".NFPM_L10.": </td>
<td class='forumheader3' style='width:60%'>". ($pref['nfp_layer'] ? "<input type='checkbox' name='nfp_layer' value='1' checked='checked' />" : "<input type='checkbox' name='nfp_layer' value='1' />")."&nbsp;&nbsp;".NFPM_L11.": <input class='tbox' type='text' name='nfp_layer_height' size='8' value='".$pref['nfp_layer_height']."' maxlength='3' /> <td class='forumheader3' style='width:60%'>".($pref['nfp_layer'] ? "<input type='checkbox' name='nfp_layer' value='1' checked='checked' />" : "<input type='checkbox' name='nfp_layer' value='1' />")."&nbsp;&nbsp;".NFPM_L11.": <input class='tbox' type='text' name='nfp_layer_height' size='8' value='".$pref['nfp_layer_height']."' maxlength='3' />
</td> </td>
</tr> </tr>
@@ -93,6 +88,6 @@ $text = "<div style='text-align:center'>
</form> </form>
</div>"; </div>";
$ns->tablerender(NFPM_L12, $text); $ns->tablerender(NFPM_L12, $text);
require_once(e_ADMIN."footer.php"); require_once (e_ADMIN."footer.php");
?> ?>

View File

@@ -1,4 +1,4 @@
<?php <?php
/* /*
* e107 website system * e107 website system
* *
@@ -9,29 +9,32 @@
* *
* *
* $Source: /cvs_backup/e107_0.8/e107_plugins/newforumposts_main/newforumposts_main.php,v $ * $Source: /cvs_backup/e107_0.8/e107_plugins/newforumposts_main/newforumposts_main.php,v $
* $Revision: 1.5 $ * $Revision: 1.6 $
* $Date: 2009-11-18 01:05:53 $ * $Date: 2009-11-19 09:52:35 $
* $Author: e107coders $ * $Author: marj_nl_fr $
*/ */
if (!defined('e107_INIT')) { exit; } if(!defined('e107_INIT')) { exit();}
require_once (e_HANDLER.'userclass_class.php');
$query = ($pref['nfp_posts'] ? 'thread_lastpost' : 'thread_datestamp');
include_lan(e_PLUGIN.'newforumposts_main/languages/'.e_LANGUAGE.'.php');
$path = e_PLUGIN.'forum/';
require_once(e_HANDLER."userclass_class.php");
$query = ($pref['nfp_posts'] ? "thread_lastpost" : "thread_datestamp");
$lan_file = e_PLUGIN."newforumposts_main/languages/".e_LANGUAGE.".php";
$path = e_PLUGIN."forum/";
include_once((file_exists($lan_file) ? $lan_file : e_PLUGIN."newforumposts_main/languages/English.php"));
global $sql, $ns; global $sql, $ns;
// get template ... // get template ...
if (file_exists(THEME."newforumpost.php")) { if(is_readable(THEME.'newforumpost.php'))
require_once(THEME."newforumpost.php"); {
require_once (THEME.'newforumpost.php');
} }
else if(!isset($NEWFORUMPOSTSTYLE_HEADER)) { elseif(!isset($NEWFORUMPOSTSTYLE_HEADER))
{
// no template found - use default ... // no template found - use default ...
$NEWFORUMPOSTSTYLE_HEADER = " $NEWFORUMPOSTSTYLE_HEADER = "
<!-- newforumposts --> <!-- newforumposts -->
<div style='text-align:center'>\n<table style='width:auto' class='fborder'> <div style='text-align:center'>
<table style='width:auto' class='fborder'>
<tr> <tr>
<td style='width:5%' class='forumheader'>&nbsp;</td> <td style='width:5%' class='forumheader'>&nbsp;</td>
<td style='width:45%' class='forumheader'>".NFPM_LAN_1."</td> <td style='width:45%' class='forumheader'>".NFPM_LAN_1."</td>
@@ -39,8 +42,8 @@ else if(!isset($NEWFORUMPOSTSTYLE_HEADER)) {
<td style='width:5%; text-align:center' class='forumheader'>".NFPM_LAN_3."</td> <td style='width:5%; text-align:center' class='forumheader'>".NFPM_LAN_3."</td>
<td style='width:5%; text-align:center' class='forumheader'>".NFPM_LAN_4."</td> <td style='width:5%; text-align:center' class='forumheader'>".NFPM_LAN_4."</td>
<td style='width:25%; text-align:center' class='forumheader'>".NFPM_LAN_5."</td> <td style='width:25%; text-align:center' class='forumheader'>".NFPM_LAN_5."</td>
</tr>\n"; </tr>";
$NEWFORUMPOSTSTYLE_MAIN = " $NEWFORUMPOSTSTYLE_MAIN = "
<tr> <tr>
<td style='width:5%; text-align:center' class='forumheader3'>{ICON}</td> <td style='width:5%; text-align:center' class='forumheader3'>{ICON}</td>
@@ -49,11 +52,17 @@ else if(!isset($NEWFORUMPOSTSTYLE_HEADER)) {
<td style='width:5%; text-align:center' class='forumheader3'>{VIEWS}</td> <td style='width:5%; text-align:center' class='forumheader3'>{VIEWS}</td>
<td style='width:5%; text-align:center' class='forumheader3'>{REPLIES}</td> <td style='width:5%; text-align:center' class='forumheader3'>{REPLIES}</td>
<td style='width:25%; text-align:center' class='forumheader3'>{LASTPOST}<br /><span class='smalltext'>{LASTPOSTDATE}&nbsp;</span></td> <td style='width:25%; text-align:center' class='forumheader3'>{LASTPOST}<br /><span class='smalltext'>{LASTPOSTDATE}&nbsp;</span></td>
</tr>\n"; </tr>";
$NEWFORUMPOSTSTYLE_FOOTER = "<tr>\n<td colspan='6' style='text-align:center' class='forumheader2'> $NEWFORUMPOSTSTYLE_FOOTER = "
<span class='smalltext'>".NFPM_LAN_6.": <b>{TOTAL_TOPICS}</b> | ".NFPM_LAN_4.": <b>{TOTAL_REPLIES}</b> | ".NFPM_LAN_3.": <b>{TOTAL_VIEWS}</b></span>\n</td>\n</tr>\n</table>\n</div>"; <tr>
<td colspan='6' style='text-align:center' class='forumheader2'>
<span class='smalltext'>".NFPM_LAN_6.": <b>{TOTAL_TOPICS}</b> | ".NFPM_LAN_4.": <b>{TOTAL_REPLIES}</b> | ".NFPM_LAN_3.": <b>{TOTAL_VIEWS}</b></span>
</td>
</tr>
</table>
</div>";
} }
$results = $sql->db_Select_gen(" $results = $sql->db_Select_gen("
@@ -69,17 +78,18 @@ ORDER BY t.$query DESC LIMIT 0, ".$pref['nfp_amount']);
$forumArray = $sql->db_getList(); $forumArray = $sql->db_getList();
if (!isset($gen) || !is_object($gen)) { if(!isset($gen) || !is_object($gen))
{
$gen = new convert; $gen = new convert;
} }
if (file_exists(THEME."forum/new_small.png")) if(is_readable(THEME."forum/new_small.png"))
{ {
$ICON = "<img src='".THEME."forum/new_small.png' alt='' />"; $ICON = "<img src='".THEME."forum/new_small.png' alt='' />";
} }
else else
{ {
$ICON = "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/new_small.png' alt='' />"; $ICON = "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/new_small.png' alt='' />";
} }
$TOTAL_TOPICS = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent='0' "); $TOTAL_TOPICS = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent='0' ");
$TOTAL_REPLIES = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent!='0' "); $TOTAL_REPLIES = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent!='0' ");
@@ -88,10 +98,10 @@ $tmp = $sql->db_Fetch();
$TOTAL_VIEWS = $tmp[0]; $TOTAL_VIEWS = $tmp[0];
$text = preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_HEADER); $text = preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_HEADER);
foreach($forumArray as $forumInfo) foreach ($forumArray as $forumInfo)
{ {
extract($forumInfo); extract($forumInfo);
$r_datestamp = $gen->convert_date($thread_lastpost, "forum"); $r_datestamp = $gen->convert_date($thread_lastpost, "forum");
if($thread_total_replies) if($thread_total_replies)
{ {
@@ -118,7 +128,7 @@ foreach($forumArray as $forumInfo)
$LASTPOST = " - "; $LASTPOST = " - ";
$LASTPOSTDATE = ""; $LASTPOSTDATE = "";
} }
$x = explode(chr(1), $thread_user); $x = explode(chr(1), $thread_user);
$tmp = explode(".", $x[0], 2); $tmp = explode(".", $x[0], 2);
if($user_name) if($user_name)
@@ -136,22 +146,21 @@ foreach($forumArray as $forumInfo)
$POSTER = NFPM_L16; $POSTER = NFPM_L16;
} }
} }
$THREAD = "<a href='".$path."forum_viewtopic.php?{$thread_id}.last'>$thread_name</a>"; $THREAD = "<a href='".$path."forum_viewtopic.php?{$thread_id}.last'>$thread_name</a>";
$FORUM = "<a href='".$path."forum_viewforum.php?{$forum_id}'>$forum_name</a>"; $FORUM = "<a href='".$path."forum_viewforum.php?{$forum_id}'>$forum_name</a>";
$VIEWS = $thread_views; $VIEWS = $thread_views;
$REPLIES = $thread_total_replies; $REPLIES = $thread_total_replies;
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_MAIN); $text .= preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_MAIN);
} }
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_FOOTER); $text .= preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_FOOTER);
$text = ($pref['nfp_layer'] ? "<div style='border : 0; padding : 4px; width : auto; height : ".$pref['nfp_layer_height']."px; overflow : auto; '>".$text."</div>" : $text); $text = ($pref['nfp_layer'] ? "<div style='border : 0; padding : 4px; width : auto; height : ".$pref['nfp_layer_height']."px; overflow : auto; '>".$text."</div>" : $text);
if ($results) if($results)
{ {
$ns->tablerender($pref['nfp_caption'], $text, "nfp"); $ns->tablerender($pref["nfp_caption"], $text, "nfp");
} }
?>