Current location: Hot Scripts Forums » Advertising Forums » Job Offers & Assistance » Speed increase needed


Speed increase needed

Reply
  #1 (permalink)  
Old 12-23-07, 02:29 PM
staticfire's Avatar
staticfire staticfire is offline
Wannabe Coder
 
Join Date: May 2007
Location: Stockton, England
Posts: 223
Thanks: 0
Thanked 1 Time in 1 Post
Exclamation Speed increase needed

I have nearly completed a website that i have been working on since march. The site is looking pretty good and everything works properly but for a few months now i've been getting problems with the site being slow and sometimes taking up to 15 minutes to load a page I have managed to locate where this slowness is happening and there seems to be 2 scripts that are causing it. Now i don't know how I can increase the speed of them because i just code, i don't ever try to reduce execution time of scripts or anything like that. Could anyone assist me with this? Sorry but i can't offer money for it since i can't afford to but maybe you can think of some other way i can repay you. Here are the scripts that are causing my site to be slow:

I keep getting the error: Maximum execution time of 30 seconds exceeded in e:\domains\s\staticfire.co.uk\user\htdocs\index.ph p on line 4 quite often and on line 4 is this:

include("bbcode.php");

And here is the bbcode script:

PHP Code:

<?php 


function bbcode($comment){

$bbcode = array(

  
"/\[url\](.*?)\[\/url\]/",
  
"/\[img\](.*?)\[\/img\]/",
  
"/\[B\](.*?)\[\/B\]/",
  
"/\[b\](.*?)\[\/b\]/",
  
"/\[U\](.*?)\[\/U\]/",
  
"/\[u\](.*?)\[\/u\]/",
  
"/\[I\](.*?)\[\/I\]/",
  
"/\[i\](.*?)\[\/i\]/",
  
"/\[quote\](.*?)\[\/quote\]/",
  
"/\[quote=(.*?)\](.*?)\[\/quote\]/",
  
"/\[code\](.*?)\[\/code\]/",
  
"/\[s\](.*?)\[\/s\]/",
  
"/\[S\](.*?)\[\/S\]/",
  
"/\[url=(.*?)\](.*?)\[\/url\]/",
  
"/\[colour=(.*?)\](.*?)\[\/colour\]/",
  
"/\[size=(.*?)\](.*?)\[\/size\]/",
  
"/\[scroll\](.*?)\[\/scroll\]/",
  
"/\[youtube\](.*?)\[\/youtube\]/",
  
"/\[music\](.*?)\[\/music\]/",

"/\:\)/",
"/\:\(/",
"/\:o/",
"/\:p/",
"/\:\(/",
"/\:D/",
"/\;D/",
"/\:\(/"

);

$replacements = array(

'<a href="\\1">\\1</a>',
'<img border="0" src="\\1">',
'<b>\\1</b>',
'<b>\\1</b>',
'<u>\\1</u>',
'<u>\\1</u>',
'<i>\\1</i>'
'<i>\\1</i>'
'<div class="quote"><font color="#7EB6FF"><b>Quote:</b></font><br><i>\\1</i></div>'
'<div class="quote"><font color="#7EB6FF"><b>Quoted from: \\1</b></font><br><i>\\2</i></div>'
'<div class="quote"><font color="#7EB6FF"><b>Code:</b></font><br><i>\\1</i></div>'
'<s>\\1</s>',
'<s>\\1</s>',
'<a href="\\1" target="_blank">\\2</a>',
'<font color="\\1">\\2</font>',
'<font size="\\1">\\2</font>',
'<marquee>\\1</marquee>',


'<object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/\\1&rel=0&color1=0x006699&color2=0x54abd6&border=0"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/\\1&rel=0&color1=0x006699&color2=0x54abd6&border=0" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>',
'<embed src="\\1" height="45" autostart="true" loop="false">',

//emoticons

"<img src=\"/images/smilies/smile.png\" border=\"0\">",
"<img src=\"/images/smilies/sad.png\" border=\"0\">",
"<img src=\"/images/smilies/shocked.png\" border=\"0\">",
"<img src=\"/images/smilies/tounge.png\" border=\"0\">",
"<img src=\"/images/smilies/unsure.png\" border=\"0\">",
"<img src=\"/images/smilies/laugh.png\" border=\"0\">",
"<img src=\"/images/smilies/grin.png\" border=\"0\">",
"<img src=\"/images/smilies/angry.png\" border=\"0\">"

);

$comment_coded preg_replace($bbcode,$replacements,$comment);

return 
$comment_coded;

}
 
?>
Another issue is with the script to show active users on the site. It is actually setup using ajax and a timer which updates it every 10 seconds. After about a minute it will just freeze and stop working and i don't understand why. I tried removing each query and i managed to find that it was this one causing the problem:

PHP Code:

   $result mysql_query("UPDATE active SET time=CURTIME(),timeout=ADDTIME(CURTIME(), '00:10:00') WHERE loginname='$loginname'"
    or die(
mysql_error()); 
If anybody knows why either of those scripts are causing my site to go extreamly slow or what can be done to stop the slowness the please reply. Also if you need me to provide any more information so you can help then please ask.

-Thanks for your time
__________________
Visit http://www.staticfire.co.uk
Reply With Quote
  #2 (permalink)  
Old 01-18-08, 11:48 AM
eric418 eric418 is offline
Newbie Coder
 
Join Date: Aug 2004
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Is the problem still here?
__________________
joborate.com
1000+ Creative & Tech Jobs
esoftpro.com
Complete Web Services
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Download speed estimator bittyboy Script Requests 3 09-18-06 07:56 AM
Programmer Needed for File hosting script! Fabolous Job Offers & Assistance 3 06-15-06 10:56 PM
Speed dating franchise script needed depotbod Script Requests 0 03-09-06 05:14 AM
Improve MATH calculation speed & DI scores today- CrackMATH from IIT and IIM alumni mbasushil General Advertisements 0 12-16-04 04:29 AM
Need to Increase Your Sales? London General Advertisements 0 07-12-04 04:24 PM


All times are GMT -5. The time now is 12:59 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.