Jump to content

andylord

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

andylord's Achievements

Member

Member (2/5)

0

Reputation

  1. andylord

    xml not showing

    xml not showing confused So heres what i have package { import flash.display.Sprite; import flash.text.TextField; import flash.events.Event; import flash.net.URLRequest; import flash.net.URLLoader; import flash.net.URLLoaderDataFormat; public class XMLtester extends Sprite { var counter:uint = 1; // a loop counter // Display a list of tracknames for each ( var myElement:XML in myXML.elements() ) { Names.appendText(counter + " " + myElement.trackname + "\n"); counter++; // increment the counter by 1 } // Demo of selecting a particular track filename, e.g. the first track is indexed using the index number zero (as in arrays) _displayTXT.appendText("\n\n" + myXML.track[0].filename + "\n"); var myXMLFile:String = "playlist.xml"; var myRequest:URLRequest = new URLRequest(myXMLFile); // Create a new URLRequest object to specify the name of the XML file var myLoader:URLLoader = new URLLoader(); // Create a new loader object myLoader.dataFormat = URLLoaderDataFormat.TEXT; // Tell the loader object to load the file as plain text. myLoader.addEventListener( Event.COMPLETE, onComplete ); // Register the event handler which will be automatically triggered when the loader object has fully loaded the external XML file. myLoader.load(myRequest); // Load the XML file into memory. The onComplete event handler will be triggered when the loading of the XML file is complete. private function onComplete( e:Event ):void { var myXML:XML = new XML( e.target.data ); // Pass the event target data to the XML class constructor to create a new XML object named myXML. trace( myXML ); // Display the content of the myXML object to the output window (not the stage) for checking. } } } now i have a dynamic text called Names and i have a playlist.xml file am slightly new to actionscript and this has just been thrown together really i think im missing something but not sure what can anyone help me plz
  2. andylord

    id

    Notice: Query Failed: No database selected in /customers/cop-help.com/cop-help.com/httpd.www/Testing/Redupdate.php on line 9 But i have connected and have tested the database connection to it
  3. andylord

    id

    i am getting the following error on page: http://cop-help.com/Testing/Redupdate.php Warning: mysql_numrows() expects parameter 1 to be resource, boolean given in /customers/cop-help.com/cop-help.com/httpd.www/Testing/Redupdate.php on line 10 $query= "SELECT * FROM Runesred WHERE id='$id'"; $result=mysql_query($query); $num=mysql_numrows($result); Line 10 is the the code above i am not sure why this is happening can anyone explain to me why this is happening :S
  4. Lol no worries i got it working ty again
  5. Ty so much showed me a few things there
  6. Lol i feel like a idiot now, cheers for the help
  7. <? $Name = "Initiate Touch of Fire"; $query = SELECT * FROM Runesred WHERE Name='$Name' or die ('Error Selecting'); $result = mysql_query($query, $connection)or die ('Error Results');; $Name2 = mysql_result($result,"Name"); $Image = mysql_result($result,"Image"); $Class = mysql_result($result,"Class"); $Level = mysql_result($result,"Level"); $Damage = mysql_result($result,"Damage"); $Effect = mysql_result($result,"Effect"); $DroppedBy = mysql_result($result,"DroppedBy"); $Description = mysql_result($result,"Description"); $Mana = mysql_result($result,"Mana"); echo "<tr><td>$Name2</td><td></td></tr><tr><td>$Image</td><td> </td></tr><tr><td>$Class</td><td> </td></tr><tr><td>$Level</td><td> </td></tr><tr><td> </td><td>$Damage</td></tr><tr><td> </td><td>$Effect</td></tr><tr><td> </td><td>$DroppedBy</td></tr><tr> <td> </td><td>$Description</td></tr><tr><td> </td><td>$Mana</td></tr></table>"; ?> Looking for a while cant find it maybe another couple eyes could ? Before its just all the connection information (works tested)
  8. andylord

    pages

    <?php // opens images folder if ($handle = opendir('../Pictureupload/thumbs/')) { while (false !== ($file = readdir($handle))) { // strips files extensions $crap = array(".jpg", ".jpeg", ".JPG", ".JPEG", ".png", ".PNG", ".gif", ".GIF", ".bmp", ".BMP", "_", "-"); $newstring = str_replace($crap, " ", $file ); //asort($file, SORT_NUMERIC); - doesnt work // hides folders, writes out ul of images and thumbnails from two folders if ($file != "." && $file != ".." && $file != "index.php" && $file != "Thumbnails") { echo "<li><a href=\"thumbs/$file\" class=\"thickbox\" rel=\"gallery\" title=\"$newstring\"><img src=\"../Pictureupload/thumbs/$file\" alt=\"$newstring\" width=\"300\" </a></li>\n";} } closedir($handle); } ?> i am simplying getting images from a directory but i would like them to be in pages not just on one big page, and to display page numbers at the bottom anyone have any idea on how i would go about in doing this or have a link to a tutorial maybe ? thanks in advance for help
  9. <?php @error_reporting (E_ALL ^ E_NOTICE); /* USER SETTINGS */ $image_dir = "upload/files"; /* if true, gif thumbnails are used*/ $use_gifs = true; /* SETUP, DEFAULTS, and CHECK SETTINGS*/ $view = (isset($_REQUEST['view'])) ? $_REQUEST['view'] : ""; // Read all files in $image_dir if (!isset($image)) { $image = phppg_recursive_listdir($image_dir); } else { array_walk ($image, 'phppg_add_image_dir'); } // SECURITY CHECK : Requested $view must contain the REAL PATH of '$image_dir' if ($view) { $image_dir_path = realpath($_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . "/" . $image_dir); // REALPATH to image directory $view_dir_path = dirname(realpath($_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . "/" . $view . ".jpg")); // REALPATH to the image file $view_dir_path = dirname(realpath($_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . "/" . $view . ".gif")); // REALPATH to the image file if (!$image_dir_path || !$view_dir_path || !stristr($view_dir_path, $image_dir_path)) { die("BAD REQUEST<br>There has been an error - please <a href=\"" . $_SERVER['PHP_SELF'] . "\">go back</a>"); } } // Remove extensions array_walk ($image, 'phppg_remove_extension'); $temp_image = array_unique($image); $image = array(); $i = 0; foreach ($temp_image as $v) { /* reset array keys */ $image[$i] = $v; $i++; } // Defaults if (!isset($view) || !$view) $view = $image[0]; /* DISPLAY - large image*/ if ($view && (file_exists($view . ".jpg"))) { $currKey = array_keys ($image, $view); ?> <?php $i = 0; foreach($image as $v) { print("\t\t<a href=\"javascript:popup('andys-cop-help.com/" . $v . ".jpg','')\"><img src=\"" . $v . ".gif\" alt=\"\" height=\"90\" width=\"90\"></a>\n"); $i++; } ?> <?php } /* FUNCTIONS ** array_walk() uses this to remove extensions from array ** @param value (string) array value passed by reference ** @param key (string) array key */ function phppg_remove_extension(&$value, $key) { $value = preg_replace(array("/.gif/i", "/.jpg/i"), "", $value); } function phppg_add_image_dir(&$value, $key) { global $image_dir; $value = $image_dir . "/" . $value; } /**array phppg_recursive_listdir( (string) base) ** Recursively searches directory and returns an array ** @param base (string) base */ function phppg_recursive_listdir($base) { static $filelist = array(); static $dirlist = array(); if(is_dir($base)) { $dh = opendir($base); while (false !== ($dir = readdir($dh))) { if (is_dir($base ."/". $dir) && $dir !== '.' && $dir !== '..') { $subbase = $base ."/". $dir; $dirlist[] = $subbase; $subdirlist = phppg_recursive_listdir($subbase); } elseif(is_file($base ."/". $dir) && $dir !== '.' && $dir !== '..') { $filelist[] = $base ."/". $dir; } } closedir($dh); } $array['dirs'] = $dirlist; $array['files'] = $filelist; //return $array; return $filelist; } ?> basically i have this code that finds image in a directory but why is it not going to the link of the image when the image is clicked, baffled myself, if you can help or point me in the right direction much appreciated thanks. http://andys-cop-help.com/Showimages.php
  10. ah its me being stupid, i forgot to put my thumbnails on in gifs lol
  11. ah dam they are gifs, but i cant see why it isnt showing them as gifs now :S
  12. <?php @error_reporting (E_ALL ^ E_NOTICE); /* USER SETTINGS */ $image_dir = "upload/files"; /* if true, gif thumbnails are used*/ $use_gifs = true; /* SETUP, DEFAULTS, and CHECK SETTINGS*/ $view = (isset($_REQUEST['view'])) ? $_REQUEST['view'] : ""; // Read all files in $image_dir if (!isset($image)) { $image = phppg_recursive_listdir($image_dir); } else { array_walk ($image, 'phppg_add_image_dir'); } // SECURITY CHECK : Requested $view must contain the REAL PATH of '$image_dir' if ($view) { $image_dir_path = realpath($_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . "/" . $image_dir); // REALPATH to image directory $view_dir_path = dirname(realpath($_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . "/" . $view . ".jpg")); // REALPATH to the image file if (!$image_dir_path || !$view_dir_path || !stristr($view_dir_path, $image_dir_path)) { die("BAD REQUEST<br>There has been an error - please <a href=\"" . $_SERVER['PHP_SELF'] . "\">go back</a>"); } } // Remove extensions array_walk ($image, 'phppg_remove_extension'); $temp_image = array_unique($image); $image = array(); $i = 0; foreach ($temp_image as $v) { /* reset array keys */ $image[$i] = $v; $i++; } // Defaults if (!isset($view) || !$view) $view = $image[0]; /* DISPLAY - large image*/ if ($view && (file_exists($view . ".jpg"))) { $currKey = array_keys ($image, $view); ?> <?php $i = 0; foreach($image as $v) { print("\t\t<a href=\"javascript:popup('andys-cop-help.com/" . $v . ".jpg','')\"><img src=\"" . $v . ".gif\" alt=\"\" height=\"90\" width=\"90\"></a>\n"); $i++; } ?> <?php } /* FUNCTIONS ** array_walk() uses this to remove extensions from array ** @param value (string) array value passed by reference ** @param key (string) array key */ function phppg_remove_extension(&$value, $key) { $value = preg_replace(array("/.gif/i", "/.jpg/i"), "", $value); } function phppg_add_image_dir(&$value, $key) { global $image_dir; $value = $image_dir . "/" . $value; } /**array phppg_recursive_listdir( (string) base) ** Recursively searches directory and returns an array ** @param base (string) base */ function phppg_recursive_listdir($base) { static $filelist = array(); static $dirlist = array(); if(is_dir($base)) { $dh = opendir($base); while (false !== ($dir = readdir($dh))) { if (is_dir($base ."/". $dir) && $dir !== '.' && $dir !== '..') { $subbase = $base ."/". $dir; $dirlist[] = $subbase; $subdirlist = phppg_recursive_listdir($subbase); } elseif(is_file($base ."/". $dir) && $dir !== '.' && $dir !== '..') { $filelist[] = $base ."/". $dir; } } closedir($dh); } $array['dirs'] = $dirlist; $array['files'] = $filelist; //return $array; return $filelist; } ?> ok i have this code here but when i use it it isnt showing the images wondering if any of you know why this is ? Link: http://andys-cop-help.com/Showimages.php
×
×
  • 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.