![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
King of Portal
|
PHP forum script
In case anyone is interested in how to begin writing a forum in PHP if you don't have database support, I created a very basic forum on my personal website Jolly Roger's Ship. Go to the Forum page and check it out. Then just post back here if you'd like to see how I did it. It works with 7 separate PHP files and 1 include file. The server won't allow the code to place cookies so it sends out some warnings, but the post still goes through.
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
|
|
#2 |
|
Expert Programmer
|
That looks really well done, good job.
One thing though, the light blue of teh topic name is hard to see ![]()
__________________
Join us at #programmingforums @ irc.freenode.net! My software never has bugs. It just develops random features.
|
|
|
|
|
|
#3 |
|
Professional Programmer
|
nifty, i'd like a look under the hood.
|
|
|
|
|
|
#4 |
|
Professional Programmer
|
Not bad so far. The colors need a rethinking, though. Is is purposeful to have the post's data in 'editable' text fields?
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;} |
|
|
|
|
|
#5 |
|
Programming Guru
![]() |
Those aren't editable textareas, those are iframes..
Pretty nice work.
__________________
|
|
|
|
|
|
#6 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 8
![]() |
OK... I'm not a fan of the scrolling. Otherwise, nice work.
|
|
|
|
|
|
#7 | |
|
Professional Programmer
|
Quote:
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;} |
|
|
|
|
|
|
#8 |
|
Programming Guru
![]() |
They aren't editable either...
__________________
|
|
|
|
|
|
#9 | |
|
Professional Programmer
|
Quote:
Thanks for the repetitive scrutiny though. The same question is still there, if anyone would like to be helpful and answer it.
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;} |
|
|
|
|
|
|
#10 |
|
King of Portal
|
Filename: date.inc
Purpose: To add a timestamp to each post so as to uniquely identify each one. <?php
function get_time()
{
$year;
$month;
$day;
$hours;
$minutes;
$seconds;
$gmt_minoff;
$time_string;
$year = intval(date(Y));
$month = intval(date(n));
$day = intval(date(j));
$hours = intval(date(G));
$minutes = intval(date(i));
$seconds = intval(date(s));
$gmt_minoff = intval(date(O)) / 100 * 60;
$minutes = ($minutes - $gmt_minoff) % 60;
$hours = $hours - intval($gmt_minoff / 60);
if($hours > 23)
{
$hours -= 24;
$day += 1;
switch($month)
{
case 2:
if(date(L) == 1)
{
if($day == 30)
{
$month += 1;
$day = 1;
}
}
else
{
if($day == 29)
{
$month += 1;
$day = 1;
}
}
break;
case 4:
case 6:
case 9:
case 11:
if($day == 31)
{
$month += 1;
$day = 1;
}
break;
case 1:
case 3:
case 5:
case 7:
case 8:
case 10:
case 12:
if($day == 32)
{
$month += 1;
$day = 1;
}
if($month == 13)
{
$year += 1;
$month = 1;
$day = 1;
}
break;
}
}
if($hours < 0)
{
$hours += 24;
$day -= 1;
if($day == 0)
{
switch($month)
{
case 3:
$month -= 1;
if(date(L) == 1)
{
$day = 29;
}
else
{
$day = 28;
}
break;
case 2:
case 4:
case 6:
case 9:
case 11:
$month -= 1;
$day = 31;
break;
case 1:
case 5:
case 7:
case 8:
case 10:
case 12:
$month -= 1;
$day = 30;
if($month == 0)
{
$year -= 1;
$month = 12;
$day = 31;
}
break;
}
}
}
$time_string = strval($year);
if($month < 10)
{
$time_string .= "0" . strval($month);
}
else
{
$time_string .= strval($month);
}
if($day < 10)
{
$time_string .= "0" . strval($day);
}
else
{
$time_string .= strval($day);
}
if($hours < 10)
{
$time_string .= "0" . strval($hours);
}
else
{
$time_string .= strval($hours);
}
if($minutes < 10)
{
$time_string .= "0" . strval($minutes);
}
else
{
$time_string .= strval($minutes);
}
if($seconds < 10)
{
$time_string .= "0" . strval($seconds);
}
else
{
$time_string .= strval($seconds);
}
return($time_string);
}
?>
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|