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

02-06-2004, 04:52 AM
|
 |
v7n Mentor
Latest Blog: None
|
|
Join Date: 10-13-03
Location: UK
Posts: 2,469
|
|
|
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?
|

02-06-2004, 04:56 AM
|
 |
v7n Mentor
Latest Blog: None
|
|
Join Date: 10-13-03
Location: UK
Posts: 2,469
|
|
|
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?
|

02-06-2004, 02:31 PM
|
 |
v7n Mentor
|
|
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,527
|
|
|
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]
|

02-06-2004, 02:46 PM
|
 |
v7n Mentor
Latest Blog: None
|
|
Join Date: 10-13-03
Location: UK
Posts: 2,469
|
|
|
gettext.php should be gettext.txt unless u want it to be processed
|

02-06-2004, 03:53 PM
|
 |
v7n Mentor
|
|
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,527
|
|
|
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.
|

02-06-2004, 04:02 PM
|
 |
v7n Mentor
Latest Blog: None
|
|
Join Date: 10-13-03
Location: UK
Posts: 2,469
|
|
|
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!"
|

02-06-2004, 04:33 PM
|
 |
v7n Mentor
|
|
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,527
|
|
yeah that too
|

02-06-2004, 05:41 PM
|
|
Contributing Member
|
|
Join Date: 10-12-03
Location: Cranberry Township
Posts: 224
|
|
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.
|

02-06-2004, 05:58 PM
|
 |
v7n Mentor
Latest Blog: None
|
|
Join Date: 10-13-03
Location: UK
Posts: 2,469
|
|
|
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.
|

02-06-2004, 06:13 PM
|
 |
v7n Mentor
|
|
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,527
|
|
|
could just have it do it once a week or day.. simple to do with timestamps.
|

02-06-2004, 06:17 PM
|
 |
v7n Mentor
Latest Blog: None
|
|
Join Date: 10-13-03
Location: UK
Posts: 2,469
|
|
|
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).
|

02-06-2004, 06:19 PM
|
 |
v7n Mentor
|
|
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,527
|
|
|
well if its for his phpbb theme he is making..
|

02-06-2004, 06:33 PM
|
 |
v7n Mentor
Latest Blog: None
|
|
Join Date: 10-13-03
Location: UK
Posts: 2,469
|
|
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?
|

02-06-2004, 06:35 PM
|
 |
v7n Mentor
|
|
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,527
|
|
|
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..
|

02-06-2004, 06:43 PM
|
 |
v7n Mentor
Latest Blog: None
|
|
Join Date: 10-13-03
Location: UK
Posts: 2,469
|
|
what?
try sentances, not thought-fragments!
|

02-06-2004, 06:49 PM
|
 |
v7n Mentor
|
|
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,527
|
|
|
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..
|

02-06-2004, 08:25 PM
|
|
Banned
Latest Blog: None
|
|
Join Date: 01-23-04
Posts: 1,098
|
|
|
I understood his thought fragments. Must be a coders thing
|

02-06-2004, 11:17 PM
|
 |
Senior Member
Latest Blog: None
|
|
Join Date: 10-09-03
Posts: 4,284
|
|
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)
|

02-07-2004, 03:06 AM
|
 |
v7n Mentor
Latest Blog: None
|
|
Join Date: 10-13-03
Location: UK
Posts: 2,469
|
|
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....?
|

02-07-2004, 07:14 AM
|
 |
v7n Mentor
|
|
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 2,527
|
|
[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
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
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
|
|
|