• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP bb2html函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中bb2html函数的典型用法代码示例。如果您正苦于以下问题:PHP bb2html函数的具体用法?PHP bb2html怎么用?PHP bb2html使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了bb2html函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: browse_motd

function browse_motd()
{
    global $output, $action_permission, $sql;
    valid_login($action_permission["insert"]);
    $motds = $sql["mgr"]->query("SELECT * FROM motd ORDER BY Priority ASC");
    $output .= '
        <table class="lined center">
          <tr>
            <th style="width: 1%;">' . lang("global", "delete_short") . '</th>
            <th style="width: 1%;">' . lang("global", "edit") . '</th>
            <th style="width: 1%;">' . lang("motd", "enabled") . '</th>
            <th style="width: 20%;">' . lang("motd", "message") . '</th>
            <th style="width: 1%;">' . lang("motd", "target") . '</th>
            <th style="width: 1%;">' . lang("motd", "min_sec_level") . '</th>
          </tr>';
    while ($motd = $sql["mgr"]->fetch_assoc($motds)) {
        if ($motd["Target"] != 0) {
            if ($core == 1) {
                $un_query = "SELECT login FROM accounts WHERE acct=" . $motd["Target"];
            } else {
                $un_query = "SELECT username AS login FROM account WHERE id=" . $motd["Target"];
            }
            $un_result = $sql["logon"]->query($un_query);
            $un = $sql["logon"]->fetch_assoc($un_result);
            $un = $un["login"];
        } else {
            $un = "-";
        }
        $output .= '
          <tr>
            <td>
              <a href="motd.php?action=delete_motd&amp;id=' . $motd["ID"] . '&amp;redirect=1"><img src="img/cross.png" alt="" /></a>
            </td>
            <td>
              <a href="motd.php?action=edit_motd&amp;id=' . $motd["ID"] . '&amp;redirect=1"><img src="img/edit.png" alt="" /></a>
            </td>
            <td>
              ' . ($motd["Enabled"] ? '<img src="img/up.gif" alt="" />' : '<img src="img/down.gif" alt="" />') . '
            </td>
            <td>
              ' . bb2html($motd["Message"]) . '
            </td>
            <td>
              ' . $un . '
            </td>
            <td>
              ' . gmlevel_name($motd["Min_Sec_Level"]) . '
            </td>
          </tr>';
    }
    $output .= '
        </table>
        <br />';
    makebutton(lang("motd", "add_motd"), 'motd.php?action=add_motd&amp;error=4&amp;redirect=1" type="def', 180);
    $output .= '
        <br />
        <br />';
}
开发者ID:GlassFace,项目名称:CoreManager2,代码行数:58,代码来源:motd.php


示例2: Frontend

 function Frontend($topic, $subtopic, $language, $filename, $QUERY_STRING)
 {
     global $db;
     $this->setVars($topic, $subtopic, $language, $filename, $QUERY_STRING);
     // content handle
     $row_lastcontent = mysql_fetch_row($this->result_lastcontent);
     $this->languageinfo_id = $row_lastcontent[0];
     $this->content_id = $row_lastcontent[1];
     $tmp = $this->info_id[content];
     $result_content = $db->sql("SELECT value FROM languageinfo WHERE languageinfo_id='{$this->languageinfo_id}' AND language_id='{$this->lang_id}' AND info_id = '{$tmp}'");
     $row_content = mysql_fetch_row($result_content);
     $this->maincontent = bb2html($row_content[0]);
     return true;
 }
开发者ID:artopantone,项目名称:anderssehnCMS,代码行数:14,代码来源:frontend.php


示例3: HTMLize

function HTMLize($no)
{
    global $ddir, $ext, $kdir, $kext;
    $log = file($ddir . $no . $ext);
    list($fname, $femail, $fdate, $fcom, $fsub) = explode(",", $log[0]);
    //親
    $fcom = bb2html($fcom);
    $kako = "<title>{$fsub}</title><body><dl><b><font size=+1 color=red>{$fsub}</font></b>";
    $kako .= "<dt>1 <font color=\"forestgreen\"><b>{$fname}</b></font> [ {$fdate} ]<dt><dd>{$fcom}<br><br><br>";
    for ($i = 2; $i < count($log) + 1; $i++) {
        list($name, $email, $date, $com) = explode(",", $log[$i - 1]);
        $com = bb2html($com);
        $kako .= "<dt>{$i} <font color=forestgreen><b>{$name}</b></font> [ {$date} ]<dd>{$com}<br><br>";
    }
    $kako .= "</dl><hr size=1></body>";
    $fp = fopen($kdir . $no . $kext, "w");
    fputs($fp, $kako);
    fclose($fp);
    echo "<a href=\"{$kdir}{$no}{$kext}\"> {$fsub} </a>HTML化完了<br>";
}
开发者ID:h16o2u9u,项目名称:rtoss,代码行数:20,代码来源:admin.php


示例4: bb2html

		</li><br>
		<?php 
    print bb2html($row['post_content']);
    ?>

<?php 
    if ($row['post_lastedit_user'] && $row['post_lastedit_date']) {
        $username = $db->query('select username from ' . $_CONF['dbprefix'] . 'users where user_id=' . getInt($row['post_lastedit_user']));
        $db->freeResult();
        $username = sanitizeHTML($username[0]['username']);
        $lastdate = @date('d M Y, h:i:s a', getInt($row['post_lastedit_date']));
        print '<br><br><span style="font-size: 10px">' . $_LANG['last_modify_by'] . ' <a href="' . BASEDIR . 'user/' . getInt($row['post_lastedit_user']) . '">' . $username . '</a> ' . '@ ' . $lastdate . '</span>';
    }
    if ($user[0]['user_signature']) {
        print '<br><br><div class="signatureHead"></div><div class="signature">' . bb2html($user[0]['user_signature']) . '</div>';
    }
    ?>

		</td>
	</tr>
<?php 
}
?>
		</table><br><br>

<?php 
if ($numPosts >= 10) {
    print '<center>';
    for ($i = 1; $i <= (int) ($numPosts / 10) + 1; $i++) {
        if ($i == $page) {
开发者ID:BlackLight,项目名称:nullBB,代码行数:30,代码来源:viewtopic.php


示例5: date

                                     <?php 
     echo "by <a href=\"/\" onClick=\"load('about=", $row["user_id"], "', '#content'); return false;\">", $row["username"], "</a> on ", date("F jS Y", $date_created);
     ?>
                                     <?php 
     if ($row["updated"]) {
         ?>
                                         <?php 
         echo "<i>(updated ", date("F jS Y", $date_updated), ")</i>";
         ?>
                                     <?php 
     }
     ?>
                                 </div>
                                 <div class="content">
                                     <?php 
     echo bb2html($row["content"]);
     ?>
                                 </div>
                             </div>
                         <?php 
 }
 ?>
                         <?php 
 $row = $result->fetch_assoc();
 ?>
                         <?php 
 if ($row && $i < 4) {
     ?>
                             <hr/>
                         <?php 
 }
开发者ID:ngpitt,项目名称:WRPI.FM,代码行数:31,代码来源:index.php


示例6: mail_send

function mail_send()
{
    global $ir, $c, $userid, $h;
    $sql = mysql_query("select max(userid) from users");
    $result = mysql_result($sql, $users);
    if ($_POST['userid'] > $result or $_POST['userid'] == 0) {
        print "Oh no, you're trying to mail a ghost.<br /><br />\n<a href='mailbox.php'>Back</a>";
        $h->endpage();
        exit;
    }
    if ($userid == $_POST['userid']) {
        print "Whats the point in mailing yourself ?<br /><br />\n<a href='mailbox.php'>Back</a>";
        $h->endpage();
        exit;
    }
    $subj = str_replace(array("\n"), array("<br />"), strip_tags($_POST['subject']));
    $msg = bb2html($_POST['message']);
    $codes = array(":)", ";)", ":o", ":D", ":s", ":(", ":red", ":clown", ":bashful", ":x", ":green", ":|", ";(", ":]", ":horny", ":cool");
    $images = array("<img src=smilies/smiley1.gif>", "<img src=smilies/smiley2.gif>", "<img src=smilies/smiley3.gif>", "<img\n\nsrc=smilies/smiley4.gif>", "<img src=smilies/smiley5.gif>", "<img src=smilies/smiley6.gif>", "<img\n\nsrc=smilies/smiley7.gif>", "<img src=smilies/smiley8.gif>", "<img src=smilies/smiley9.gif>", "<img\n\nsrc=smilies/smiley10.gif>", "<img src=smilies/smiley11.gif>", "<img src=smilies/smiley12.gif>", "<img\n\nsrc=smilies/smiley13.gif>", "<img src=smilies/smiley14.gif>", "<img src=smilies/smiley15.gif>", "<img src=smilies/smiley16.gif>");
    $newmsg = str_replace($codes, $images, $msg);
    $to = (int) $_POST['userid'];
    mysql_query("INSERT INTO mail VALUES ('',0,{$userid},{$to},unix_timestamp(),'{$subj}','{$newmsg}')", $c) or die(mysql_error());
    mysql_query("UPDATE users SET new_mail=new_mail+1 WHERE userid={$to}") or die(mysql_error());
    print "Message sent.<br /><br />\n<a href='mailbox.php'>Back</a>";
}
开发者ID:Rizwan1738,项目名称:Mafia-Game-Script,代码行数:25,代码来源:mailbox.php


示例7: show_error

 }
 $uid = $userdata['userid'];
 if (get_user_right($f_id) == 0) {
     show_error('ln_error_10', $modul_name);
     exit;
 }
 $topic_count = 1;
 $last_post_id = 0;
 $a_count = 0;
 $result = $db->query("SELECT * FROM cc" . $n . "_forum_posts where si_forum_id = '" . $f_id . "' and si_topic_id='" . $ft_id . "' ORDER BY si_post_time ASC");
 while ($row = $db->fetch_array($result)) {
     $post_name_t = $row['si_poster_name'];
     $post_new_id = $row['si_post_id'];
     $post_id_t = $row['si_poster_id'];
     $post_name = generate_userlink($post_id_t, $post_name_t);
     $post_text = bb2html($row['si_post_text']);
     $post_date_t = $row['si_post_time'];
     $post_date = date("d.m.Y, H:i", $post_date_t);
     if ($last_post_id < $post_new_id) {
         $last_post_id = $post_new_id;
     }
     if ($post_id_t == $userdata['userid']) {
         $post_edit_pic = "<a href=\"forum.php?action=edit&ft_id={$ft_id}&f_id={$f_id}&fp_id={$post_new_id}\"><img src=\"" . LITO_IMG_PATH_URL . $modul_name . "/edit.png\" title=\"Bearbeiten\" alt=\"Bearbeiten\" border=\"0\"></a>";
     } else {
         $post_edit_pic = "";
     }
     // l�schen
     $ali_admin = $userdata['isadmin'];
     if ($post_id_t == $userdata['userid'] || $ali_admin == 1) {
         $post_del_pic = "<a href=\"forum.php?action=delete&ft_id={$ft_id}&f_id={$f_id}&fp_id={$post_new_id}\"><img src=\"" . LITO_IMG_PATH_URL . $modul_name . "/del.png\" title=\"L�schen\" alt=\"L�schen\" border=\"0\"></a>";
     } else {
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:31,代码来源:forum.php


示例8: bb2html

    print " node-unpublished";
}
?>
">
	<?php 
if ($page == 0) {
    ?>
    	
		<?php 
    print $picture;
    ?>
        <h1 class="title"><a href="<?php 
    print $node_url;
    ?>
"><?php 
    print bb2html($title);
    ?>
</a></h1>
 
    <?php 
}
?>
      
      <?php 
if ($links) {
    ?>
    <div class="links">
        <?php 
    $totalComments = $node->comment_count;
    if ($totalComments == 1) {
        $commentText = "comment";
开发者ID:reflectiondigital,项目名称:Stresslesstests,代码行数:31,代码来源:node-blog.tpl.php


示例9: create_mail

    }
}
/* end function bb2html()
*/
/*
create_mail
a callback function for the email tag	*/
function create_mail($matches)
{
    $removers = array('"', '\\');
    // in case they add quotes
    $mail = str_replace($removers, '', $matches[1]);
    $mail = str_replace(' ', '%20', bbmashed_mail($mail));
    return '<a title="mail me!" href="' . $mail . '">' . $matches[2] . '</a>';
}
/*
create *my* email
a callback function for the mmail tag	*/
function create_mmail($matches)
{
    global $emailaddress;
    $removers = array('"', '\\');
    // in case they add quotes
    $mashed_address = str_replace($removers, '', $matches[1]);
    $mashed_address = bbmashed_mail($emailaddress . '?subject=' . $mashed_address);
    $mashed_address = str_replace(' ', '%20', $mashed_address);
    // hmmm
    return '<a class="cb-mail" title="mail me!" href="' . $mashed_address . '\\">' . $matches[2] . '<!--mail--></a>';
}
echo bb2html(file_get_contents("/dev/stdin"));
开发者ID:paragdiwan,项目名称:textmate-bundles,代码行数:30,代码来源:bbparser.php


示例10: VALUES

        }
        $db->query("INSERT INTO cc" . $n . "_messages (username,fromuserid,touserid,text,time,isnew,inbox,subject,pri) VALUES ('" . $userdata['username'] . "','" . $userdata['userid'] . "','" . $userid_c . "','" . mysql_real_escape_string($text) . "','" . time() . "','1','1','" . mysql_real_escape_string($subject) . "','" . $pri . "')");
    }
    header("LOCATION: message.php");
    exit;
}
if ($action == "lookup") {
    $pmid = intval($_GET['pmid']);
    $result = $db->query("SELECT * FROM cc" . $n . "_messages WHERE touserid='" . $userdata['userid'] . "' AND pmid='{$pmid}'");
    $row = $db->fetch_array($result);
    if ($row['pmid'] != $pmid) {
        show_error('ln_message_e_notfound', $modul_name);
        exit;
    }
    $db->query("UPDATE cc" . $n . "_messages SET isnew='0' WHERE pmid='{$pmid}' AND touserid='" . $userdata['userid'] . "' AND isnew='1'");
    $text = bb2html($row['text']);
    $row['subject'] = c_trim($row['subject']);
    $time = date("d.m.Y, H:i", $row['time']);
    $M_USER_ID = $row['fromuserid'];
    $M_USER_NAME = $row['username'];
    if ($op_use_badwords == 1) {
        $result_bad = $db->query("select badword from cc" . $n . "_badwords where in_mail ='1'");
        while ($row_bad = $db->fetch_array($result_bad)) {
            $text = str_replace($row_bad['badword'], "**ZENSIERT**", $text);
        }
    }
    $tpl->assign('M_USER_ID', $M_USER_ID);
    $tpl->assign('M_USER_NAME', $M_USER_NAME);
    $tpl->assign('M_SUBJECT', $row['subject']);
    $tpl->assign('M_TEXT', $text);
    $tpl->assign('M_ID', $row['pmid']);
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:31,代码来源:message.php


示例11: bb2html

    print $mission;
    ?>
</div>
                            <?php 
}
?>
                                        
                            <?php 
if ($tabs) {
    print '<div id="tabs-wrapper" class="clear-block">';
}
?>
                            <?php 
if ($title) {
    print '
                                <h1' . ($tabs ? ' class="with-tabs title"' : '') . '>' . bb2html($title) . '</h1>
                            ';
}
?>
                            <?php 
if ($tabs) {
    print '<ul class="tabs primary">' . $tabs . '</ul></div>';
}
?>
                            <?php 
if ($tabs2) {
    print '<ul class="tabs secondary">' . $tabs2 . '</ul>';
}
?>
                                             
                            <?php 
开发者ID:reflectiondigital,项目名称:Stresslesstests,代码行数:31,代码来源:page.tpl.php


示例12: parseObjects

/**
 * Fetches the objects given in $result
 * @param $result
 * @return array
 */
function parseObjects($result, $username = null)
{
    global $db;
    $objects = array();
    while ($row = $db->fetchAssoc($result)) {
        $row['description'] = bb2html(nl2br(str_replace("\\n", "\n", $row['description'])));
        //Fetch latest bid
        $bidResult = $db->buildQuery("SELECT TOP 1 * FROM bids WHERE objectid=%d ORDER BY bidvalue DESC", $row['id']);
        if ($db->getHasRows($bidResult)) {
            $res = $db->fetchAssoc($bidResult);
            $row['currentBid'] = $res['bidvalue'];
            $row['currentBidName'] = $res['username'];
        } else {
            $row['currentBid'] = $row['start_bid'];
        }
        $imageResult = $db->buildQuery("SELECT TOP 1 filename FROM files WHERE objectid=%d", $row['id']);
        if ($db->getHasRows($imageResult)) {
            if ($row['city'] == 'batch') {
                $row['image'] = "http://iproject2.icasites.nl/pics/" . $db->fetchAssoc($imageResult)['filename'];
            } else {
                $row['image'] = baseurl("upload/" . $db->fetchAssoc($imageResult)['filename']);
            }
        } else {
            $row['image'] = "https://placehold.it/150x110";
        }
        if ($username != null) {
            $ownBidResult = $db->buildQuery("SELECT TOP 1 bidvalue FROM bids WHERE username =%s AND objectid=%d ORDER BY bidvalue DESC", $username, $row['id']);
            $row['ownBid'] = $db->fetchAssoc($ownBidResult)['bidvalue'];
        }
        $row['timeRemaining'] = $row['end_moment']->getTimeStamp() - time();
        $objects[] = $row;
    }
    return $objects;
}
开发者ID:K-4U,项目名称:Pr-IP-P2-02,代码行数:39,代码来源:functions.php


示例13: lang

//  keep html indent in sync, so debuging from browser source would be easy to read
$output .= '
        <div class="bubble">
          <!-- start of error.php -->
          <div class="center_text">
            <br />
            <table id="error_message_table" class="flat center">
              <tr>
                <td align="center">
                  <h1>
                    <span class="error">
                      <img src="img/warn_red.gif" width="48" height="48" alt="error" />
                      <br />' . lang("error", "error") . '!
                    </span>
                  </h1>
                  <br />' . bb2html($err) . '<br />
                </td>
              </tr>
            </table>
            <br />
            <table id="error_buttons" class="hidden center">
              <tr>
                <td align="center">';
makebutton(lang("global", "home"), 'index.php', 130);
makebutton(lang("global", "back"), 'javascript:window.history.back()', 130);
unset($err);
$output .= '
                </td>
              </tr>
            </table>
            <br />
开发者ID:GlassFace,项目名称:CoreManager2,代码行数:31,代码来源:error.php


示例14: header

    header("LOCATION: alliance.php?action=change_forum");
    exit;
}
if ($action == "get_info") {
    $id = intval($_GET['id']);
    if (!$id) {
        show_error('ln_allianz_e_4', $modul_name);
        exit;
    }
    $result = $db->query("SELECT * FROM cc" . $n . "_allianz WHERE aid='{$id}'");
    $row = $db->fetch_array($result);
    $banner = trim($row['imageurl']);
    if ($banner == "") {
        $banner = LITO_IMG_PATH_URL . $modul_name . "/no_ali_banner.png";
    }
    $description = bb2html($row['text_long']);
    $ibit = "";
    $result = $db->query("SELECT userid,username,is_ali_admin,status FROM cc" . $n . "_users WHERE allianzid='{$id}' ORDER BY is_ali_admin DESC");
    while ($i = $db->fetch_array($result)) {
        $ibit .= generate_messagelink_smal($i[username]) . " " . generate_userlink($i[userid], $i[username]);
        if ($i['is_ali_admin'] == 1) {
            $ibit .= " (Leiter)";
        }
        $ibit .= " {$img}<br>";
    }
    $is_in_ali = 0;
    if (intval($userdata['allianzid']) > 0) {
        $is_in_ali = 1;
    }
    $tpl->assign('is_in_ali', $is_in_ali);
    $tpl->assign('banner', $banner);
开发者ID:Wehmeyer,项目名称:Litotex-0.7,代码行数:31,代码来源:alliance.php


示例15: getInt

        die;
    }
    $db->query('delete from ' . $_CONF['dbprefix'] . 'privmsgs where privmsg_id=' . getInt($_GET['msg_id']) . ' ' . 'and privmsg_to=' . getInt($userinfo['user_id']));
    require_once ABSOLUTE_BASEPATH . '/header.' . PHPEXT;
    notification($_LANG['delete_privmsg_ok'], $_SERVER['HTTP_REFERER'], 3);
    die;
}
$db = new nullBB_Database($_CONF, $_LANG);
$res = $db->query('select * from ' . $_CONF['dbprefix'] . 'privmsgs ' . "where privmsg_id=" . getInt($_GET['msg_id']) . " and privmsg_to=" . getInt($userinfo['user_id']));
$db->freeResult();
if (empty($res)) {
    print $_LANG['privmsg_not_found'];
    die;
}
$res = $res[0];
if ($res['privmsg_seen'] == false) {
    $db->query('update ' . $_CONF['dbprefix'] . 'privmsgs set privmsg_seen=1 ' . 'where privmsg_id=' . getInt($_GET['msg_id']) . ' and privmsg_to=' . getInt($userinfo['user_id']));
}
$from = $db->query('select username from ' . $_CONF['dbprefix'] . 'users where user_id=' . getInt($res['privmsg_from']));
$db->freeResult();
$from = sanitizeHTML($from[0]['username']);
$to = sanitizeHTML($userinfo['username']);
$content = bb2html($res['privmsg_content']);
print '<li class="privmsgHead">' . $_LANG['from'] . ': ' . '<a href="' . BASEDIR . 'user/' . getInt($res['privmsg_from']) . '">' . $from . "</a></li>\n";
print '<li class="privmsgHead">' . $_LANG['to'] . ': ' . '<a href="' . BASEDIR . 'user/' . getInt($res['privmsg_to']) . '">' . $to . "</a></li><br>\n";
print '<div class="privmsgContent">' . $content . "</div><br>\n";
unset($res);
$db->close();
?>

开发者ID:BlackLight,项目名称:nullBB,代码行数:29,代码来源:privmsgbyid.php


示例16: bb2html

    </div>
  <!-- end #header --></div>
  
  <?php 
include "sidebar.php";
?>

  <div id="mainContent">
    <h1 class="mainh1"> <?php 
if (isset($_GET['snip'])) {
    echo $_GET['snip'];
}
?>
 </h1>
    <p><?php 
echo bb2html($row_Snippet['description']);
?>
</p>
    <div class="code" id="code">
	  	<?php 
$geshi = new GeSHi($row_Snippet['code'], 'lua');
$geshi->enable_classes();
$geshi->set_header_type(GESHI_HEADER_PRE);
$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
echo $geshi->parse_code();
?>
     </div>
     <img src="/lovesnips/image/pencil.png" /><?php 
echo $row_Snippet['contributor'];
?>
<br />
开发者ID:perky,项目名称:Lovesnips,代码行数:31,代码来源:viewsnip.php


示例17: list

    }
    list($name, $email, $date, $com) = explode(",", $log[$i - 1]);
    if ($taborn > 1 && $date == $aborn) {
        $show = false;
    }
    if ($taborn > 0 && $date == $aborn && trim($com) == $aborn) {
        $show = false;
    }
    if (isset($_GET['ua']) && $_GET['ua'] == 'i' && function_exists("mb_convert_encoding")) {
        $name = mb_convert_encoding($name, "SJIS", "UTF-8");
        $com = mb_convert_encoding($com, "SJIS", "UTF-8");
        $email = mb_convert_encoding($email, "SJIS", "UTF-8");
        $date = mb_convert_encoding($date, "SJIS", "UTF-8");
        $sub = mb_convert_encoding($sub, "SJIS", "UTF-8");
    }
    $com = bb2html($com);
    $r = compact('name', 'email', 'date', 'com', 'show');
    $r['num'] = $i;
    $arg['res'][] = $r;
}
$arg['num'] = $i;
$arg['read_def'] = $read_def;
// 改ページ処理
if ($line > 1 && $i < $line) {
    $arg['next'] = $i + $read_def;
}
if ($st > 2) {
    $arg['prev_st'] = $i - $read_def - $read_def;
    if ($arg['prev_st'] < 0) {
        $arg['prev_st'] = "";
    }
开发者ID:h16o2u9u,项目名称:rtoss,代码行数:31,代码来源:read.php


示例18: uniqid

}
// Process the new post form
if (isset($_POST["new_post"]) && isset($_POST["title"]) && isset($_POST["content"]) && isset($_SESSION["logged_in"]) && $_SESSION["edit"]) {
    // Create the new post
    $post_id = uniqid();
    $_SERVER["mysqli"]->query("INSERT INTO posts SET post_id = '{$post_id}', user_id = '{$_SESSION["user_id"]}', date_created = CURRENT_TIMESTAMP, title = '{$_POST["title"]}', content = '{$_POST["content"]}'");
    // Get the post
    $result = $_SERVER["mysqli"]->query("SELECT * FROM posts INNER JOIN users ON posts.user_id = users.user_id WHERE posts.post_id = '{$post_id}'");
    $row = $result->fetch_assoc();
    $date_created = strtotime($row["date_created"]);
    // Create the new post email
    $headers = "From: {$_SERVER["site"]["title"]} <do-not-reply@{$_SERVER["site"]["domain"]}>\r\nMIME-Version: 1.0\r\nContent-type: text/html; charset=utf-8\r\n";
    $subject = $row["title"];
    $date_created = date("F jS Y", $date_created);
    // Convert BB formatting to HTML formatting
    $row["content"] = bb2html($row["content"]);
    $body = "<html>\n    <head>\n        <title>{$_SERVER["site"]["title"]} - {$_SERVER["site"]["description"]}</title>\n    </head>\n    <body style=\"background-color: {$_SERVER["style"]["background_color"]}; color: {$_SERVER["style"]["font_color"]}; font-family: Tahoma, Sans-serif; font-size: 0.75em; padding-top: 20px; padding-bottom: 20px; text-align: center;\">\n        <div style=\"background-color: {$_SERVER["style"]["foreground_color"]}; margin: auto; width: 80%; text-align: left; word-wrap: break-word;\">\n            <div style=\"padding: 10px;\">\n                <div style=\"font-size: 1.2em; font-weight: bold; margin-bottom: 2px;\">\n                    {$row["title"]}\n                </div>\n                <div>\n                    by <a style=\"color: {$_SERVER["style"]["link_color"]};\" href=\"{$_SERVER["site"]["url"]}#about={$_SESSION["user_id"]}\">{$row["username"]}</a> on {$date_created}\n                </div>\n                <div style=\"margin-top: 10px;\">\n                    {$row["content"]}\n                </div>\n            </div>\n        </div>\n    </body>\n</html>";
    // Send the email to subscribed users
    $result = $_SERVER["mysqli"]->query("SELECT * FROM users WHERE subscribe = 1");
    while ($row = $result->fetch_assoc()) {
        mail($row["email"], $subject, $body, $headers);
    }
    exit("0");
}
// Generate RSS feeds
if (isset($_GET["rss"])) {
    // Set the content type to RSS
    header("Content-Type: application/rss+xml; charset=utf-8");
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\">\n    <channel>\n";
    // Get the site publication date
    $pub_date = filemtime($_SERVER["DOCUMENT_ROOT"] . $_SERVER["PHP_SELF"]);
开发者ID:ngpitt,项目名称:WRPI.FM,代码行数:31,代码来源:server.php


示例19: thread

function thread($id)
{
    global $arg, $id, $ddir, $ext;
    if (!file_exists($ddir . $id . $ext)) {
        error("Thread Not Found !!");
    }
    $lines = file($ddir . $id . $ext);
    $size = count($lines);
    list(, , , $des, $title) = explode(",", $lines[0]);
    $lines = array_reverse($lines);
    $ch_title = trim($title);
    $ch_link = FULL_PATH . "read.php/" . $id . "/l50";
    $ch_desc = strip_tags(bb2html($des));
    $rss .= <<<RSS_HEAD
<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet href="rss2.xsl" type="text/xsl" media="screen"?>
<rss version="2.0">
 <channel>
   <title>{$ch_title}</title>
   <link>{$ch_link}</link>
   <description>{$ch_desc}</description>
   <language>ja</language>

RSS_HEAD;
    for ($i = 0; $i < _RSS_MAX_; $i++) {
        if ($lines[$i] == "") {
            break;
        }
        list($name, $email, $date, $com) = explode(",", $lines[$i]);
        $com = bb2html($com);
        $com = strip_tags($com);
        $name = strip_tags($name);
        $no = $size - $i;
        if ($date != $abone && $date != $st_date) {
            $pos = strpos($date, "ID:");
            if ($pos !== false) {
                $date = substr($date, 0, $pos);
            }
            if (version_compare("5.0.0", PHP_VERSION) < 1) {
                $date = preg_replace('/\\(.*\\)/', '', $date);
            }
            $date = strtotime(trim($date));
            $pubdate = date("r", $date);
        } else {
            $pubdate = date("r");
        }
        $title = $name;
        $link = FULL_PATH . "read.php/" . $id . "/" . $no . "n";
        $desc = $com;
        $rss .= <<<ITEM
   <item>
\t<title>{$title}</title>
\t<link>{$link}</link>
\t<description>{$desc}</description>
\t<pubDate>{$pubdate}</pubDate>
   </item>

ITEM;
    }
    $rss .= <<<RSS_FOOT
  </channel>
</rss>
RSS_FOOT;
    header('Content-Type: text/xml; charset=utf-8');
    echo $rss;
    //	print(mb_convert_encoding($rss, "UTF-8", "SJIS"));
}
开发者ID:h16o2u9u,项目名称:rtoss,代码行数:67,代码来源:backend.php


示例20: del

function del()
{
    extract($GLOBALS);
    $log_file = $ddir . $key . $ext;
    $cgi_file = $ddir . $key . $ext_cgi;
    $log = @file($log_file);
    //ログを配列にぶちこむ
    $log_cgi = @file($cgi_file);
    if (!$log) {
        d_error("スレッドが無いよう");
    }
    $line = sizeof($log);
    //ログの行数
    $del_no -= 1;
    if ($log[$del_no] == "") {
        d_error("そんな記事ないよ(´・ω・`)");
    }
    if ($line != count($log_cgi)) {
        d_error("DEBUG:ログの行数は不一致です。");
    }
    list($dname, $demail, $dnow, $dcom, ) = explode(",", $log[$del_no]);
    list(, , , , , , $pass) = explode(",", $log_cgi[$del_no]);
    if ($delpwd != $ad_pass) {
        if (trim($pass) == "") {
            d_error("パスワードがありません。");
        }
        if ($pass != substr(md5($delpwd), 2, 8)) {
            d_error("パスワードが違うみたい。。。");
        }
    }
    $log[$del_no] = "{$aborn},,{$aborn},[i]この記事は投稿者によって削除されました[/i],\n";
    if (!is_writable($log_file)) {
        d_error("削除できない。。。");
    }
    $re = @fopen($log_file, "w") or d_error("削除できない。。。");
    flock($re, 2);
    reset($log);
    fputs($re, implode('', $log));
    fclose($re);
    $com = bb2html($com);
    include_once "index.inc";
    head();
    ?>
<p>以下の記事を削除しました。たぶん。</p>
<table>
<tr><td>名前</td><td><?php 
    echo $dname;
    ?>
</td></tr>
<tr><td>日付</td><td><?php 
    echo $ddate;
    ?>
</td></tr>
<tr><td>記事</td><td><?php 
    echo $dcom;
    ?>
</td></tr>
</table>
<p><b><a href="<?php 
    echo $dir_path;
    ?>
index.html">掲示板に戻る</a></b></p>
<?php 
    foot();
}
开发者ID:h16o2u9u,项目名称:rtoss,代码行数:65,代码来源:usr_del.php



注:本文中的bb2html函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP bb_admin_notice函数代码示例发布时间:2022-05-24
下一篇:
PHP bb2diaspora函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap