Example #1
0
function discuss($ID)
{
    global $comments_disabled_after;
    $preview = ps('preview');
    extract(safe_row("Annotate,AnnotateInvite,unix_timestamp(Posted) as uPosted", "textpattern", "ID='{$ID}'"));
    $darr = !$preview ? fetchComments($ID) : array(psas(array('name', 'email', 'web', 'message', 'parentid', 'remember')));
    $out = n . '<h3 style="margin-top:2em" id="comment">' . $AnnotateInvite . '</h3>' . n;
    if ($darr) {
        $out .= '<ol>' . n;
        $out .= formatComments($darr);
        $out .= n . '</ol>';
    }
    $wasAnnotated = !$Annotate ? getCount('txp_discuss', "parentid={$ID}") : '';
    if (!$Annotate) {
        $out .= graf(gTxt("comments_closed"));
    } else {
        if ($comments_disabled_after) {
            $lifespan = $comments_disabled_after * 86400;
            $timesince = time() - $uPosted;
            if ($lifespan > $timesince) {
                $out .= commentForm($ID);
            } else {
                $out .= graf(gTxt("comments_closed"));
            }
        } else {
            $out .= commentForm($ID);
        }
    }
    return $out;
}
Example #2
0
/**
 * displayComments($data)
 * Function that takes an array of comments and displays them in html
 * @param data - associative array of comments from the database
 */
function displayComments($data)
{
    date_default_timezone_set("America/New_York");
    OpenContent();
    ?>
	
	<div id="comments">
	<table width="100%">
		<tr>
			<td><h2>User Comments</h2></td>
			<td style="text-align:right"><a href="#add">Add Yours</a></td>
		</tr>
	</table>
	<ol class="comment_list parent">
	
	<?php 
    foreach ($data as $comment) {
        ?>
		<li id="comment-<?php 
        echo $comment['comment_id'];
        ?>
">
			<div class="comment_wrap">
	
				<div class="comment_author">
					<?php 
        if (!empty($comment['avatar'])) {
            echo "<img src=\"{$comment['avatar']}\" height=\"80px\" />";
        } else {
            echo "<img src=\"modules/news/images/avatar.png\" />";
        }
        ?>
					<p>
					<?php 
        if ($comment['author_id'] > 0) {
            echo "<a href=\"{$comment['author_id']}\">{$comment['author']}</a>";
        } else {
            echo "Guest";
        }
        ?>
						
						<span><?php 
        echo date('F jS', strtotime($comment['date']));
        ?>
</span> 
					</p>
				</div>
				
				<div class="single_comment">
					<img src="modules/news/images/comment_arrow.png" class="comment_arrow" />
					<p> <?php 
        echo bbcode_format($comment['message']);
        ?>
</p>
				
				</div>
				
			</div>		
		</li>	
		
	<?php 
    }
    echo "</ol>";
    commentForm();
    CloseContent();
}
Example #3
0
function comments_form($atts)
{
    global $thisarticle, $comment_preview, $pretext;
    extract(lAtts(array('id' => @$pretext['id'], 'class' => __FUNCTION__, 'form' => 'comment_form', 'wraptag' => ''), $atts));
    # don't display the comment form at the bottom, since it's
    # already shown at the top
    if (ps('preview') and empty($comment_preview)) {
        return '';
    }
    if (is_array($thisarticle)) {
        extract($thisarticle);
    }
    if (@$thisid) {
        $id = $thisid;
    }
    if ($id) {
        if (!checkCommentsAllowed($id)) {
            $out = graf(gTxt("comments_closed"));
        } elseif (gps('commented')) {
            $out = gTxt("comment_posted");
            if (@$GLOBALS['prefs']['comments_moderate']) {
                $out .= " " . gTxt("comment_moderated");
            }
            $out = graf($out, ' id="txpCommentInputForm"');
        } else {
            $out = commentForm($id, $atts);
        }
        return !$wraptag ? $out : doTag($out, $wraptag, $class);
    }
}
Example #4
0
function comments_form($atts)
{
    global $thisarticle, $has_comments_preview;
    extract(lAtts(array('class' => __FUNCTION__, 'form' => 'comment_form', 'isize' => '25', 'msgcols' => '25', 'msgrows' => '5', 'msgstyle' => '', 'show_preview' => empty($has_comments_preview), 'wraptag' => '', 'previewlabel' => gTxt('preview'), 'submitlabel' => gTxt('submit'), 'rememberlabel' => gTxt('remember'), 'forgetlabel' => gTxt('forget')), $atts));
    assert_article();
    extract($thisarticle);
    $out = '';
    $ip = serverset('REMOTE_ADDR');
    $blacklisted = is_blacklisted($ip);
    if (!checkCommentsAllowed($thisid)) {
        $out = graf(gTxt("comments_closed"), ' id="comments_closed"');
    } elseif (!checkBan($ip)) {
        $out = graf(gTxt('you_have_been_banned'), ' id="comments_banned"');
    } elseif ($blacklisted) {
        $out = graf(gTxt('your_ip_is_blacklisted_by' . ' ' . $blacklisted), ' id="comments_blacklisted"');
    } elseif (gps('commented') !== '') {
        $out = gTxt("comment_posted");
        if (gps('commented') === '0') {
            $out .= " " . gTxt("comment_moderated");
        }
        $out = graf($out, ' id="txpCommentInputForm"');
    } else {
        # display a comment preview if required
        if (ps('preview') and $show_preview) {
            $out = comments_preview(array());
        }
        $out .= commentForm($thisid, $atts);
    }
    return !$wraptag ? $out : doTag($out, $wraptag, $class);
}
Example #5
0
function comments_form($atts)
{
    global $thisarticle, $has_comments_preview, $pretext;
    extract(lAtts(array('class' => __FUNCTION__, 'form' => 'comment_form', 'id' => @$pretext['id'], 'isize' => '25', 'msgcols' => '25', 'msgrows' => '5', 'msgstyle' => '', 'show_preview' => empty($has_comments_preview), 'wraptag' => ''), $atts));
    assert_article();
    if (is_array($thisarticle)) {
        extract($thisarticle);
    }
    if (@$thisid) {
        $id = $thisid;
    }
    $out = '';
    if ($id) {
        if (!checkCommentsAllowed($id)) {
            $out = graf(gTxt("comments_closed"));
        } elseif (gps('commented') !== '') {
            $out = gTxt("comment_posted");
            if (gps('commented') === '0') {
                $out .= " " . gTxt("comment_moderated");
            }
            $out = graf($out, ' id="txpCommentInputForm"');
        } else {
            # display a comment preview if required
            if (ps('preview') and $show_preview) {
                $out = comments_preview(array());
            }
            $out .= commentForm($id, $atts);
        }
        return !$wraptag ? $out : doTag($out, $wraptag, $class);
    }
}
Example #6
0
$perm = validateUserQuiet('evals');
if ($name === false && $perm === false) {
    header("Location: {$FANNIE_URL}auth/ui/loginform.php?redirect={$FANNIE_URL}legacy/it/hours/eval/list.php");
    return;
} else {
    if ($perm === false) {
        echo "Error";
        return;
    }
}
if (isset($_REQUEST['getAddForm'])) {
    echo addForm();
    return;
} else {
    if (isset($_REQUEST['getCommentForm'])) {
        echo commentForm();
        return;
    } elseif (isset($_REQUEST['addEntry'])) {
        $db = hours_dbconnect();
        $empID = $_REQUEST['id'];
        $month = $_REQUEST['month'];
        $year = $_REQUEST['year'];
        $type = $_REQUEST['type'];
        $pos = mysql_real_escape_string($_REQUEST['pos']);
        $score = $_REQUEST['score'];
        $score = sprintf("%.2f", $score);
        $score = str_replace(".", "", $score);
        $q = $db->prepare("INSERT INTO evalScores (empID,evalType,evalScore,month,year,pos)\n        VALUES (?,?,?,?,?,?)");
        $r = $db->execute($q, array($empID, $type, $score, $month, $year, $pos));
        echo getHistory($empID);
        return;
Example #7
0
function showPic()
{
    global $db, $prefix, $iConfig, $moduleName, $user;
    $picturesPath = $iConfig['pictures_path'];
    $popCount = intval($iConfig['pop_count']);
    //$inlineJS = '';
    AddJSToHead('includes/jquery/jquery.js', 'file');
    AddJSToHead('modules/' . $moduleName . '/includes/jquery/jquery.MetaData.js', 'file');
    AddJSToHead('modules/' . $moduleName . '/includes/jquery/jquery.rating.js', 'file');
    AddCSSToHead('modules/' . $moduleName . '/includes/jquery/jquery.rating.css', 'file');
    //AddJSToHead( $inlineJS,'inline' );
    galleryHeader();
    echo '<div id="show-picture-wrapper">' . PHP_EOL;
    $pictureId = $_GET['pictureid'];
    $picture = $db->sql_fetchrow($db->sql_query('SELECT * FROM ' . $prefix . '_igallery_pictures WHERE picture_id=' . $pictureId . ' LIMIT 0,1'));
    $filename = $picture['picture_file'];
    $albumId = $picture['album_id'];
    $pictureTitle = $picture['picture_title'];
    $pictureType = $picture['picture_type'];
    $description = $picture['picture_desc'];
    $counter = $picture['picture_counter'];
    $dateAdded = $picture['picture_date'];
    $userId = $picture['picture_userid'];
    $album = $db->sql_fetchrow($db->sql_query('SELECT album_title, album_folder FROM ' . $prefix . '_igallery_albums WHERE album_id=\'' . $albumId . '\' LIMIT 0,1'));
    $albumTitle = $album['album_title'];
    $folderName = $album['album_folder'];
    showTopLinks($albumId, $pictureId);
    echo '<br /><br />' . PHP_EOL;
    picTopMenu($pictureId, $albumId);
    echo '<div id="show-pic">' . PHP_EOL;
    echo '	' . showNewEmblem($dateAdded) . showPopEmblem($counter, $popCount) . '<br />' . PHP_EOL;
    echo '	<img class="show-pic" src="modules.php?name=' . $moduleName . '&amp;op=getImg&amp;pictureid=' . $pictureId . '" alt="' . $filename . '" title="' . $pictureTitle . '" />' . PHP_EOL;
    echo '</div>' . PHP_EOL;
    echo '<div class="content-box"><b>' . $pictureTitle . '</b>: ' . $description . '</div>' . PHP_EOL;
    showDetails($pictureId);
    echo '<br />' . PHP_EOL;
    echo '<div id="comment-button"><button>' . _IG_POSTCOMMENT . '</button></div>' . PHP_EOL;
    commentForm($pictureId);
    echo '<script type="text/javascript">//<![CDATA[' . PHP_EOL;
    echo '	$("button").click(function () {' . PHP_EOL;
    echo '		$("#post-comment").show("slow");' . PHP_EOL;
    echo '	});' . PHP_EOL;
    echo '//]]></script>' . PHP_EOL;
    displayComments($pictureId);
    echo '</div>' . PHP_EOL;
    galleryFooter();
}