Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by carbonize

  1. and the resulting errors pointed to a permissions problem with the 1nc_alerts.php file. It appears that the server is not allowing me to change the permissions on that file. So I'll need to contact the host and have them do it.


    Yet another reason why TotalChoice Hosting is tops. With cPanel, I never would have this problem on any of my sites that are hosted here.

    Trust me it happens on TC as well. I have had to submit a ticket before now due to files/folders I could not delete.


    Sometimes if you create a file using PHP you cannot touch it using FTP (not saying this happens on TC these days).

  2. How the heck do you tell it to show old posts when viewing a forum? I'm getting fed up of seeing No topics were found. This is either because there are no topics in this forum, or the topics are older than the current age cut-off. with no obvious way of changing the age cut off.

  3. Trillian Astra is OK but I keep going back to Digsby. Just got used to the way Digsby lets me handle emails such as reporting spam. Digsby does have it's faults such as limited smileys and largish footprint but I've just gone right off Trillian especially given that Astra has taken what? 4 or 5 years just to get to this stage?

  4. Or of course just escape the quotes like \"


    echo "<table width=\"100%\" align=\"center\" border=\"0\" cellpadding=\"5\" cellspacing=\"1\">\n<tr valign=\"top\" align=\"center\">\n";


    But my personal preference is to always use single quotes when possible for PHP strings since it gives a slight speed boost compared to double quotes. This is because PHP scans double quotes strings for variables and special characters (like \n) but with single quotes it only looks for \'. Whilst the speed difference with a single string is negligible imagine outputting a whole scripts worth. This is why Bob's method is preferable.


    Oh and always wrap your html attributes in double quotes. That is the standard.

  5. You could try installing beta 2 of IE 8 but remember to have it set to run in IE7 compatiability mode otherwise a lot of sites will look errrr screwed.


    BTW have you done the recent security update? If so has that made any difference?

  6. Yes you don't really say what the problem is. One problem I have found with using CSS for image rollovers is that the browser seems to download the image each time and so you get an obvious delay unless you include the picture somewhere else on the page but say with dimensions of 1x1.

  7. Quick function for you (assuming you only want jpg images).


    >function image_Resize($source, $newwidth, $newHeight, $fileDestination, $newName)
     $size = @getimagesize($source);
     if ($size[0] > $newWidth) 
    $newImgHeight = ($newWidth / $size[0]) * $size[1];
    $newImgWidth = $newWidth;
    if ($newImgHeight > $newHeight) 
      $newImgWidth = ($newHeight / $newImgHeight) * $newImgWidth;
      $newImgHeight = $newHeight;
     elseif ($size[1] > $newHeight) 
    $newImgWidth = ($newHeight / $size[1]) * $size[0];
    $newImgHeight = $newHeight;
    if ($newImgWidth > $newWidth) 
      $newImgHeight = ($newWidth / $newImgWidth) * $newImgHeight;
      $newImgWidth = $newWidth;
    $newImgWidth = $size[0];
    $newImgHeight = $size[1];
     $newImgWidth = round($newImgWidth);
     $newImgHeight = round($newImgHeight);
     $im = imagecreatefromjpeg($source);
     $new_im = imagecreatetruecolor($newImgWidth,$newImgHeight);
     imagejpeg($new_im,$fileDestination.'/'.$newName,90);  // Have set quality to 90 although 80 produces acceptible quality and smaller files.


    Just use that to create the resized copy and once you have made your thumbnail and other two images just use unlink($image) to delete the uploaded image.


    Oh yeah you will probably have to move the file from the temporary upload folder to one on your site before you can do anything with it.

  8. Just a cut down example of how Lazarus now deals with it


    >if (get_magic_quotes_gpc())  // Check if server is adding slashes to submitted data and if so strip them
      $this->name = stripslashes($this->name);
      $this->location = stripslashes($this->location);
    // Now that we have slashless variables we can add slashes 
    $this->name = mysql_real_escape_string($this->name);
    $this->location = mysql_real_escape_string($this->location);

  9. I switched to the mysql_real_escape_string method and it seems to have fixed things. Doesn't answer the question as to why the server has started to say get_magic_quotes_gpc is true and yet not be adding slashes to the submitted data.

  10. I only check if GPC is on and then addslashes as required or rather Advanced Guestbook did and I never saw any reason to change it. Does mysql_real_escape_string automatically check if the string is already slashed?


    BTW that doesn't really answer the question of why it doesn't always work.



    <edit>Actually whilst magic_quotes_gpc is deprecated get_magic_quotes_gpc is not</edit>

  11. Ok my script checks if GPC is enabled and adds slashes if needs be. But for some reason I occasionally receive MySQL error emails where the post contains a ' which then breaks the query since I put the message in between single quotes. Any ideas?


    >	  if (!get_magic_quotes_gpc())
    	 $this->name = addslashes($this->name);
    	 $this->location = addslashes($this->location);
    	 $this->aim = addslashes($this->aim);
    	 $this->msn = addslashes($this->msn);
    	 $this->yahoo = addslashes($this->yahoo);
    	 $this->skype = addslashes($this->skype);
    	 $this->email = addslashes($this->email);
    	 $this->url = addslashes($this->url);
    	 $this->comment = addslashes($this->comment);
    	 $this->gender = addslashes($this->gender);


    Just to show that I am checking and adding slashes as needed.

  12. I assume you are all on 1.1.17 and so I recommend either the reCaptcha package or the Advanced Captcha package. Both of which should help stop the spam.


    I'm running SMF 2 beta 4 and it has additional anti spam options such as making them answer a random question (that you set) along with the captcha or even instead of it. There is also the Askimet package you might want to look at.


    BTW I disabled anti spam on my forum for 30 seconds the other day when updating and received 7 spam posts in that time. Both my forums and guestbook are under constant attack but thankfully they never get through.

  13. I really appreciate the help.. it should have been evident.. but my brain just wasn't working... thank goodness for TCH forums! :thumbup1:

    Sounds like my brain most days.


    Just like to thank Thomas for the help he provided here.


    Oh and take a look at whats coming in Lazarus 1.10 - http://carbonize.co.uk/Guestbook


    New features include:

    Lightbox style viewing of users pics


    Smileys now shown in a draggable pop up smiley box

    Auto enlarging textareas in admin



    I need a life

  • Create New...