Webmaster Forum


Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #21 (permalink)  
Old 02-06-2004, 04:52 AM
LazyJim's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 10-13-03
Location: UK
Posts: 2,469
iTrader: 0 / 0%
eddie usually i'm with u all the way on the client-side processing - but recently I've been doing everything i can to avoid RELYING on the client's technology.

How do you expect to use JavaScript to check Juggo's server for updated content?
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
 
Reply With Quote
  #22 (permalink)  
Old 02-06-2004, 04:56 AM
LazyJim's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 10-13-03
Location: UK
Posts: 2,469
iTrader: 0 / 0%
Juggo do all the clients you are talking about use PHP-based forums?

You are after:
- ability to update the buton on their site that links back to u just by changing the file(s) on your server;
- resilience against your server being down.
correct?
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
 
Reply With Quote
  #23 (permalink)  
Old 02-06-2004, 02:31 PM
kwvarga's Avatar
v7n Mentor
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,527
iTrader: 0 / 0%
i mean you could always do.

[code:1:83f851fbd2]
$juggoconn = @fopen("http://www.juggopop.com/gettext.php", "r");
if (!$juggoconn) {
echo "<a href="http://www.juggopop.com">JuggoPop</a>";
} else {
// fget stuff..
}[/code:1:83f851fbd2]
 
Reply With Quote
  #24 (permalink)  
Old 02-06-2004, 02:46 PM
LazyJim's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 10-13-03
Location: UK
Posts: 2,469
iTrader: 0 / 0%
gettext.php should be gettext.txt unless u want it to be processed
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
 
Reply With Quote
  #25 (permalink)  
Old 02-06-2004, 03:53 PM
kwvarga's Avatar
v7n Mentor
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,527
iTrader: 0 / 0%
well yeah.. i just think leaving it as PHP would be best so you can do stuff more later.. like if you want to add a counter on how many ppl see it.. etc.
 
Reply With Quote
  #26 (permalink)  
Old 02-06-2004, 04:02 PM
LazyJim's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 10-13-03
Location: UK
Posts: 2,469
iTrader: 0 / 0%
true it would leave that option open...
...then again u could give it anything like ".might_be_php" and then use .htaccess to say "yo server, please process my fiels ending in '.might_be_php' cheers!"
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
 
Reply With Quote
  #27 (permalink)  
Old 02-06-2004, 04:33 PM
kwvarga's Avatar
v7n Mentor
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,527
iTrader: 0 / 0%
yeah that too
 
Reply With Quote
  #28 (permalink)  
Old 02-06-2004, 05:41 PM
Contributing Member
 
Join Date: 10-12-03
Location: Cranberry Township
Posts: 224
iTrader: 0 / 0%
Quote:
Originally Posted by LazyJim
eddie usually i'm with u all the way on the client-side processing - but recently I've been doing everything i can to avoid RELYING on the client's technology.
The point is, server side is a good thing, but the problem here comes into the fact that this will not die gracefully when the intermediate page is not accessible. There will be more than likely a 30 second delay when the server is not accessible for whatever reason, even by surpressing the error. At the very least I would not do an include, but rather go to the socket and look at the headers returned first and then processing it. Just including a file from a different server is lazy and will give very unpredictable results;)

Can it be done in PHP or Perl, sure, but does it need to be is the question that I am asking. You are #1 relying on the fact that the server uptime is 100% with no real fall back if not. #2, you are saying that you are going to process something on every page view of several different forums which will lead to a drain in performance on the original server.
__________________
Web 2.0 Style
 
Reply With Quote
  #29 (permalink)  
Old 02-06-2004, 05:58 PM
LazyJim's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 10-13-03
Location: UK
Posts: 2,469
iTrader: 0 / 0%
the latest solution with a text file, so will only be an access to Juggo's server, not a process as well.
True that could amount to A LOT as many forums will be requesting the file many times.

Please tell me exaclty what does the client side script do?

Currently the forums are using an image for the button, and the image src points to juggo's server.
So he is already relying on 100% uptime for a working button. At least with PHP, when juggo's server is down a backup button can be printed instead.


If u wanna get really contraversial...
use an IFRAME for the button, the src can be a small html file on juggo's server, and each web browser would cache it too.
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
 
Reply With Quote
  #30 (permalink)  
Old 02-06-2004, 06:13 PM
kwvarga's Avatar
v7n Mentor
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,527
iTrader: 0 / 0%
could just have it do it once a week or day.. simple to do with timestamps.
 
Reply With Quote
  #31 (permalink)  
Old 02-06-2004, 06:17 PM
LazyJim's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 10-13-03
Location: UK
Posts: 2,469
iTrader: 0 / 0%
yeah i know
But then u have to use the intermediate file on the forum servers - the one that remembers when it was last updated and stores the most resent code (ready to be printed into the forum).
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
 
Reply With Quote
  #32 (permalink)  
Old 02-06-2004, 06:19 PM
kwvarga's Avatar
v7n Mentor
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,527
iTrader: 0 / 0%
well if its for his phpbb theme he is making..
 
Reply With Quote
  #33 (permalink)  
Old 02-06-2004, 06:33 PM
LazyJim's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 10-13-03
Location: UK
Posts: 2,469
iTrader: 0 / 0%
Quote:
Originally Posted by theSpear
well if its for his phpbb theme he is making..
.. then u could look at it 2 ways:
#1 the forums already doing a lot of php work so it wont matter; or
#2 the forums already doing a lot of php work so lets not make it work any harder!

question is, which is the right?
It probably depends on the amount of use each forum has, would heavily used ones have a massive performance hit?
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
 
Reply With Quote
  #34 (permalink)  
Old 02-06-2004, 06:35 PM
kwvarga's Avatar
v7n Mentor
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,527
iTrader: 0 / 0%
no.. to connect to a site.. could even put a timeout of like 1 on it.. and then get a small string... thats like nothing.. cause problems on ppl running it from home servers..
 
Reply With Quote
  #35 (permalink)  
Old 02-06-2004, 06:43 PM
LazyJim's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 10-13-03
Location: UK
Posts: 2,469
iTrader: 0 / 0%
what?
try sentances, not thought-fragments!
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
 
Reply With Quote
  #36 (permalink)  
Old 02-06-2004, 06:49 PM
kwvarga's Avatar
v7n Mentor
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,527
iTrader: 0 / 0%
Okay, I will try.
It takes relatively no time at all to connect to a server and retrieve a string. If we set the timeout on the script to something around 1 to 2 seconds then even if Juggo's server was down it would not take long. The biggest delay would people running it from home servers.. like on cable and below which would take a second or two to connect..
 
Reply With Quote
  #37 (permalink)  
Old 02-06-2004, 08:25 PM
sim sim is offline
Banned
Latest Blog:
None

 
Join Date: 01-23-04
Posts: 1,098
iTrader: 0 / 0%
I understood his thought fragments. Must be a coders thing
 
Reply With Quote
  #38 (permalink)  
Old 02-06-2004, 11:17 PM
JuggoPop's Avatar
Senior Member
Latest Blog:
None

 
Join Date: 10-09-03
Posts: 4,284
iTrader: 0 / 0%
Quote:
Originally Posted by LazyJim
Juggo do all the clients you are talking about use PHP-based forums?

You are after:
- ability to update the buton on their site that links back to u just by changing the file(s) on your server;
- resilience against your server being down.
correct?
yes. doesn't even "have" to be an image... could just be a link.

for example... i have made skins in the past that link to "JuggoPop Artist Community"... that doesn't exist... I would like to be able to change it to "JuggoPop Photoshop Tutorials" or whatever... without having to bother the site owner asking for them to change their overall footers or even worse where people have no clue what that is because I FTP'd everthing for them the first time... I would have to ask for their FTP info just for one link.

Plus I want to eventually release some public skins for download... and I want to have some type of nice "link system" in place for any future changes. I'd be willing to comment about what the code does so that if someone didn't like the idea they could change it to a basic link (that would be in there just commented out)

 
Reply With Quote
  #39 (permalink)  
Old 02-07-2004, 03:06 AM
LazyJim's Avatar
v7n Mentor
Latest Blog:
None

 
Join Date: 10-13-03
Location: UK
Posts: 2,469
iTrader: 0 / 0%
Quote:
Originally Posted by theSpear
The biggest delay would people running it from home servers.. like on cable and below which would take a second or two to connect..
what? oh do you mean people serving their site from a home host machine?

So by the sounds of it, doing what I said with a single txt file on Juggo's server would be fine, no need for the intermediate file. Combine that with Spear's nifty error tollerant code, and hey presto!


I still want to hear eddie's JavaScript idea....?
__________________

-LJ-

My advice is to look at each case individually, with an informed mind and an appropriately balanced and objective viewpoint.

Web Design and Development, Ipswich, UK.
My deviantArt
 
Reply With Quote
  #40 (permalink)  
Old 02-07-2004, 07:14 AM
kwvarga's Avatar
v7n Mentor
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,527
iTrader: 0 / 0%
[code:1:92c47952bc]
function getNew();
$url = "www.juggopop.com";
$file = "/mylink.txt";
$fp = @fsockopen($url, 80, $errno, $errstr, 1);
if (!$fp) {
printOld;
} else {
$out = "GET " . $file . " HTTP/1.1\r\n";
$out .= "Host: " . $url . "\r\n";
$out .= "Connection: Close\r\n\r\n";
fputs($fp, $out);
$line = fgets($fp, 128);
if (strstr($line, "http://") >= 0) {
echo $line;
} else {
printOld();
}
fclose($fp);
}
}
function printOld() {
$Jtable = $prefix . "juggo";
$sql = "SELECT line FROM " . $Jtable;
$db->sql_query($sql);
if ($db->affectedrows() == 0) {
$sql = "CREATE TABLE " . $Jtable . " (line (TEXT) dat (INT))";
$result = $db->sql_query($sql);
$sql = "INSERT INTO " . $Jtable . " (line, dat) VALUES ("<a href="http://www.juggopop.com">JuggoPop</a>", 1)";
$result = $db->sql_query($sql);
echo "<a href="http://www.juggopop.com">JuggoPop</a>";
} else {
$sql = "SELECT line FROM " . $Jtable;
while( $Jrow = $db->sql_fetchrow($result) )
{
$juggoline = $Jrow['line'];
}
echo [
}
}
}
[/code:1:92c47952bc]

** got kicked off againn finish script later
working on using their mysql database
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i link the button not the box?? CircleOfLinks Web Design Lobby 2 02-21-2007 04:44 AM
php coding, java coding, webdesign, windows coding... SVB SEO Forum 5 02-24-2004 10:25 AM
Tell me about coding of button. sachin0404 Web Design Lobby 2 01-30-2004 08:45 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 06:16 AM.
Powered by vBulletin
Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.