コード例 #1
0
function show()
{
    global $domain, $db, $seo_on, $usrdata, $entryid, $suserid, $template, $cachelife, $gamesfolder, $thumbsfolder, $directorypath, $ads1, $ads2, $ads3, $showblog, $showpages;
    // $r3 = $db->query(sprintf('SELECT * FROM fas_blogentries WHERE entryid=\'%u\'', $entryid));
    // $r4 = $db->fetch_row($r3);
    $r3 = "SELECT * FROM fas_blogentries WHERE entryid='{$entryid}'";
    $sqltitle = "blogentry-" . $entryid;
    $r1 = sqlcache($sqltitle, $cachelife, $r3);
    foreach ($r1 as $r4) {
        $title = $r4['title'];
        $body = $r4['body'];
        $author = $r4['author'];
        $entrydate = $r4['entrydate'];
        $visible = $r4['visible'];
        $category = $r4['category'];
        $tags = $r4['tags'];
    }
    $chr_limit = 120;
    $add = '...';
    $reg_exUrl = "/(http|https|ftp|ftps)\\:\\/\\/[a-zA-Z0-9\\-\\.]+\\.[a-zA-Z]{2,3}(\\/\\S*)?/";
    if (preg_match($reg_exUrl, $body, $url)) {
        $bodystring = preg_replace($reg_exUrl, "<a href='" . $url[0] . "'>{$url[0]}</a> ", $body);
    } else {
        $bodystring = $body;
    }
    //$bodystring = ereg_replace("!(http:/{2}[\w\.]{2,}[/\w\-\.\?\&\=\#]*)!e", "'<a href=\"\\1\" title=\"\\1\" target=\"_blank\">'.(strlen('\\1')>=$chr_limit ? substr('\\1',0,$chr_limit).'$add':'\\1').'</a>'", $bodystring);
    $bodystring = str_replace("[url]", "<a href='http://", $bodystring);
    $bodystring = str_replace("[urlmid]", "'>", $bodystring);
    $bodystring = str_replace("[/url]", "</a>", $bodystring);
    $bodystring = str_replace("[img]", "<img alt='' src='http://", $bodystring);
    $bodystring = str_replace("[/img]", "' />", $bodystring);
    $bodystring = str_replace("[b]", "<b>", $bodystring);
    $bodystring = str_replace("[/b]", "</b>", $bodystring);
    $bodystring = str_replace("[i]", "<i>", $bodystring);
    $bodystring = str_replace("[/i]", "</i>", $bodystring);
    $bodystring = str_replace("[u]", "<u>", $bodystring);
    $bodystring = str_replace("[/u]", "</u>", $bodystring);
    $bodystring = str_replace("\n", "<br />", $bodystring);
    $body = str_replace("[br]", "<br />", $bodystring);
    echo '<div id="container">
<div id="content-container">
<div id="side">';
    include "includes/blocks.php";
    echo '</div>

<div id="content">
<div class="content_nav">' . $title . ' - ' . $entrydate . '</div>';
    echo '<table width=\'100%\' border=\'0\' align=\'center\'>
      <tr>
		<td colspan=\'2\' class=\'content\'>' . $body . '</td>
	</tr>
      <tr>
		<td colspan=\'2\' class=\'content\'>Posted By: ' . $author . '</td>
	</tr>
      <tr>
		<td colspan=\'2\' class=\'content\'>Tags: ' . $tags . '</td>
	</tr>
';
    echo '</table>';
    echo '<div class="content_nav">Submit Comment</div>';
    echo '<table width=\'100%\' border=\'0\' align=\'center\'>
	<tr>
		<td colspan=\'2\' class=\'content\'>';
    if (!isset($suserid)) {
        echo 'You must be logged in to submit a comment</td></tr>';
    } else {
        if ($seo_on == 1) {
            $sublink = '' . $domain . '/blogentry/submitcomment/';
        } else {
            $sublink = '' . $domain . '/index.php?action=blogentry&cmd=submitcomment';
        }
        echo '     Comment Title:<br />
				<form action=\'' . $sublink . '\' method=\'post\'>
                        <input type=\'hidden\' name=\'entryid\' value=\'' . $entryid . '\' />

                        <input type=\'text\' size=\'40\' name=\'commenttitle\' /><p>Body of Comment:</p><br />
                        <small>(HTML and BBCode do not work.)</small><br />
				<textarea cols=\'35\' rows=\'5\' name=\'commentbody\'></textarea>
				<br />
				<input type=\'submit\' name=\'commentsubmit\' value=\'Add Comment\' />
				</form>



           </td>
	</tr>
                  ';
    }
    echo '</table>';
    listcomments();
}
コード例 #2
0
    function show()
    {
        global $domain, $db, $seo_on, $usrdata, $entryid, $suserid;
        // $r3 = $db->query(sprintf('SELECT * FROM fas_blogentries WHERE entryid=\'%u\'', $entryid));
        // $r4 = $db->fetch_row($r3);
        $r3 = "SELECT * FROM fas_blogentries WHERE entryid='{$entryid}'";
        $sqltitle = "blogenrty-" . $entryid;
        $r1 = sqlcache($sqltitle, $cachelife, $r3);
        foreach ($r1 as $r4) {
            $title = $r4['title'];
            $body = $r4['body'];
            $author = $r4['author'];
            $entrydate = $r4['entrydate'];
            $displaydate = date('d-m-Y', $entrydate);
            $visible = $r4['visible'];
            $category = $r4['category'];
            $tags = $r4['tags'];
        }
        $chr_limit = 120;
        $add = '...';
        $bodystring = preg_replace("!(http:/{2}[\\w\\.]{2,}[/\\w\\-\\.\\?\\&\\=\\#]*)!e", "'<a href=\"\\1\" title=\"\\1\" target=\"_blank\">'.(strlen('\\1')>={$chr_limit} ? substr('\\1',0,{$chr_limit}).'{$add}':'\\1').'</a>'", $bodystring);
        $bodystring = str_replace("[urlhead]", "<a href='http://", $body);
        $bodystring = str_replace("[urlmid]", "'>", $bodystring);
        $bodystring = str_replace("[urlend]", "</a>", $bodystring);
        $bodystring = str_replace("[imghead]", "<img src='http://", $bodystring);
        $bodystring = str_replace("[imgend]", "'>", $bodystring);
        $bodystring = str_replace("[bhead]", "<b>", $bodystring);
        $bodystring = str_replace("[bend]", "</b>", $bodystring);
        $bodystring = str_replace("[p]", "<p>", $bodystring);
        $bodystring = str_replace("\n\n", "<p>", $bodystring);
        $bodystring = str_replace("\n", "<br />", $bodystring);
        $body = str_replace("[br]", "<br>", $bodystring);
        echo '<table width=\'100%\' border=\'0\' align=\'center\'>
	<tr>
		<td colspan=\'2\' class=\'header\'>' . $title . ' - ' . $entrydate . '</td>
	</tr>
      <tr>
		<td colspan=\'2\' class=\'content\'>' . $body . '</td>
	</tr>
      <tr>
		<td colspan=\'2\' class=\'content\'>Posted By: ' . $author . '</td>
	</tr>
      <tr>
		<td colspan=\'2\' class=\'content\'>Tags: ' . $tags . '</td>
	</tr>
';
        echo "</table>";
        echo '<table width=\'100%\' border=\'0\' align=\'center\'>
	<tr>
		<td colspan=\'2\' class=\'header\'>Submit Comment</td>
	</tr>
	<tr>
		<td colspan=\'2\' class=\'content\'>';
        if (!isset($suserid)) {
            echo 'You must be logged in to submit a comment</td></tr>';
        } else {
            if ($seo_on == 1) {
                $sublink = '' . $domain . '/blogentry/submitcomment/';
            } else {
                $sublink = '' . $domain . '/index.php?action=blogentry&cmd=submitcomment';
            }
            echo '     Comment Title:<br>
				<form action=\'' . $sublink . '\' method=\'POST\'>
                        <input type=\'hidden\' name=\'entryid\' value=\'' . $entryid . '\'>
                        
                        <input type=\'text\' size=\'40\' name=\'commenttitle\'><p>Body of Comment:<br>
                        <small>(HTML and BBCode do not work.)</small><br>
				<textarea cols=\'35\' rows=\'5\' name=\'commentbody\'></textarea>
				<br>
				<input type=\'submit\' name=\'commentsubmit\' value=\'Add Comment\'>
				</form>



           </td>
	</tr>
                  ';
        }
        echo "</table>";
        listcomments();
    }