Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 10th, 2005, 3:42 AM   #1
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 395
Rep Power: 3 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
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
grimpirate is offline   Reply With Quote
Old Sep 10th, 2005, 3:56 AM   #2
coldDeath
Expert Programmer
 
coldDeath's Avatar
 
Join Date: Aug 2005
Location: UK
Posts: 862
Rep Power: 3 coldDeath is on a distinguished road
Send a message via AIM to coldDeath Send a message via Yahoo to coldDeath
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.
coldDeath is offline   Reply With Quote
Old Sep 10th, 2005, 10:43 AM   #3
Lich
Professional Programmer
 
Lich's Avatar
 
Join Date: May 2005
Location: Detroit
Posts: 254
Rep Power: 4 Lich is on a distinguished road
Send a message via AIM to Lich Send a message via MSN to Lich
nifty, i'd like a look under the hood.
__________________
--John Cruz
Web Developer
www.cruzweb.net
Lich is offline   Reply With Quote
Old Sep 10th, 2005, 11:03 AM   #4
iignotus
Professional Programmer
 
iignotus's Avatar
 
Join Date: Apr 2005
Location: Nowhere Special
Posts: 466
Rep Power: 4 iignotus is on a distinguished road
Send a message via AIM to iignotus
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;}
iignotus is offline   Reply With Quote
Old Sep 10th, 2005, 1:36 PM   #5
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
Those aren't editable textareas, those are iframes..

Pretty nice work.
__________________

tempest is offline   Reply With Quote
Old Sep 10th, 2005, 2:05 PM   #6
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 8 Ooble is on a distinguished road
OK... I'm not a fan of the scrolling. Otherwise, nice work.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Sep 10th, 2005, 2:55 PM   #7
iignotus
Professional Programmer
 
iignotus's Avatar
 
Join Date: Apr 2005
Location: Nowhere Special
Posts: 466
Rep Power: 4 iignotus is on a distinguished road
Send a message via AIM to iignotus
Quote:
those are iframes
The question still stands just the same.
__________________
% 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;}
iignotus is offline   Reply With Quote
Old Sep 10th, 2005, 5:20 PM   #8
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
They aren't editable either...
__________________

tempest is offline   Reply With Quote
Old Sep 10th, 2005, 8:11 PM   #9
iignotus
Professional Programmer
 
iignotus's Avatar
 
Join Date: Apr 2005
Location: Nowhere Special
Posts: 466
Rep Power: 4 iignotus is on a distinguished road
Send a message via AIM to iignotus
Quote:
They aren't editable either...
I know that, that's why I quoted 'editable' in my post. What I thought they were were <textarea>s, which are editable, but I noticed these weren't and iframes didn't pop into my head at that moment (I hadn't looked at the souce).

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;}
iignotus is offline   Reply With Quote
Old Sep 11th, 2005, 3:16 AM   #10
grimpirate
King of Portal
 
grimpirate's Avatar
 
Join Date: Sep 2005
Posts: 395
Rep Power: 3 grimpirate is on a distinguished road
Send a message via Yahoo to grimpirate
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
grimpirate is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:09 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC