• 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!

Modern AAC - Gallery..

Kavvson

Gdy boli cie glowa wez
Joined
Jun 25, 2008
Messages
1,177
Reaction score
72
Location
Poland
How can i add a page... It shoud be in Guilds/Gallery

Guilds controller

PHP:
/* Gallery function */
	public function gallery($id) {
		$ide = new IDE;
		$ide->requireLogin();
		$id = (int)$id;
		if(empty($id)) $ide->redirect(WEBSITE."/index.php/guilds");
		$data = array();
		$this->load->model("guilds_model");
		$data['guild'] = $this->guilds_model->getGuildInfo($id);
		if(empty($data['guild'])) $ide->redirect(WEBSITE."/index.php/guilds");
		if(!$this->guilds_model->isGuildLeader($data['guild'][0]['ownerid'])) $ide->redirect(WEBSITE."/index.php/guilds");
		
		$data['id'] = $id;
				require("config.php");
				$cfg['upload_path'] = $config['uploads_gallery'];
				$cfg['allowed_types'] = 'gif';
				$cfg['max_size']	= '128000';
				$cfg['max_width']  = '1640';
				$cfg['max_height']  = '2111';
				$cfg['file_name'] = $id;
				$cfg['overwrite'] = true;
				$this->load->library('upload', $cfg);
				if($this->upload->do_upload("gallery"))
					success("Gallery has been changed.");
				$data['error'] = $this->upload->display_errors();
		
			
		$this->load->helper("form_helper");
		$this->load->view("guild_menu", $data);
		$this->load->view("guild_gallery", $data);
	}

Guild_Gallery.php (file in view)

PHP:
<?php 
$logo = (file_exists("public/guild_logos/gallery/".$id.".gif")) ? "<img src='".WEBSITE."/public/guild_logos/gallery/".$id.".gif' width='64' height='64'>" : "<img src='".WEBSITE."/public/guild_logos/gallery/default.gif'>";
@error($error);
echo "<label>Current Gallery Preview</label>".$logo;
echo form_open_multipart('guilds/gallery/'.$id);
echo '<input type="file" name="logo" max_file_size="131072111" />';
echo '<input type="submit" value="Upload" />';
echo "</form>";;
?>

Guild_Menu.php in view


PHP:
<div class="toolbar">
	<a href='<?php echo WEBSITE;?>/index.php/guilds/invite/<?php echo $id; ?>'>Invite Player</a> | 
	<a href='<?php echo WEBSITE;?>/index.php/guilds/members/<?php echo $id; ?>'>Manage Members</a> | 
	<a href='<?php echo WEBSITE;?>/index.php/guilds/motd/<?php echo $id; ?>'>Change MOTD</a> | 
	<a href='<?php echo WEBSITE;?>/index.php/guilds/logo/<?php echo $id; ?>'>Change Logo</a> | 
	<a href='<?php echo WEBSITE;?>/index.php/guilds/gallery/<?php echo $id; ?>'>Change Gallery</a> | 
	<a href='#' onClick="if(confirm('Are you sure you want to delete the guild? You cannot restore this guild after deletion.'))window.location.href='<?php echo WEBSITE?>/index.php/guilds/delete/<?php echo $id;?>';">Delete guild</a> | 
</div>

Error



404 Page Not Found

The page you requested was not found.


http://127.0.0.1/index.php/guilds/gallery/1
 
But it isn't :(

Try to add it in your Modern AAC and check..

I want to make a simple gallery. Could someone provide me in a script? Since the code don't work :S
 
Last edited by a moderator:
Back
Top