• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Website Modern Acc!

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,780
Solutions
31
Reaction score
2,299
Location
Sweden?
Hello everyone can i get help!

I get this error, when they are comment a news! it doesnt show player name!
PHP:
A PHP Error was encountered

Severity: Notice

Message: Undefined index: account_id

Filename: models/home_model.php

Line Number: 56

Also i need a line that it delete all players items expect itemid 2400

Thanks rep!
 
But this warnings have to mean something, since when people comment it write numbers instead player name.
 
So, when they comment, why doesnt they show player name? :o wierd

And aslo is this possible:
Also i need a line that it delete all players items expect itemid 2400
 
home_model.php
Code:
	public function getComments($id) {
		require("config.php");
		$this->load->database();
		$this->load->helper("url");
		$page = $this->uri->segment(4);
		$page = (empty($page)) ? 0 : $page;
		return $this->db->query("SELECT `comments`.`id`, `body`, `time`, `author`, `players`.`name` FROM `comments` LEFT JOIN `players` ON `players`.`id` = `comments`.`author` WHERE `news_id` = '".$id."' ORDER BY comments.id DESC LIMIT ".$page.", ".$config['commentLimit'])->result_array();
	}
view_news.php
Code:
		echo "<div class='commentFooter'>".$delete." Posted on: ".UNIX_TimeStamp($comment['time'])." by <a href='".WEBSITE."/index.php/character/view/".$comment['name']."'>".$comment['name']."</a></div>";
SQL:
DELETE FROM player_items WHERE itemtype != 2400
repeat the same for player_depotitems & tile_items (convert to relational first) if you want
 
Thanks about delete thing :P

Do it delete all items, but not 2400, because i dont want 2400 get deleted.
 
Back
Top