Jump to content

Mouse

Members
  • Posts

    95
  • Joined

  • Last visited

    Never

Everything posted by Mouse

  1. Total Members… I am just implementing a counter or two on my site… always a good way to promote membership and advertising revenue… The bit that I cant work out is how to display the number of members on my site whats the magic code to retrieve and echo the highest number in the $u_id column in my “user” table, i.e the number of members? Mouse
  2. [!--quoteo(post=355855:date=Mar 17 2006, 07:04 AM:name=fusionpixel)--][div class=\'quotetop\']QUOTE(fusionpixel @ Mar 17 2006, 07:04 AM) [snapback]355855[/snapback][/div][div class=\'quotemain\'][!--quotec--] now its my turn :) Yawn! nite... [/quote] nite nite, sleep tight, hope the bed bugs don't bite.... and many thanks!!! Mouse
  3. ../file_name/img_name hello, I think it is fair to say we know what we know, and have no clue what we don’t know, so here’s another thing I discovered that I don’t yet know. This whole [../file_name/img_name] thing, especially the …/ bit, WHAT??? Like most of us I come from an HTML background where you gave the file path and that was it, images/img_1.jpg etc. Now I here in the pub last night that something along the lines of server_root/images/img_1.jpg is more correct… again WHAT??? Ok, so which is the best, most bullet proof way of getting the image to the screen, the one which I don’t need to change the number of dots or slashes if I move a file??? The one that Mr. Explorer doesn’t look at and think that a little drop shadow box with a red cross is a better option to…(/)? End of rant/question Mouse
  4. [!--quoteo(post=355717:date=Mar 16 2006, 11:14 PM:name=fusionpixel)--][div class=\'quotetop\']QUOTE(fusionpixel @ Mar 16 2006, 11:14 PM) [snapback]355717[/snapback][/div][div class=\'quotemain\'][!--quotec--] yup, you will get 2 identical images because that is what you are telling PHP to do: [code]echo '<a class="p1" href="#nogo" ><img src="'.$filename.'" /><img class="large"  src="'.$filename.'" /></a>'; [/code] see? $filename is used twice in there. [/quote] Morning.... yawn! right, yes the file name is used twice, just as it is in the first code example... the css should work like the example here... [a href=\"http://www.cssplay.co.uk/menu/magnify.html\" target=\"_blank\"][CSS Example][/a]
  5. [!--quoteo(post=355708:date=Mar 16 2006, 10:45 PM:name=fusionpixel)--][div class=\'quotetop\']QUOTE(fusionpixel @ Mar 16 2006, 10:45 PM) [snapback]355708[/snapback][/div][div class=\'quotemain\'][!--quotec--] Close but no quite there yet ;) [code] <?php       $filename = "images/mugs/".$familyname."_".$firstname.".jpg";       $filename = strtolower($filename);              if (file_exists($filename)) {         echo "<!-- looking for image: $filename -->\n";         echo '<div id="menu">';         echo '<a class="p1" href="#nogo" ><img src="'.$filename.'" /><img class="large"  src="'.$filename.'" /></a>';         echo '</div>';       } else {       echo "<!-- looking for filename: $filename -->\n";       echo "<img src=\"images/mugs/MugDefault.jpg\" width=\"135\" height=\"150\" >";       } ?> [/code] You need to get those variables out of the quotes. [/quote] now i just get two images just the same.. no image enlargement on mouseover.... :( GRRRRR bed time... come back tommorrow with clear head.... Thanks for the assist tho fusionpixel Mouse
  6. Hello all.... this is going to be so obviouse but i just cant see it.... this works... [code] <style type="text/css"> #menu {position:relative; top:10px; left:100px; width:75px; background-color:#fff; z-index:100;} #menu a.p1, #menu a.p1:visited {display:block; width:75px; height:75px; text-decoration:none; background:#fff; top:0; left:0; border:0;} #menu a img {border:0;} #menu a.p1:hover {text-decoration:none; background-color:#8c97a3; color:#000;} #menu a .large {display:block; position:absolute; width:1px; height:1px; border:0px; top:-1px; left:-1px;} #menu a.p1:hover .large {display:block; position:absolute; top:-60px; left:150px; width:300px; height:300px; border:10px solid #fff;} #info {z-index:100; height:10em;} </style> </head> <body> <div id="menu"> <a class="p1" href="#nogo" title="thumbnail image"><img src="images/mugs/img1.jpg" title="Thumbnail image" alt="Thumbnail image" /><img class="large"  src="images/mugs/img1.jpg" title="Enlarged view of image" alt="Enlarged view of image" /></a> </div> </body> </html> [/code] but this don't.... [code] <?php       $filename = "images/mugs/".$familyname."_".$firstname.".jpg";       $filename = strtolower($filename);              if (file_exists($filename)) {       echo "<!-- looking for image: $filename -->\n";        echo '<div id="menu">'; echo '<a class="p1" href="#nogo" ><img src=\"$filename\" /><img class="large"  src=\"$filename\" /></a>'; echo '</div>';       } else {       echo "<!-- looking for filename: $filename -->\n";       echo "<img src=\"images/mugs/MugDefault.jpg\" width=\"135\" height=\"150\" >";       }       ?> [/code] WHY???????? please help me here before i tear my hair out (i don't look good without my foppish hair style...) Mouse
  7. Hello all, i am playing arround with search scripts at the moment for an ever expanding database driven site. and then i found PHPDig... has anyone tried this script? is there a better off the shelf alternative until i write my dedicated search script??? your opinions please... Mouse
  8. [!--quoteo(post=353592:date=Mar 10 2006, 11:58 AM:name=Dan_comp)--][div class=\'quotetop\']QUOTE(Dan_comp @ Mar 10 2006, 11:58 AM) [snapback]353592[/snapback][/div][div class=\'quotemain\'][!--quotec--] I am trying to create a room booking script. People cant book the same time in the same room on the same day. I am having a problem with the time part. The form before sends a start time and an end time. I need a code that if the start time and/or end time is within a time already booked in that room on that day, it echos problem. I am not very good at time in php. My booked times are kept in a mysql database. [/quote] i had the same issue... so i cheated... i looked at sorce forge, they have an opensource solution... so i used it as reference.... saw the trick, worked it out... Mouse
  9. [!--quoteo(post=353491:date=Mar 10 2006, 02:27 AM:name=Kyle Soule)--][div class=\'quotetop\']QUOTE(Kyle Soule @ Mar 10 2006, 02:27 AM) [snapback]353491[/snapback][/div][div class=\'quotemain\'][!--quotec--] What are you trying to accomplish, I guess is the first question that needs to be answered. Yes, an advanced search...but that is an interesting term because any search is necessarily advanced :) Do you just want to search for multiple things in a specified field? Say, do you want your user to be able to say I want to search for Jon in the name field or do you it to search in a BUNCH of fields with one parameter? [/quote] Kyle…. Thanks!!! In answer to your question(s). My site is a reunion site with a potentially very large database so I feel a ‘simple’ word search may be counter productive. Imagine searching for “Chris” in a database where you have Christine’s, Christopher’s, Christian’s, some of whom may mention that they are Christians… So I intend to provide six search fields: 1. first name – free input ($firstname field) 2. surname – free input ($familyname field) 3. nationality – drop down box, taken from sign up form (256 options) 4. keyword search – free input ($lifestory field) 5. work location – drop down box (six options) 6. department- drop down box (26 options) (5 & 6 are the interesting ones because they have to be merged to make one field… i.e. if the selection for 5. was London and the selcction for 6. was butcher then the field to look in would be $londonbutcher … 156 fields…) hope that answers your questions… Mouse
  10. Advanced Search Script. I know nothing about this… HELP. They say the difference between a wise man and a fool is that the wise man knows what he does not know… and while I am not omnipotent, I do know that search scripts aren’t my thing. Below is a simple search script I have used on my fledgling site, and it seams to work… I admit I didn’t write this myself I found it orphaned on line, without credit being given to its author. Could someone more experienced than I give me a hand in making it into an advanced search? The following variables are taken from advanced search form… $name = “name”; //search in DB field ‘first_name’ $fname = “fname”; //search in DB field ‘family_name’ $resort = “location”; // six possible from drop down list $job = “job”; // twenty six possible from drop down list $locationjob = $location.$job; //search in DB field ‘where’ I assume that most of the editing needs to be done in this area… [code] $query = "SELECT * FROM tablename WHERE field1 LIKE \"%$trimm%\" OR field2 LIKE  \"%$trimm%\" OR field3 LIKE \"%$trimm%\" ORDER BY field1   DESC"; [/code] The full script is below… [code] <?php include = ‘db.php’; //specify how many results to display per page $limit = 10; // Get the search variable from URL   $var = @$_GET['q']; //trim whitespace from the stored variable   $trimmed = trim($var);   //separate key-phrases into keywords   $trimmed_array = explode(" ",$trimmed); // check for an empty string and display a message. if ($trimmed == "") {   $resultmsg =  "<p>Search Error</p><p>Please enter a search...</p>";   } // check for a search parameter if (!isset($var)){   $resultmsg =  "<p>Search Error</p><p>We don't seem to have a search parameter! </p>";   } // Build SQL Query for each keyword entered foreach ($trimmed_array as $trimm){        // EDIT HERE and specify your table and field names for the SQL query      $query = "SELECT * FROM tablename WHERE field1 LIKE \"%$trimm%\" OR field2 LIKE  \"%$trimm%\" OR field3 LIKE \"%$trimm%\" ORDER BY field1   DESC";      // Execute the query to  get number of rows that contain search kewords      $numresults=mysql_query ($query);      $row_num_links_main =mysql_num_rows ($numresults);      // next determine if 's' has been passed to script, if not use 0.      // 's' is a variable that gets set as we navigate the search result pages.      if (empty($s)) {          $s=0;      }       // now let's get results.       $query .= " LIMIT $s,$limit";       $numresults = mysql_query ($query) or die ( "Couldn't execute query" );       $row= mysql_fetch_array ($numresults);       //store record id of every item that contains the keyword in the array we need to do this to avoid display of duplicate search result.       do{ //EDIT HERE and specify your field name that is primary key           $adid_array[] = $row[ 'fieldid' ];       }while( $row= mysql_fetch_array($numresults)); } //end foreach if($row_num_links_main == 0 && $row_set_num == 0){    $resultmsg = "<p>Search results for:" . $trimmed  ."</p><p>Sorry, your search returned zero results</p>"; }    //delete duplicate record id's from the array. To do this we will use array_unique function    $tmparr = array_unique($adid_array);    $i=0;    foreach ($tmparr as $v) {        $newarr[$i] = $v;        $i++;    } // now you can display the results returned. But first we will display the search form on the top of the page ?> <form action="search.php" method="get" name="search">   <div align="center">       <input name="q" type="text" value=" <?php echo $q; ?> " size="15">       <input name="search" type="submit" value="Search">   </div> </form> <?php // display what the person searched for. if( isset ($resultmsg)){   echo $resultmsg;   exit(); }else{   echo "Search results for: " . $var; } foreach($newarr as $value){ // EDIT HERE and specify your table and field names for the SQL query $query_value = "SELECT * FROM tablename WHERE fieldid = '$value'"; $num_value=mysql_query ($query_value); $row_linkcat= mysql_fetch_array ($num_value); $row_num_links= mysql_num_rows ($num_value); //now let's make the keywods bold. To do that we will use preg_replace function. //EDIT parts of the lines below that have fields names like $row_linkcat[ 'field1' ] //This script assumes you are searching only 3 fields. If you are searching more fileds make sure that add appropriate line.   $titlehigh = preg_replace ( "'($var)'si" , "<b>\\1</b>" , $row_linkcat[ 'field1' ] );   $linkhigh = preg_replace ( "'($var)'si" , "<b>\\1</b>" , $row_linkcat[ 'field2' ] );   $linkdesc = preg_replace ( "'($var)'si" , "<b>\\1</b>" , $row_linkcat[ 'field3' ] ); foreach($trimmed_array as $trimm){     if($trimm != 'b' ){ //IF you added more fields to search make sure to add them below as well.         $titlehigh = preg_replace( "'($trimm)'si" ,  "<b>\\1</b>" , $titlehigh);         $linkhigh = preg_replace( "'($trimm)'si" , "<b>\\1</b>" , $linkhigh);         $linkdesc = preg_replace( "'($trimm)'si" ,  "<b>\\1</b>" , $linkdesc);      } //end highlight ?> <p> <?php echo $titlehigh; ?><br> <?php echo $linkhigh; ?><br> <?php echo $linkhigh; ?> </p> <?php }   //end foreach $trimmed_array    if($row_num_links_main > $limit){    // next we need to do the links to other search result pages       if ($s>=1) { // do not display previous link if 's' is '0'         $prevs=($s-$limit);          echo "<div align='left'><a href='$PHP_SELF?s=$prevs&q=$var&catid=$catid'>Previous " .$limit. "</a></div>";       }      // check to see if last page      $slimit =$s+$limit;        if (!($slimit >= $row_num_links_main) && $row_num_links_main!=1) {      // not last page so display next link           $n=$s+$limit;            echo "<div align='right'><a href='$PHP_SELF?s=$n&q=$var&catid=$catid'>Next " .$limit. "</a></div>";         }     } }  //end foreach $newarr ?> [/code] any and all hints, tips and or advice would be most welcome… Mouse
  11. Fuzzy head time... i am playing with a login similar to the one PHPFreaks uses, where i send my user a mail to confirm their address etc. at the moment i am testing this thru Lycos (hey it's free...) but i am having issues... how do i set my PC to act as a server so that i can send Mail() myself? and thus cut Lycos out of the loop....???? Mouse
  12. Where am i going wrong here? ok i started with the Membership tutorial on PHP freaks... then i added a captcha from puremango.co.uk and it all whent pear shaped... here are the three scripts and if you can tell me why it's all gone pear shaped i'll bake you a cake... Pritty Please Mouse Register.php [code] <? include 'db.php'; $first_name = $_POST['firs_tname']; $last_name = $_POST['last_name']; $email_address = $_POST['email_address']; $first_name = stripslashes($firs_tname); $last_name = stripslashes($last_name); $email_address = stripslashes($email_address); if((!$firs_tname) || (!$last_name) || (!$email_address) || (!$word)){     echo 'You did not submit the following required information! <br />';     if(!$firs_tname){         echo "First Name is a required field. Please enter it below.<br />";     }     if(!$last_name){         echo "Last Name is a required field. Please enter it below.<br />";     }     if(!$email_address){         echo "Email Address is a required field. Please enter it below.<br />";     }    if(!$word){        echo "The test word is a required field. Please enter it below.<br />";    }     include 'join_wrap.php';     exit(); } $sql_email_check = mysql_query("SELECT email_address FROM users             WHERE email_address='$email'"); $email_check = mysql_num_rows($sql_email_check); if(($email_check > 0)){     echo "Please fix the following errors: <br />";     if($email_check > 0){         echo "<strong>Your email address has already been used by another member         in our database. Please submit a different Email address!<br />";         unset($email_address);     }     include 'join_form.htm';     exit();   } function makeRandomPassword() {   $salt = "abchefghjkmnpqrstuvwxyz0123456789";   srand((double)microtime()*1000000);       $i = 0;       while ($i <= 7) {             $num = rand() % 33;             $tmp = substr($salt, $num, 1);             $pass = $pass . $tmp;             $i++;       }       return $pass; } $random_password = makeRandomPassword(); $db_password = md5($random_password); $sql = mysql_query("INSERT INTO users (firs_tname, last_name,         email, password, signup_date)         VALUES('$firs_tname', '$last_name', '$email_address',         '$db_password', now())")         or die (mysql_error()); if(!$sql){     echo 'There has been an error creating your account. Please contact the webmaster.'; } else {     $userid = mysql_insert_id();          $subject = "Your Membership at After the Mouse.com!";     $message = "Dear $first_name,     Thank you for registering at our website, http://www.afterthemouse.com!          You are two steps away from logging in and accessing our exclusive members area.          To activate your membership,       please click here: http://www.mysite.com/activate.php?id=$userid&code=$db_password          Once you activate your memebership, you will be able to login     with the following information:     Password: $random_password          Thanks!     The Webmaster          This is an automated response, please do not reply!";          mail($email_address, $subject, $message,         "From: After the Mouse.com  Webmaster<admin@afterthemouse.com>n         X-Mailer: PHP/" . phpversion());     echo 'Your membership information has been mailed to your email address!     Please check it and follow the directions!'; } ?> [/code] then i added a captcha from puremango.co.uk join_wrap.php [code] <? //session_start(); if(!empty($_SESSION['freecap_word_hash']) && !empty($_POST['word'])) {     if($_SESSION['hash_func'](strtolower($_POST['word']))==$_SESSION['freecap_word_hash'])     {         $_SESSION['freecap_attempts'] = 0;         $_SESSION['freecap_word_hash'] = false;         $word_ok = "yes";     } else {         $word_ok = "no";     } } else {     $word_ok = false; } ?> <html> <head> <script language="javascript"> <!-- function new_freecap() {     if(document.getElementById)     {         thesrc = document.getElementById("freecap").src;         thesrc = thesrc.substring(0,thesrc.lastIndexOf(".")+4);         document.getElementById("freecap").src = thesrc+"?"+Math.round(Math.random()*100000);     } else {         alert("Sorry, cannot autoreload word test image\nSubmit the form and a new word test will be loaded");     } } //--> </script> <style type="text/css"> <!-- .style1 {font-size: x-small} --> </style> </head> <body> <form method="post" action="register.php" onsubmit="return checkCheckBox(this)"> <table width="270" cellpadding="0" cellspacing="0"> <tr>   <td width="76">Email:</td><td width="192"><input name="email" type="text" value="<?=htmlspecialchars($_POST['email'])?>" size="32"></td></tr> <tr>   <td width="76">Name:</td><td width="192"><input name="first_name" type="text" value="<?=htmlspecialchars($_POST['email'])?>" size="32"></td></tr> <tr>   <td>Surame:</td><td><input name="family_name" type="text" value="<?=htmlspecialchars($_POST['password'])?>" size="32"></td></tr> <tr><td colspan="2"><img src="freecap.php" id="freecap"></td></tr> <tr><td colspan="2"><div align="center" class="style1 style1">If you can't read the word, <a href="#" onClick="this.blur();new_freecap();return false;">click here</a></div></td> </tr> <tr>   <td> Type word:</td>   <td><input name="word" type="text" size="32"></td></tr> <tr>   <td colspan="2"><? if($word_ok!==false) {     if($word_ok=="yes")     {         echo "you got the word correct.<br />";     } else {         echo "Sorry, that's not the right word, try again.<br />";     } } ?></td> </tr> <tr>   <td colspan="2">I agree to the Terms & Conditions     <input name="tandc" type="checkbox" id="tandc" value="on"></td> </tr> </table> <input name="submit" type="submit" value="submit"> <br /> </form> </body> </html> [/code] and finally the captcha script freecap.php (in need of a little trimming) [code] <? session_start(); $site_tags[0] = "To avoid spam, please do NOT enter the text if"; $site_tags[1] = "this site is not After the Mouse.com"; $site_tags = null; $tag_pos = 1; $rand_func = "mt_rand"; $seed_func = "mt_srand"; $hash_func = "sha1"; $_SESSION['hash_func'] = $hash_func; $output = "gif"; $use_dict = 0; $max_word_length = 6; $col_type = 1; $max_attempts = 10; $font_locations = Array("./.ht_freecap_font1.gdf","./.ht_freecap_font2.gdf","./.ht_freecap_font3.gdf","./.ht_freecap_font4.gdf","./.ht_freecap_font5.gdf"); $bg_type = 1; $blur_bg = true; $bg_images = Array("./.ht_freecap_im1.jpg","./.ht_freecap_im2.jpg","./.ht_freecap_im3.jpg","./.ht_freecap_im4.jpg","./.ht_freecap_im5.jpg");     $merge_type = 1;     $morph_bg = false; $seed_func(make_seed()); switch($bg_type) {     case 0:         break;     case 1:     case 2:         $bg_fade_pct = 65;         break;     case 3:         $bg_fade_pct = 50;         break; } $bg_fade_pct += $rand_func(-2,2); $font_widths = Array(); for($i=0; $i<sizeof($font_locations); $i++) {     $handle = fopen($font_locations[$i],"r");     $c_wid = fread($handle,11);     $font_widths[$i] = ord($c_wid{8})+ord($c_wid{9})+ord($c_wid{10})+ord($c_wid{11});     fclose($handle); } $width = ($max_word_length*(array_sum($font_widths)/sizeof($font_widths))+75); $height = 90; $im = ImageCreate($width, $height); $im2 = ImageCreate($width, $height); if(empty($_SESSION['freecap_attempts'])) {     $_SESSION['freecap_attempts'] = 1; } else {     $_SESSION['freecap_attempts']++;     if($_SESSION['freecap_attempts']>$max_attempts)     {         $_SESSION['freecap_word_hash'] = false;         $bg = ImageColorAllocate($im,255,255,255);         ImageColorTransparent($im,$bg);         $red = ImageColorAllocate($im, 255, 0, 0);         ImageString($im,5,15,20,"service no longer available",$red);         sendImage($im);     } } function make_seed() {     list($usec, $sec) = explode(' ', microtime());     return (float) $sec + ((float) $usec * 100000); } function rand_color() {     global $bg_type,$rand_func;     if($bg_type==3)     {         return $rand_func(10,100);     } else {         return $rand_func(60,170);     } } function myImageBlur($im) {     $width = imagesx($im);     $height = imagesy($im);     $temp_im = ImageCreateTrueColor($width,$height);     $bg = ImageColorAllocate($temp_im,150,150,150);     ImageColorTransparent($temp_im,$bg);     ImageFill($temp_im,0,0,$bg);     $distance = 1;     ImageCopyMerge($temp_im, $im, 0, 0, 0, $distance, $width, $height-$distance, 70);     ImageCopyMerge($im, $temp_im, 0, 0, $distance, 0, $width-$distance, $height, 70);     ImageCopyMerge($temp_im, $im, 0, $distance, 0, 0, $width, $height, 70);     ImageCopyMerge($im, $temp_im, $distance, 0, 0, 0, $width, $height, 70);     ImageDestroy($temp_im);     return $im; } function sendImage($pic) {     global $output,$im,$im2,$im3;     header(base64_decode("WC1DYXB0Y2hhOiBmcmVlQ2FwIDEuNCAtIHd3dy5wdXJlbWFuZ28uY28udWs="));     switch($output)     {         case "jpg":             header("Content-Type: image/jpeg");             ImageJPEG($pic);             break;         case "gif":             header("Content-Type: image/gif");             ImageGIF($pic);             break;         case "png":         default:             header("Content-Type: image/png");             ImagePNG($pic);             break;     }     ImageDestroy($im);     ImageDestroy($im2);     ImageDestroy($pic);     if(!empty($im3))     {         ImageDestroy($im3);     }     exit(); } if($use_dict==1) {     $words = @file($dict_location);     $word = strtolower($words[$rand_func(0,sizeof($words)-1)]);     $word = ereg_replace("[^a-z]","",$word);     $words = "";     unset($words); } else {     $consonants = 'bcdghklmnpqrsvwxyz';     $vowels = 'aeuo';     $word = "";     $wordlen = $rand_func(5,$max_word_length);     for($i=0; $i<$wordlen; $i++)     {         if($rand_func(0,4)>=2 && $i!=0)         {             $word .= $vowels{$rand_func(0,strlen($vowels)-1)};         } else {             $word .= $consonants{$rand_func(0,strlen($consonants)-1)};         }     } } $_SESSION['freecap_word_hash'] = $hash_func($word); $tag_col = ImageColorAllocate($im,10,10,10); $site_tag_col2 = ImageColorAllocate($im2,0,0,0); $debug = ImageColorAllocate($im, 255, 0, 0); $debug2 = ImageColorAllocate($im2, 255, 0, 0); $bg = ImageColorAllocate($im, 254, 254, 254); $bg2 = ImageColorAllocate($im2, 254, 254, 254); ImageColorTransparent($im,$bg); ImageColorTransparent($im2,$bg2); ImageFill($im,0,0,$bg); ImageFill($im2,0,0,$bg2); if($bg_type!=0) {     $im3 = ImageCreateTrueColor($width,$height);     $temp_bg = ImageCreateTrueColor($width*1.5,$height*1.5);     $bg3 = ImageColorAllocate($im3,255,255,255);     ImageFill($im3,0,0,$bg3);     $temp_bg_col = ImageColorAllocate($temp_bg,255,255,255);     ImageFill($temp_bg,0,0,$temp_bg_col);     if($bg_type==1)     {         for($i=$rand_func(6,20); $i<$width*2; $i+=$rand_func(10,25))         {             ImageSetThickness($temp_bg,$rand_func(2,6));             $text_r = $rand_func(100,150);             $text_g = $rand_func(100,150);             $text_b = $rand_func(100,150);             $text_colour3 = ImageColorAllocate($temp_bg, $text_r, $text_g, $text_b);             ImageLine($temp_bg,$i,0,$i,$height*2,$text_colour3);         }         for($i=$rand_func(6,20); $i<$height*2; $i+=$rand_func(10,25))         {             ImageSetThickness($temp_bg,$rand_func(2,6));             $text_r = $rand_func(100,150);             $text_g = $rand_func(100,150);             $text_b = $rand_func(100,150);             $text_colour3 = ImageColorAllocate($temp_bg, $text_r, $text_g, $text_b);             ImageLine($temp_bg,0,$i,$width*2, $i ,$text_colour3);         }     } else if($bg_type==2) {         $bg3 = ImageColorAllocate($im3,255,255,255);         ImageFill($im3,0,0,$bg3);         ImageSetThickness($temp_bg,4);         for($i=0; $i<strlen($word)+1; $i++)         {             $text_r = $rand_func(100,150);             $text_g = $rand_func(100,150);             $text_b = $rand_func(100,150);             $text_colour3 = ImageColorAllocate($temp_bg, $text_r, $text_g, $text_b);             $points = Array();             for($j=1; $j<$rand_func(5,10); $j++)             {                 $points[] = $rand_func(1*(20*($i+1)),1*(50*($i+1)));                 $points[] = $rand_func(30,$height+30);             }             ImagePolygon($temp_bg,$points,intval(sizeof($points)/2),$text_colour3);         }     } else if($bg_type==3) {         for($i=0; $i<sizeof($bg_images); $i++)         {             $temp_im[$i] = ImageCreateFromJPEG($bg_images[$i]);             $temp_width[$i] = imagesx($temp_im[$i]);             $temp_height[$i] = imagesy($temp_im[$i]);         }         $blocksize = $rand_func(20,60);         for($i=0; $i<$width*2; $i+=$blocksize)         {             for($j=0; $j<$height*2; $j+=$blocksize)             {                 $image_index = $rand_func(0,sizeof($temp_im)-1);                 $cut_x = $rand_func(0,$temp_width[$image_index]-$blocksize);                 $cut_y = $rand_func(0,$temp_height[$image_index]-$blocksize);                 ImageCopy($temp_bg, $temp_im[$image_index], $i, $j, $cut_x, $cut_y, $blocksize, $blocksize);             }         }         for($i=0; $i<sizeof($temp_im); $i++)         {             ImageDestroy($temp_im[$i]);         }     }     if($morph_bg)     {         $morph_chunk = $rand_func(1,5);         $morph_y = 0;         for($x=0; $x<$width; $x+=$morph_chunk)         {             $morph_chunk = $rand_func(1,5);             $morph_y += $rand_func(-1,1);             ImageCopy($im3, $temp_bg, $x, 0, $x+30, 30+$morph_y, $morph_chunk, $height*2);         }         ImageCopy($temp_bg, $im3, 0, 0, 0, 0, $width, $height);         $morph_x = 0;         for($y=0; $y<=$height; $y+=$morph_chunk)         {             $morph_chunk = $rand_func(1,5);             $morph_x += $rand_func(-1,1);             ImageCopy($im3, $temp_bg, $morph_x, $y, 0, $y, $width, $morph_chunk);         }     } else {         ImageCopy($im3,$temp_bg,0,0,30,30,$width,$height);     }     ImageDestroy($temp_bg);     if($blur_bg)     {         myImageBlur($im3);     } } $word_start_x = $rand_func(5,32); $word_start_y = 15; if($col_type==0) {     $text_r = rand_color();     $text_g = rand_color();     $text_b = rand_color();     $text_colour2 = ImageColorAllocate($im2, $text_r, $text_g, $text_b); } for($i=0; $i<strlen($word); $i++) {     if($col_type==1)     {         $text_r = rand_color();         $text_g = rand_color();         $text_b = rand_color();         $text_colour2 = ImageColorAllocate($im2, $text_r, $text_g, $text_b);     }     $j = $rand_func(0,sizeof($font_locations)-1);     $font = ImageLoadFont($font_locations[$j]);     ImageString($im2, $font, $word_start_x+($font_widths[$j]*$i), $word_start_y, $word{$i}, $text_colour2); } $font_pixelwidth = $font_widths[$j]; $word_pix_size = $word_start_x+(strlen($word)*$font_pixelwidth); for($i=$word_start_x; $i<$word_pix_size; $i+=$font_pixelwidth) {     $prev_y = $y_pos;     do{         $y_pos = $rand_func(-5,5);     } while($y_pos<$prev_y+2 && $y_pos>$prev_y-2);     ImageCopy($im, $im2, $i, $y_pos, $i, 0, $font_pixelwidth, $height); } ImageFilledRectangle($im2,0,0,$width,$height,$bg2); $y_chunk = 1; $morph_factor = 1; $morph_x = 0; for($j=0; $j<strlen($word); $j++) {     $y_pos = 0;     for($i=0; $i<=$height; $i+=$y_chunk)     {         $orig_x = $word_start_x+($j*$font_pixelwidth);         $morph_x += $rand_func(-$morph_factor,$morph_factor);         ImageCopyMerge($im2, $im, $orig_x+$morph_x, $i+$y_pos, $orig_x, $i, $font_pixelwidth, $y_chunk, 100);     } } ImageFilledRectangle($im,0,0,$width,$height,$bg); $y_pos = 0; $x_chunk = 1; for($i=0; $i<=$width; $i+=$x_chunk) {     $y_pos += $rand_func(-1,1);     ImageCopy($im, $im2, $i, $y_pos, $i, 0, $x_chunk, $height); } myImageBlur($im); if($output!="jpg" && $bg_type==0) {     ImageColorTransparent($im,$bg); } ImageFilledRectangle($im2,0,0,$width,$height,$bg2); if(is_array($site_tags)) {     for($i=0; $i<sizeof($site_tags); $i++)     {         $tag_width = strlen($site_tags[$i])*6;         if($tag_pos==0 || $tag_pos==2)         {             ImageString($im2, 2, intval($width/2)-intval($tag_width/2), (10*$i), $site_tags[$i], $site_tag_col2);         }         if($tag_pos==1 || $tag_pos==2)         {             ImageString($im2, 2, intval($width/2)-intval($tag_width/2), ($height-34+($i*10)), $site_tags[$i], $site_tag_col2);         }     } } ImageCopyMerge($im2,$im,0,0,0,0,$width,$height,80); ImageCopy($im,$im2,0,0,0,0,$width,$height); if($bg_type!=0) {     if($bg_type!=3)     {         $temp_im = ImageCreateTrueColor($width,$height);         $white = ImageColorAllocate($temp_im,255,255,255);         ImageFill($temp_im,0,0,$white);         ImageCopyMerge($im3,$temp_im,0,0,0,0,$width,$height,$bg_fade_pct);         ImageDestroy($temp_im);         $c_fade_pct = 50;     } else {         $c_fade_pct = $bg_fade_pct;     }     if($merge_type==1)     {         ImageCopyMerge($im3,$im,0,0,0,0,$width,$height,100);         ImageCopy($im,$im3,0,0,0,0,$width,$height);     } else {         ImageCopyMerge($im,$im3,0,0,0,0,$width,$height,$c_fade_pct);     } } $tag_str = "After the Mouse.Com"; $tag_width = strlen($tag_str)*6; ImageString($im, 2, $width-$tag_width, $height-13, $tag_str, $tag_col); unset($word); unset($use_dict); unset($dict_location); unset($max_word_length); unset($bg_type); unset($bg_images); unset($merge_type); unset($bg_fade_pct); unset($morph_bg); unset($col_type); unset($max_attempts); unset($font_locations); sendImage($im); ?> [/code]
  13. Hello All, First things first i am DYSLEXIC... so please make any replies as clear as possible, by this i mean in english as oposed to techie where possible... many thanks. My reunion site has been a flat site for years and is now going dynamic thanks to PHP and MySQL. a friend has done much of the work for me and has sent me back a zipped PHP website which i have opened and unpacked successfully into my apache htdocs file and it works well. my issue is with the SQL file (a dump file i think you'd call it?) i am trying to put it all back together. i think(?) the information i need to link it is... $dbconn = mysql_connect("localhost","ABC","ABC123"); mysql_select_db("dlp"); what i need to know is how to unpack the dump file, where to save it relative to the website and if possible how to fill in the database connections for a testing server on my machine in Dreamweaver. Many thanks in advance forgot to mention, i cant ask my friend who did the work for me, at the moment as he's on honeymoon....
  14. [!--quoteo(post=327459:date=Dec 14 2005, 04:45 PM:name=moberemk)--][div class=\'quotetop\']QUOTE(moberemk @ Dec 14 2005, 04:45 PM) 327459[/snapback][/div][div class=\'quotemain\'][!--quotec--] HTML and Body tags aren't supposed to go into include files. Just where is it that these files are dissapearing from? The include files or the file including them? in answer to the question, no the tags are not in the include files but in the "template" pade into which i am pulling the includes... many thanks for your attention tho Mouse
  15. Disappearing </html> and </body> tags Hello all, Any ideas? I have been chopping the 3 column left nav CSS template into PHP include files to make a change to PHP/MySQL run a little easier but when I create the footer file the remaining code, the </html> and </body> tags disappear. The only way I can keep them in place is to add a <!-- Grrrr --> comment as the last line in the whole code. Any ideas why it is doing this… it’s driving me mad!!!! i dont think the comment "Grrr" is propper code but hey DW seems to understand my feelings on this... Mouse
  16. hi all, i had a more php literate friend help on my project and he has worked wonders.... BUT, he has gone away for a week or two and he has just mailed me my site as a zip file (now unzipped and sitting in my local host) and a sql dump file... how do i put them together again? i have PHPMyAdmin or an evaluation copy of Navicat and or Dreamweaver to help here... any ideas? Mouse
  17. [!--quoteo(post=318369:date=Nov 14 2005, 03:19 PM:name=Leipe_Po)--][div class=\'quotetop\']QUOTE(Leipe_Po @ Nov 14 2005, 03:19 PM) 318369[/snapback][/div][div class=\'quotemain\'][!--quotec--] well i'm a firm beliver that its (allways)better to make it yourself, this way you can insert any option you need without the bloat, and without the price My Php aint all that hot yet... we shall see, but for now i may have to buy my forum... any other contenders? Mouse
  18. Which Forum software? As with any software it would be nice to believe that it does what it says on the box (or web site…) but alas, it is never so. Ladies and gentlemen, boys and girls I need your recommendations for a forum script. It needs to meet the following criteria and I would value your opinions. 1. Customisable: I want it to visually blend into the site so colours, fonts and graphics need to be adjustable. 2. Administration: for now it’s just me running the site so easy admin would be a boon. 3. Filtering: being able to filter out some of the less suitable language. As I said on a few other forums I have a site which when relaunched will be aimed at a targeted adult audience (not that ADULT, just not for children) but by the very nature of the site they will come… and I have a script that strips email addresses from posts but having this built in would be a boon. 4. Membership: either a separate login or preferably using the main sites user login. 5. open source, freeware or dirt cheap would be good but if the right software has a price then ok…. Once again, I am indebted to you Mouse
  19. <div id="sectionLinks"> <h3>Section Links</h3> <ul> <li><a href="Page1.htm”>Page1</a></li> <li><a href="Page2.htm">Page 2</a></li> <li><a href="Page3.htm">Page 3</a></li> <li><a href="Page3.htm">Page 4</a></li> <li><a href="Page3.htm">Page 5</a></li> <li><a href="Page3.htm">Page 6</a></li> </ul> </div> <div class="relatedLinks"> <h3>Community Links </h3> <ul> <li><a href="tellafriend.php">Tell a friend</a></li> <li><a href="help.htm">Need help?</a></li> <li><a href="donate.htm">Please Donate</a></li> </ul> </div> Hello, quick question… The above is a section from my site, it makes up the links found down the left hand navigation column. As there are an ever-increasing number of pages, but all of them share this code in common. I assume that there is a way of calling the links from an external file so that I can change just one file and have the changes cascade across the site. How do I format the text for both the lines of code to call in the external links and how do I format the lines of code in the external file? And lastly will any of this be affected by being used on HTML and PHP pages??? Mouse
×
×
  • 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.