Jump to content
Sign in to follow this  
Toretto

ipb chat

Recommended Posts

Sveicināti uzliku ipb chat sākumlapas un kad meiģinu ierakstīt http://prntscr.com/dw59z0 nesanāk spiežu pogu kautvai 1000reizes

 

 

	<?php
header('Content-Type: text/html; charset=utf-8');
ini_set('display_errors', 1);
require('forums/conf_global.php');    // Norādi pareizu ceļu uz šo failu un visam jadarbojas
	<?php
$servername = "195.3.145.26";
$username = "user";
$password = "parole";
	// Create connection
$conn = new mysqli($servername, $username, $password);
	// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 
echo "Connected successfully";
?>
$limits = "20";// Cik ziņas uzrādīsies
$noavatar = "public/style_images/master/profile/default_large.png"; // links uz noavatar
	if(isset($_POST['shout'])){
    if(isLoggedIn()){
    $db->query(
        "INSERT INTO `".$INFO['sql_tbl_prefix']."shoutbox_shouts`(`s_mid`,`s_date`,`s_message`,`s_ip`)
        VALUES (".mysqli_real_escape_string($db, $_COOKIE['member_id']).",".time().",'".mysqli_real_escape_string($db,$_POST['shout'])."','".$_SERVER['REMOTE_ADDR']."')");
    }
    else
        die("NOT_USER");
};
	
$chat = $db->query(
    "SELECT cats.s_message, p.pp_main_photo, m.name, m.member_id FROM ".$INFO['sql_tbl_prefix']."shoutbox_shouts cats, ".$INFO['sql_tbl_prefix']."members m, "
    .$INFO['sql_tbl_prefix']."profile_portal p WHERE cats.s_mid =  m.member_id AND m.member_id = p.pp_member_id ORDER BY cats.s_id DESC LIMIT "
    .$limits);
echo $db->error;
while($shout = $chat->fetch_object()) {
    $shout->s_message = strip_tags(str_replace(array('[', ']','&#33;'), array('<', '>', '!'), $shout->s_message));
    echo "
        <tr>
        <td><a href='".$INFO['board_url']."/index.php?/user/".$shout->member_id."-/'><img src='".$INFO['board_url']."/";
                            if(empty($shout->pp_main_photo)) {
                                    echo  $noavatar;
                                } else {
                                    echo "uploads/" .$shout->pp_main_photo;
                                }
                                echo "' title='".$shout->name."' height='20px' width ='20px'></a>
        </td><td>$shout->s_message</td></tr>";
};
	function isLoggedIn(){
    global $db, $INFO;
    $i = 0;
    if(isset($_COOKIE['session_id'])){
        $hash = $db->query(
            "SELECT 
                `sessions`.`member_id` 
            FROM
                `".$INFO['sql_tbl_prefix']."sessions` as `sessions`
            LEFT JOIN
                `".$INFO['sql_tbl_prefix']."members` as `members`
            ON 
                `sessions`.`member_id` = `members`.`member_id`
            WHERE
                `sessions`.`id` = '".mysqli_real_escape_string($db, $_COOKIE['session_id'])."' 
                AND 
                `members`.`member_login_key` = '".mysqli_real_escape_string($db, $_COOKIE['pass_hash'])."' LIMIT 1");
        while($hashed = $hash->fetch_object()){
            $i = $hashed->member_id;
        };
    };
    if($i > 0)
        return 1;
    else
        return 0;
}
?>

Share this post


Link to post
Share on other sites

Pačeko Dev tūļos (F12), kas network tabā notiek.
Mans minējums ir, ka vai nu ceļš uz config failu nav pareizs un skripts nomirst pie require, vai arī tevis norādītās DB piekļuves nestrādā

  • Upvote 2

Share this post


Link to post
Share on other sites

Failed to load resource: the server responded with a status of 500 (Internal Server Error)
jquery.js:9664 GET http://fallet.lv/chat_ajax.php 500 (Internal Server Error)
send @ jquery.js:9664
ajax @ jquery.js:9215
m.fn.load @ jquery.js:10000
loadChat @ chat_index.php:19
jquery.js:9664 GET http://fallet.lv/chat_ajax.php 500 (Internal Server Error)
send @ jquery.js:9664
ajax @ jquery.js:9215
m.fn.load @ jquery.js:10000
loadChat @ chat_index.php:19
jquery.js:9664 GET http://fallet.lv/chat_ajax.php 500 (Internal Server Error)
send @ jquery.js:9664
ajax @ jquery.js:9215
m.fn.load @ jquery.js:10000
loadChat @ chat_index.php:19

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.