What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Can someone edit this script?

Pages: (3): « First « 1 [ 2 ] 3 » Last »
Can someone edit this script?
Author: Message:
.Roy
Veteran Member
*****

Avatar

Posts: 1526
Reputation: 11
20 / Male / –
Joined: Aug 2004
O.P. RE: Can someone edit this script?
ok madman thanks for the script ill try it out now!

Edit:
Fatal error: Call to undefined function: scandir() in /home/hobbes/public_html/strip.php on line 10

This post was edited on 03-26-2005 at 01:49 PM by .Roy.
03-26-2005 01:48 PM
Profile PM Web Find Quote Report
Plik
Veteran Member
*****

Avatar

Posts: 1489
Reputation: 46
35 / Male / –
Joined: Jun 2004
RE: Can someone edit this script?
Im guessing your host doesnt have php 5 installed. Can you confirm this?
03-26-2005 01:50 PM
Profile PM Find Quote Report
.Roy
Veteran Member
*****

Avatar

Posts: 1526
Reputation: 11
20 / Male / –
Joined: Aug 2004
O.P. RE: Can someone edit this script?
Ill ask my host now

edit: No it doesnt support php5. Maybe u can do it with another version of php?
edit # 2: PHP Version 4.3.10

This post was edited on 03-26-2005 at 01:56 PM by .Roy.
03-26-2005 01:52 PM
Profile PM Web Find Quote Report
Plik
Veteran Member
*****

Avatar

Posts: 1489
Reputation: 46
35 / Male / –
Joined: Jun 2004
RE: RE: Can someone edit this script?
quote:
Originally posted by Hobbes
Ill ask my host now

edit: No it doesnt support php5. Maybe u can do it with another version of php?

Done
code:
<?php
if(!isset($_GET['num']) OR $_GET['num'] < 1){//If the input is less than one correct it
$num = "1";
}
else{
$num = $_GET['num'];//Only use the get varible if it exists or is >1
}
?>
<img src="http://www.hobbes.weirdfish.net/strips/strip<?echo $num;?>.jpg" alt="strip<?echo $num;?>.jpg error" /><br />
<?php
//first we count the files in the strips
$fileno = count_files("strips");
if($num < $fileno){//If we are on the last line dont echo a link other wise do
$next = $num + 1;
echo "<a href=\"http://hobbes.weirdfish.net/strip.php?num=" . $next  . "\">Forward</a> - ";
}
if($num > 1){//check to see if the number is greater than one, if so echo the back link
$prev = $num - 1;
echo "<a href=\"http://hobbes.weirdfish.net/strip.php?num=" . $prev . "\">Back</a>";
}
//other wise just dont echo anything

//file counting function
function count_files($dir){
$dh = opendir($dir);
$files = array();
while (false !== ($filename = readdir($dh))) {
$files[] = $filename;
}
sort($files);
array_splice($files, 0, 2);
$filesnum = count($files);
return $filesnum;
}
?>



This post was edited on 03-26-2005 at 02:32 PM by Plik.
03-26-2005 01:57 PM
Profile PM Find Quote Report
.Roy
Veteran Member
*****

Avatar

Posts: 1526
Reputation: 11
20 / Male / –
Joined: Aug 2004
O.P. RE: Can someone edit this script?
Still an error

Parse error: parse error, unexpected T_STRING in /home/hobbes/public_html/strip.php on line 21
03-26-2005 02:01 PM
Profile PM Web Find Quote Report
Plik
Veteran Member
*****

Avatar

Posts: 1489
Reputation: 46
35 / Male / –
Joined: Jun 2004
RE: Can someone edit this script?
i made a typo on function :banana:
i edited my post and fixed it
03-26-2005 02:03 PM
Profile PM Find Quote Report
.Roy
Veteran Member
*****

Avatar

Posts: 1526
Reputation: 11
20 / Male / –
Joined: Aug 2004
O.P. RE: Can someone edit this script?
Hmm thanks but..   http://hobbes.weirdfish.net/strip.php
well see for yourself :D. Maybe you should test it :D

This post was edited on 03-26-2005 at 02:05 PM by .Roy.
03-26-2005 02:04 PM
Profile PM Web Find Quote Report
Plik
Veteran Member
*****

Avatar

Posts: 1489
Reputation: 46
35 / Male / –
Joined: Jun 2004
RE: Can someone edit this script?
Ive updated it fixing the bug and making it look not so dodgy with the links on a new line and a - seperating them.
03-26-2005 02:23 PM
Profile PM Find Quote Report
.Roy
Veteran Member
*****

Avatar

Posts: 1526
Reputation: 11
20 / Male / –
Joined: Aug 2004
O.P. RE: Can someone edit this script?
"hopefully this works" one second

edit: Works great! Now ill edit how it looks and stuff :D
Thanks Madman. BTW where did u learn html from?
edit #2: Actually when i get over 35 everyone is missing. Because 35 for now is the last one. Can u make it auto detect which is the last one. Like you did with the first one being 1

This post was edited on 03-26-2005 at 02:27 PM by .Roy.
03-26-2005 02:23 PM
Profile PM Web Find Quote Report
Plik
Veteran Member
*****

Avatar

Posts: 1489
Reputation: 46
35 / Male / –
Joined: Jun 2004
RE: Can someone edit this script?
Started from a learn to program for dummies book, then from http://www.w3schools.com and i learnt php by looking at others code and from http://www.php.net

quote:
Originally posted by Hobbes
edit #2: Actually when i get over 35 everyone is missing. Because 35 for now is the last one. Can u make it auto detect which is the last one. Like you did with the first one being 1

Updated it again

This post was edited on 03-26-2005 at 02:33 PM by Plik.
03-26-2005 02:27 PM
Profile PM Find Quote Report
Pages: (3): « First « 1 [ 2 ] 3 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On