php help

I am making an adoptable website similar to Dragon cave or silvadopts. My website can be viewed at

If anyone has seen on both Dragon cave and silvadopts, they have a special adoption system. It displays a set image, and when you click it, it leads to a link which gives the user an adoptable. For a while I’ve been trying to figure this out. While looking online however, I found this code [php]<?php
// Random Image With Link
// Blog Tycoon
// Usage:
// Save this file as ads.php and use the include function to call it inside your web site

function display_random_img($array) {
$key = rand(0 , count($array) -1);
$link_url = $array[$key][‘url’];
$alt_tag = $array[$key][‘alt’];
$random_img_url = $array[$key][‘img_url’];
list($img_width, $img_height) = getimagesize($random_img_url);
return “<a href=”$link_url"><img src="$random_img_url" width="$img_width" height="$img_height" alt="$alt_tag" title="$title" />";

// Edit the following values accordingly
$ads_array = array(
‘url’ => ‘’,
‘alt’ => ‘Beach wolf’,
‘img_url’ => ‘
‘url’ => ‘’,
‘alt’ => ‘Summer wolf’,
‘img_url’ => ‘
‘url’ => ‘’,
‘alt’ => ‘Snow Leopard’,
‘img_url’ => ‘

echo display_random_img($ads_array);
echo display_random_img($ads_array_1); // add or remove accordingly

when I put this directly to the website I come up with this Notice the egg is there, in the top left. But I’d like it to be inside the white area, where it says “Fatal Error: Class AdoptnewController either does not exist, or has its include path misconfigured!” I’d also like for it to be in a row of four, with each one a different link, as well as a description under the image. However I do not know how to accomplish this.

I’d also like to link it to my adoption system so that it will link the user to the adoptable instead of google, yahoo, and msn like it does now. [php]<?php

class AdoptController extends AppController{

private $view;
private $subController;

public function __construct(){
	$mysidia = Registry::get("mysidia");
	if($mysidia->usergroup->getpermission("canadopt") != "yes"){
	    throw new NoPermissionException("It appears that you are either not logged in, or do not have permission to adopt.");

public function index(){
    $mysidia = Registry::get("mysidia");
	$document = $mysidia->frame->getDocument();
	    $this->flag = "member";
		if($mysidia->session->fetch("adopt") != 1 or !is_numeric($mysidia->input->post("id"))) throw new InvalidIDException($mysidia->lang->global_id);
		$adopt = new Adoptable($mysidia->input->post("id"));			    
		$conditions = $adopt->getConditions();
		if(!$conditions->checkConditions()) throw new NoPermissionException("It appears that you do not meet the condition to acquire this adoptable.");
		$name = (!$mysidia->input->post("name"))?$adopt->getType():$mysidia->input->post("name");
	    $alts = $adopt->getAltStatus();
	    $code = $adopt->getCode();
		$gender = $adopt->getGender();
	    $mysidia->db->insert("owned_adoptables", array("aid" => NULL, "type" => $adopt->getType(), "name" => $name, "owner" => $mysidia->user->username, "currentlevel" => 0, "totalclicks" => 0, "code" => $code, 
		                                            "imageurl" => NULL, "usealternates" => $alts, "tradestatus" => 'fortrade', "isfrozen" => 'no', "gender" => $gender, "lastbred" => 0));
		$aid = $mysidia->db->select("owned_adoptables", array("aid"), "code='{$code}' and owner='{$mysidia->user->username}'")->fetchColumn();
        $document->setTitle("{$name} adopted successfully");
	    $image = new Image($adopt->getEggImage());
		$document->addLangvar("Congratulations!  You just adopted {$name}.  You can now manage {$name} on the ");
		$document->add(new Link("myadopts", "Myadopts Page."));
		$document->add(new Comment(""));
		$document->add(new Link("myadopts/manage/{$aid}", "Click Here to Manage {$name}"));
		$document->add(new Comment(""));
		$document->add(new Link("myadopts/bbcode/{$aid}", "Click Here to get BBCodes/HTML Codes for {$name}"));
		$document->add(new Comment(""));
		$document->addLangvar("Be sure and");
		$document->add(new Link("levelup/{$aid}", "feed "));
		$document->addLangvar("{$name} with clicks so that they grow!");
	$mysidia->session->assign("adopt", 1, TRUE);
	$default = (!$mysidia->user->isloggedin)?$mysidia->lang->guest:$mysidia->lang->member;
    $ids = $mysidia->db->select("adoptables", array("id"), "shop='none'")->fetchAll(PDO::FETCH_COLUMN);

    $adoptForm = new Form("form", "adopt", "post");
	$adoptTitle = new Comment("Available Adoptables");
	$adoptTable = new Table("table", "", FALSE);

	foreach($ids as $id){
	    $adopt = new Adoptable($id);
		$conditions = $adopt->getConditions();
		    $row = new TRow;
			$idCell = new TCell(new RadioButton("", "id", $id));				
			$imageCell = new TCell(new Image($adopt->getEggImage(), $adopt->getType()));
			$imageCell->setAlign(new Align("center"));
			$type = new Comment($adopt->getType());
            $description = new Comment($adopt->getDescription(), FALSE);
			$typeCell = new TCell;

	if(!$ids) $adoptForm->add(new Comment("There is not an adoptable available at this point, please come back later."));
	else $adoptForm->add($adoptTable);
	$adoptSubtitle = new Comment("Adopt");
	$adoptForm->add(new Comment("Adoptable Name: ", FALSE));
	$adoptForm->add(new TextField("name"));
	$adoptForm->add(new Comment(""));
    $adoptForm->add(new Button("Adopt Me", "submit", "submit"));


-thank you

Sponsor our Newsletter | Privacy Policy | Terms of Service