예제 #1
0
 public function createdb()
 {
     if (!$this->dropdb()) {
         return false;
     }
     if (!$this->db->query(repository::sql())) {
         return false;
     }
     if (!$this->db->query(package::sql())) {
         return false;
     }
     if (!$this->db->query(filelist::sql())) {
         return false;
     }
     if (!$this->db->query(guestbook::sql())) {
         return false;
     }
     if (!$this->db->query("\n\t\t  CREATE TABLE IF NOT EXISTS #__mixed (\n\t\t    field VARCHAR( 255 ) NOT NULL ,\n                    value VARCHAR( 255 ) NULL ,\n                    PRIMARY KEY ( field )\n\t\t  ) ENGINE = MyISAM;\n\t\t")) {
         return false;
     }
     if (!$this->db->query("\n\t\t  CREATE TABLE IF NOT EXISTS #__searches (\n\t\t    dt    DATETIME,\n\t\t    sname VARCHAR(50),\n\t\t    sdesc VARCHAR(50),\n\t\t    sfile VARCHAR(50),\n\t\t    ip    VARCHAR(15),\n\t\t    srepo INT,\n\t\t    results INT,\n\t\t    duration INT\n\t\t  ) ENGINE = MyISAM;\n\t        ")) {
         return false;
     }
     $this->db->query("INSERT INTO #__mixed (field,value) value ('count_visits','1');");
     $this->db->query("INSERT INTO #__mixed (field,value) value ('count_searches','1');");
     $this->db->query("INSERT INTO #__mixed (field,value) value ('count_srctxt','1');");
     $this->db->query("INSERT INTO #__mixed (field,value) value ('count_srcxml','1');");
     return true;
 }
/**
 * Profile guestbook hook for phpBB.
 *
 * @author Paul Sohier <*****@*****.**>
 * @param phpbb_hook $hook
 * @return void
 */
function hook_profile_guestbook(&$hook)
{
    global $template, $user;
    // Make sure we only run this hook once, else we get the most weird errors :).
    if (defined('HOOK_RUNNED')) {
        return;
    }
    define('HOOK_RUNNED', true);
    global $phpbb_root_path, $phpEx;
    if (!class_exists('guestbook')) {
        include "{$phpbb_root_path}includes/class_guestbook.{$phpEx}";
    }
    if (!defined('GUESTBOOK_TABLE')) {
        include "{$phpbb_root_path}includes/constants_guestbook.{$phpEx}";
    }
    $gb = new guestbook();
    $gb->run();
}
예제 #3
0
 function display_entries()
 {
     global $GB_PG, $ModName;
     include_once LAZ_INCLUDE_PATH . '/lib/gb.class.php';
     $gb = new guestbook(LAZ_INCLUDE_PATH);
     $GB_PG['base_url'] = $gb->db->VARS['base_url'];
     $GB_PG['index'] = $gb->db->VARS['laz_url'] . '&amp;op=modload&amp;file=index';
     $GB_PG['admin'] = $gb->db->VARS['base_url'] . '/admin.php';
     $GB_PG['comment'] = $gb->db->VARS['laz_url'] . '&amp;op=modload&amp;file=index&amp;agbook=comment';
     $GB_PG['addentry'] = $gb->db->VARS['laz_url'] . '&amp;op=modload&amp;file=index&amp;agbook=addentry';
     $entry = isset($_GET['entry']) ? $_GET['entry'] : 0;
     $entry = isset($_POST['entry']) ? $_POST['entry'] : $entry;
     $entry = intval($entry) < 0 ? 0 : intval($entry);
     $gb->searchfield = isset($_GET['searchfield']) ? trim($_GET['searchfield']) : '';
     $gb->searchtext = isset($_GET['searchtext']) ? trim(urldecode($_GET['searchtext'])) : '';
     $gb->searchfield = isset($_POST['searchfield']) ? trim($_POST['searchfield']) : $gb->searchfield;
     $gb->searchtext = isset($_POST['searchtext']) ? trim(urldecode($_POST['searchtext'])) : $gb->searchtext;
     echo $gb->show_entries($entry);
     $gb->db->close_db();
 }
예제 #4
0
 public static function getInstance() {
     if (!self::$me) {
         $class=new guestbook();
         self::$me=$class;
     }
     return self::$me;
 }
예제 #5
0
				<div class="c_item">
					<div class="c_head"><strong>Администратор:</strong> <span class="c_info"><?php 
        echo system::show_data($obj->updated_at);
        ?>
</span></div>
					<div class="c_content"><?php 
        echo $obj->answer;
        ?>
</div>
				</div>
				<?php 
    }
    ?>

			</div>			
						
	<?php 
}
?>
	
		</div>	
	
	<?php 
// pager
echo guestbook::count_guestbook() > GUESTBOOK_AT_PAGE ? pager::pager_J("guestbook", GUESTBOOK_AT_PAGE, guestbook::count_guestbook(), intval($_GET['page'])) : '';
?>
	
	
	<?php 
// добавление отзыва
echo system::show_tpl(array(), '/frontend/guestbook/add.php');
예제 #6
0
                $gb_post->preview = isset($_POST["gb_preview"]) ? 1 : 0;
                $gb_post->private = isset($_POST["gb_private"]) ? 1 : 0;
                $gb_post->token = isset($_POST["gb_token"]) ? $_POST["gb_token"] : '';
                $gb_post->gb_captcha = isset($_POST["gb_captcha"]) ? $_POST["gb_captcha"] : '';
                echo $gb_post->process($_POST["gb_action"]);
            } else {
                echo $gb_post->process();
            }
            $gb_post->db->close_db();
            break;
        default:
            require_once $include_path . "/lib/vars.class.php";
            require_once $include_path . "/lib/gb.class.php";
            $gb = new guestbook($include_path);
            $entry = isset($_GET["entry"]) ? $_GET["entry"] : 0;
            $entry = isset($_POST["entry"]) ? $_POST["entry"] : $entry;
            echo $gb->show_entries(intval($entry));
            $gb->db->close_db();
    }
    ob_end_flush();
    $base_path = dirname(dirname($include_path));
    chdir("{$base_path}");
    include "{$base_path}/footer.php";
} else {
    require_once $include_path . "/lib/vars.class.php";
    require_once $include_path . "/lib/gb.class.php";
    $gb = new guestbook($include_path);
    $entry = isset($_GET["entry"]) ? $_GET["entry"] : 0;
    $entry = isset($_POST["entry"]) ? $_POST["entry"] : $entry;
    echo $gb->show_entries(intval($entry));
}
예제 #7
0
    <script>
    var wait=document.getElementById('wait1');
    wait.style.color="white";
    var wait=document.getElementById('wait2');
    wait.style.color="white";
    </script>
    <?php 
}
if ($newsearch) {
    $db->addsearch($_SERVER["REMOTE_ADDR"], $name, $desc, $file, $repo, time(), $nres, $duration);
}
if (!($name or $desc or $file)) {
    echo "<br><table width=100% style='border-top:1px dotted #000000;border-bottom:1px dotted #000000;'>";
    echo "<tr>";
    echo "<td width='50%'>";
    $gb = new guestbook();
    echo "<a href='gb.php'>Guest Book</a>: you can <a href='gb.php'>post comments</a>, suggests, bug/repository reports, or just your signature.<br><br>";
    $mm = 5;
    echo tables(array("", "", ""), 1, " class='gb' ");
    echo tables(array("Date", "Nick", "Message"), 1, " class='gb' ");
    while ($message = $gb->fetch() and $mm-- > 0) {
        echo tables(array("<sup>{$message['date']}</sup>", "<font color='red'>" . $message['nick'] . "</font> ", "" . $message['message']));
    }
    echo tables();
    echo "<a href='gb.php'>show all</a>";
    echo "<nobr><form action='gb.php' method='post'><br>Nick: ";
    echo "<input name=nick size=10 maxlenght=15 ";
    if (isset($_SESSION['slakhomelinuxguestbooknick'])) {
        echo "value='{$_SESSION['slakhomelinuxguestbooknick']}'";
    }
    echo "> -message: <br>";
예제 #8
0
 ***************************************************************************************/
global $_str;
// check for crack!
if (isset($_GET['page'])) {
    system::count_parametr(4);
    system::isset_numeric($_GET['page']);
} else {
    system::count_parametr(3);
    $_GET['page'] = 1;
}
// добавление новости
if (system::IsPost()) {
    if (!captcha::check_captcha()) {
        //выводим сообщение
        Message::GetMessage(0, v::getI18n('message_error_captcha'));
    } else {
        // пишем в базу
        Forms::MultyInsertForm('guestbook', 0);
        // очищаем POST
        unset($_POST);
        // выводим мообщение
        Message::GetMessage(1, v::getI18n('message_add_comment_to_guestbook'));
    }
}
// check for count gallery at page
guestbook::count_guestbook_at_page();
// get limit
$limit = pager::pager_limit(guestbook::count_guestbook(), GUESTBOOK_AT_PAGE);
// выводим
$_str .= guestbook::get_guestbook($limit, '/frontend/guestbook/list.php');
$_str = array('_str' => $_str, 'title' => $title->get_title(), 'keywords' => $title->get_keywords(), 'description' => $title->get_description(), 'h1' => $title->get_h1());
예제 #9
0
<?php

$moduleid = 3;
require 'common.inc.php';
$need_captcha = $MOD['guestbook_captcha'] ? 1 : 0;
if (isset($_POST['ok'])) {
    $captcha = isset($captcha) ? convert(input_trim($captcha), 'UTF-8', DT_CHARSET) : '';
    $msg = captcha($captcha, $need_captcha, true);
    if ($msg) {
        exit('captcha');
    }
    $TYPE = explode('|', trim($MOD['guestbook_type']));
    require DT_ROOT . '/include/post.func.php';
    require DT_ROOT . '/module/extend/guestbook.class.php';
    $do = new guestbook();
    $post = array();
    $content = convert($content, 'UTF-8', DT_CHARSET);
    $post['content'] = $content . "\n" . $L['guestbook_from'] . "\n" . $L['guestbook_info'] . $_SERVER['HTTP_USER_AGENT'];
    if ($do->pass($post)) {
        $post['type'] = '';
        if ($_userid) {
            $user = userinfo($_username);
            $post['truename'] = $user['truename'];
            $post['telephone'] = $user['telephone'] ? $user['telephone'] : $user['mobile'];
            $post['email'] = $user['mail'] ? $user['mail'] : $user['email'];
            $post['qq'] = $user['qq'];
            $post['msn'] = $user['msn'];
            $post['ali'] = $user['ali'];
            $post['skype'] = $user['skype'];
        }
        $do->add($post);
예제 #10
0
<?php

defined('IN_DESTOON') or exit('Access Denied');
require MD_ROOT . '/guestbook.class.php';
$do = new guestbook();
$menus = array(array('留言列表', '?moduleid=' . $moduleid . '&file=' . $file), array('模块设置', '?moduleid=' . $moduleid . '&file=setting#' . $file));
if ($_catids || $_areaids) {
    require DT_ROOT . '/admin/admin_check.inc.php';
}
if (in_array($action, array('', 'check'))) {
    $sfields = array('按条件', '留言标题', '会员名', '联系人', '联系电话', '电子邮件', 'QQ', '阿里旺旺', 'MSN', 'Skype', '留言IP', '留言内容', '回复内容');
    $dfields = array('title', 'title', 'username', 'truename', 'telephone', 'email', 'qq', 'ali', 'msn', 'skype', 'ip', 'content', 'reply');
    $sorder = array('结果排序方式', '留言时间降序', '留言时间升序', '回复时间降序', '回复时间升序');
    $dorder = array('itemid DESC', 'addtime DESC', 'addtime ASC', 'edittime DESC', 'edittime ASC');
    isset($fields) && isset($dfields[$fields]) or $fields = 0;
    isset($order) && isset($dorder[$order]) or $order = 0;
    $fields_select = dselect($sfields, 'fields', '', $fields);
    $order_select = dselect($sorder, 'order', '', $order);
    $condition = '1';
    if ($_areaids) {
        $condition .= " AND areaid IN (" . $_areaids . ")";
    }
    //CITY
    if ($keyword) {
        $condition .= " AND {$dfields[$fields]} LIKE '%{$keyword}%'";
    }
    if ($areaid) {
        $condition .= $ARE['child'] ? " AND areaid IN (" . $ARE['arrchildid'] . ")" : " AND areaid={$areaid}";
    }
}
switch ($action) {
예제 #11
0
<?php

defined('IN_DESTOON') or exit('Access Denied');
require DT_ROOT . '/module/' . $module . '/common.inc.php';
$MOD['guestbook_enable'] or dheader(DT_PATH);
$TYPE = explode('|', trim($MOD['guestbook_type']));
require DT_ROOT . '/include/post.func.php';
require MD_ROOT . '/guestbook.class.php';
$do = new guestbook();
$destoon_task = rand_task();
if ($submit) {
    captcha($captcha, $MOD['guestbook_captcha']);
    if ($do->pass($post)) {
        $post['areaid'] = $cityid;
        $do->add($post);
        message($L['gbook_success'], $EXT['guestbook_url']);
    } else {
        message($do->errmsg);
    }
} else {
    $type = '';
    $condition = "status=3 AND reply<>''";
    if ($keyword) {
        $condition .= " AND content LIKE '%{$keyword}%'";
    }
    if ($cityid) {
        $condition .= $AREA[$cityid]['child'] ? " AND areaid IN (" . $AREA[$cityid]['arrchildid'] . ")" : " AND areaid={$cityid}";
    }
    $lists = $do->get_list($condition);
    $head_title = $L['gbook_title'];
    $content = isset($content) ? dhtmlspecialchars(stripslashes($content)) : '';
예제 #12
0
파일: gb.php 프로젝트: kissthink/slakfinder
<br>message:
<textarea name=message cols=70 rows=3></textarea>
<input type=submit><br></form>
<a href='gb.php'>Reload</a> <?php 
if (isset($_POST['message'])) {
    if (isset($_SESSION['slakhomelinuxguestbookmsg'])) {
        if ($_SESSION['slakhomelinuxguestbookmsg'] == $_POST['message']) {
            $gb = new guestbook();
        } else {
            $_SESSION['slakhomelinuxguestbookmsg'] = $_POST['message'];
            $gb = new guestbook($_POST['message'], $_SESSION['slakhomelinuxguestbooknick']);
        }
    } else {
        $_SESSION['slakhomelinuxguestbookmsg'] = $_POST['message'];
        $gb = new guestbook($_POST['message'], $_SESSION['slakhomelinuxguestbooknick']);
    }
} else {
    $gb = new guestbook();
}
echo "<br><br>";
echo tables(array("", "", ""), 1, " class='gb' ");
//echo tables(array("Date","Nick","Message"),1," class='gb' ");
while ($message = $gb->fetch()) {
    echo tables(array("<sup>{$message['date']}</sup>", "<font color='red'>" . $message['nick'] . "</font>", $message['message']));
}
echo tables();
echo "</pre>";
?>
</body>
</html>