mirror of
https://github.com/e107inc/e107.git
synced 2025-07-30 19:30:25 +02:00
new module creation
This commit is contained in:
148
e107_files/shortcode/batch/comment_shortcodes.php
Normal file
148
e107_files/shortcode/batch/comment_shortcodes.php
Normal file
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| <20>Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/comment_shortcodes.php,v $
|
||||
| $Revision: 1.1.1.1 $
|
||||
| $Date: 2006-12-02 04:33:40 $
|
||||
| $Author: mcfly_e107 $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
include_once(e_HANDLER.'shortcode_handler.php');
|
||||
$comment_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
|
||||
/*
|
||||
|
||||
SC_BEGIN SUBJECT
|
||||
global $SUBJECT, $comrow, $pref, $NEWIMAGE, $tp;
|
||||
if (isset($pref['nested_comments']) && $pref['nested_comments']) {
|
||||
$SUBJECT = $NEWIMAGE." ".(empty($comrow['comment_subject']) ? $subject : $tp->toHTML($comrow['comment_subject'], TRUE));
|
||||
} else {
|
||||
$SUBJECT = '';
|
||||
}
|
||||
return $SUBJECT;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USERNAME
|
||||
global $USERNAME, $comrow;
|
||||
if (isset($comrow['user_id']) && $comrow['user_id']) {
|
||||
$USERNAME = "<a href='".e_BASE."user.php?id.".$comrow['user_id']."'>".$comrow['user_name']."</a>\n";
|
||||
}else{
|
||||
$comrow['user_id'] = 0;
|
||||
$USERNAME = preg_replace("/[0-9]+\./", '', $comrow['comment_author']);
|
||||
$USERNAME = str_replace("Anonymous", LAN_ANONYMOUS, $USERNAME);
|
||||
}
|
||||
return $USERNAME;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TIMEDATE
|
||||
global $TIMEDATE, $comrow, $datestamp, $gen;
|
||||
$datestamp = $gen->convert_date($comrow['comment_datestamp'], "short");
|
||||
return $datestamp;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN REPLY
|
||||
global $REPLY, $comrow, $action, $pref, $table, $id, $thisaction, $thistable, $thisid;
|
||||
$REPLY = '';
|
||||
if($comrow['comment_lock'] != "1"){
|
||||
if ($thisaction == "comment" && $pref['nested_comments']) {
|
||||
$REPLY = "<a href='".e_BASE."comment.php?reply.".$thistable.".".$comrow['comment_id'].".".$thisid."'>".COMLAN_326."</a>";
|
||||
}
|
||||
}
|
||||
return $REPLY;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN AVATAR
|
||||
global $AVATAR, $comrow;
|
||||
if (isset($comrow['user_id']) && $comrow['user_id']) {
|
||||
if (isset($comrow['user_image']) && $comrow['user_image']) {
|
||||
require_once(e_HANDLER."avatar_handler.php");
|
||||
$comrow['user_image'] = avatar($comrow['user_image']);
|
||||
$comrow['user_image'] = "<div class='spacer'><img src='".$comrow['user_image']."' alt='' /></div>";
|
||||
}else{
|
||||
$comrow['user_image'] = '';
|
||||
}
|
||||
}else{
|
||||
$comrow['user_image'] = '';
|
||||
}
|
||||
return $comrow['user_image'];
|
||||
SC_END
|
||||
|
||||
SC_BEGIN COMMENTS
|
||||
global $COMMENTS, $comrow;
|
||||
return (isset($comrow['user_id']) && $comrow['user_id'] ? COMLAN_99.": ".$comrow['user_comments'] : COMLAN_194)."<br />";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN JOINED
|
||||
global $JOINED, $comrow, $gen;
|
||||
$JOINED = '';
|
||||
if ($comrow['user_id'] && !$comrow['user_admin']) {
|
||||
$comrow['user_join'] = $gen->convert_date($comrow['user_join'], "short");
|
||||
$JOINED = ($comrow['user_join'] ? COMLAN_145." ".$comrow['user_join'] : '');
|
||||
}
|
||||
return $JOINED;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN COMMENT
|
||||
global $COMMENT, $comrow, $tp, $pref;
|
||||
return (isset($comrow['comment_blocked']) && $comrow['comment_blocked'] ? COMLAN_0 : $tp->toHTML($comrow['comment_comment'], TRUE, FALSE, $comrow['user_id']));
|
||||
SC_END
|
||||
|
||||
SC_BEGIN COMMENTEDIT
|
||||
global $COMMENTEDIT, $pref, $comrow;
|
||||
if ($pref['allowCommentEdit'] && USER && $comrow['user_id'] == USERID && $comrow['comment_lock'] != "1")
|
||||
{
|
||||
if (!strstr(e_QUERY, "."))
|
||||
{
|
||||
return "<a href='".e_SELF."?".e_QUERY."&comment=edit&comment_id=".$comrow['comment_id']."'><img src='".e_IMAGE."generic/".IMODE."/newsedit.png' alt='".COMLAN_318."' title='".COMLAN_318."' style='border: 0;' /></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "<a href='".e_SELF."?".e_QUERY.".edit.".$comrow['comment_id']."'><img src='".e_IMAGE."generic/".IMODE."/newsedit.png' alt='".COMLAN_318."' title='".COMLAN_318."' style='border: 0;' /></a>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN RATING
|
||||
global $RATING;
|
||||
return $RATING;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN IPADDRESS
|
||||
global $IPADDRESS, $comrow;
|
||||
require_once(e_HANDLER."encrypt_handler.php");
|
||||
return (ADMIN ? "<a href='".e_BASE."userposts.php?0.comments.".$comrow['comment_ip']."'>".COMLAN_330." ".decode_ip($comrow['comment_ip'])."</a>" : "");
|
||||
SC_END
|
||||
|
||||
SC_BEGIN LEVEL
|
||||
global $LEVEL, $comrow, $pref;
|
||||
$ldata = get_level($comrow['user_id'], $comrow['user_forums'], $comrow['user_comments'], $comrow['user_chats'], $comrow['user_visits'], $comrow['user_join'], $comrow['user_admin'], $comrow['user_perms'], $pref);
|
||||
return ($comrow['user_admin'] ? $ldata[0] : $ldata[1]);
|
||||
SC_END
|
||||
|
||||
SC_BEGIN LOCATION
|
||||
global $LOCATION, $comrow, $tp;
|
||||
return (isset($comrow['user_location']) && $comrow['user_location'] ? COMLAN_313.": ".$tp->toHTML($comrow['user_location'], TRUE) : '');
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNATURE
|
||||
global $SIGNATURE, $comrow, $tp;
|
||||
$SIGNATURE = (isset($comrow['user_signature']) && $comrow['user_signature'] ? $tp->toHTML($comrow['user_signature'], true) : '');
|
||||
return $SIGNATURE;
|
||||
SC_END
|
||||
|
||||
*/
|
||||
|
||||
?>
|
Reference in New Issue
Block a user