HEHE useful, but the [ code.] and [/ code.] don't work
I will have to fix it
This is my latest [[ for the profile ]]
ITS A BETA, not the real one... i don't code it this way for the real one, its much better the real one.
But i sitll made this.
code:
//Ok, im putting the view profile here,
//so...it kinda is part of the news though :)
function d_profile() {
global $rec, $result;
global $displays, $title;
global $name, $password, $email, $aim, $msn, $icq, $info, $id, $avatar, $websites;
global $PHP_SELF;
$displays = "<b><u><i>Profile information Of: $name</i></u><br><br>";
$title = "Profile info of: $name";
mysql_select_db("amailerforum");
$result = mysql_query("SELECT * FROM phpbb_users WHERE username='$name'");
while($rec = mysql_fetch_array($result)) {
//Now this is the important information
//the pass name email
$name = $rec['username'];
$password = $rec['user_password'];
$email = $rec['user_email'];
//this is the attitional information
$aim = $rec['user_aim'];
$msn = $rec['user_msnm'];
$icq = $rec['user_icq'];
//the web site of the user
$website = $rec['user_website'];
//this is like a user comment
$occ = $rec['user_occ'];
$intrests = $rec['user_interests'];
//ah yes, user avatar
$avatar = $rec['user_avatar'];
//the id of the user
$id = $rec['user_id'];
//So, if the Intrests are empty
//display 'None'
if($intrests == "") {
$intrests = "None";
}
//If the Occ is empty
//display 'None'
if($occ == "") {
$occ = "None";
}
//The thing that viewsers will have to click
//inorder to go to the users site
$webname = "Click here to visit";
//If the website is empty
//display a diffrent table with the name ''None''
if($website == "") {
$websites = "
</table>
<br>
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"56%\">
<tr>
<td width=\"23%\" valign=\"top\"><font face=\"Fixedsys\">Website:</font></td>
<td width=\"77%\" valign=\"top\"><font face=\"Verdana\" size=\"2\">None</a></font></td>
</tr>
</table>";
//else if the website is not empty
//then display the information needed
} elseif($website != "") {
$websites = "
</table>
<br>
<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\" width=\"56%\">
<tr>
<td width=\"23%\" valign=\"top\"><font face=\"Fixedsys\">Website:</font></td>
<td width=\"77%\" valign=\"top\"><font face=\"Verdana\" size=\"2\"><a href=\"$website\" target=\"_blank\">$webname</a></font></td>
</tr>";
}
//Checking if the AIM field is blank or not
if($aim == "") {
$aims = "
<td width=\"23%\" valign=\"top\"><font face=\"Fixedsys\">AIM:</font></td>
<td width=\"77%\" valign=\"top\"><font face=\"Verdana\" size=\"2\">None</a></font></td>
</tr>
</table>";
} else {
$aims = "<td width=\"23%\" valign=\"top\"><font face=\"Fixedsys\">AIM:</font></td>
<td width=\"77%\" valign=\"top\"><font face=\"Verdana\" size=\"2\"><a href=\"aim:goim?screenname=$aim\">$aim</a></font></td>
</tr>
</table>";
}
Basicaly i have connected to the phpBB forum, to get the user info. There is about...well not about there IS 2097 lines of code in my modules.php file i shoved all my functions and etc in there, also my test stuff...which i did not delete, but it does nto take up much space...I KNOW its a bad way of coding but hey
Reason is that, i kinda am lazy to make function for everything and then use it for my future projects and etc. But im making a php NUKE NOW! wee! Good thing is i got everythign ready, i just need to put it all togeather and everything will be good. BTW as you can see the scripts on top, PHP IS EASY!
Sponsor Sponsor
Blade
Posted: Tue Jun 24, 2003 11:17 am Post subject: (No subject)
really nice... but you should attach massive amounts of code as txt file or something... lol
Amailer
Posted: Tue Jun 24, 2003 3:10 pm Post subject: (No subject)
Yes well sorry, i got some more i want to post [[ small ones, for mysql ]]
But, i guess no one is into php here
im currently going to have to put my whole forum in my sites layout, its going to take some time but oh well
Homer_simpson
Posted: Tue Jun 24, 2003 5:03 pm Post subject: (No subject)
i am interested in php projects but those things you made are addons to phpbb.. =(
Amailer
Posted: Tue Jun 24, 2003 5:08 pm Post subject: (No subject)
Posted: Tue Jun 24, 2003 5:38 pm Post subject: (No subject)
lol i cant add comment to your news for some reason... and i already how to create a forum or a website with signup and everything ...
so uh... how bout a big php project? you come up with the idea we script it?
Amailer
Posted: Tue Jun 24, 2003 5:46 pm Post subject: (No subject)
Comment, err...as it says, its not ready.
Second, what kinda of project you wanna work on?
Project management one?
Need tip:
Ok, should i change the forum layout to fit in my main sites layout? Or should i jsut use an iframe to put the forum on my main site?
PaddyLong
Posted: Tue Jun 24, 2003 6:12 pm Post subject: (No subject)
could make a full content management type of thing... like php nuke type of thing
Sponsor Sponsor
Amailer
Posted: Tue Jun 24, 2003 6:14 pm Post subject: (No subject)
Those are boring, many people make it. Just don't get famous. My amailer site is PARTLY like php nuke, but its not fully compleated, since...well. lol the admin center has not been started .
But if i would make a thing like phpNUKE...then i would let people change the FULL layout of the site, i mean the tables and everything, cept my copyright
PaddyLong
Posted: Tue Jun 24, 2003 8:41 pm Post subject: (No subject)
of course...
like do everything as modules and then the designer can just do an include("somemodule.php") where ever in the layout they want it
the OSCommerce shopping cart is kind of like that with the side bars... each one of the things (like menu, search, feature product, etc) is its own file
but really, the things like nuke I think are mostly just for lazy or unexperienced people who are just looking for a quick thing that they can some what, but easily control
Amailer
Posted: Tue Jun 24, 2003 8:49 pm Post subject: (No subject)
They cant just include the file, if they are doing that, itneeds to have crtin stuff in it, so it can display the links and etc...
But it will be very easy to edit the layout. It would be like templates, put your templates in the templated folder. It has to have the stuff to display the links. And then once you have made your own template, the admin can choose which ever he/she wantes. Course it has to include downloads, links etc like a phpNUKE, but it should be made for programmers. Not the normal public
Amailer
Posted: Tue Jun 24, 2003 11:28 pm Post subject: (No subject)
These are some small scripts that are IMPORTANT!
code:
//Connect DB function
function db_connect() {
global $dbhost, $dbusername, $dbuserpassword, $default_dbname;
global $MYSQL_ERRNO, $MYSQL_ERROR;
$link_id = mysql_connect($dbhost, $dbusername, $dbuserpassword);
if(!$link_id) {
$MYSQL_ERRNO = 0;
$MYSQL_ERROR = "Connection failed to the host $dbhost";
return 0;
}
else return $link_id;
}
$dbconnect = db_connect(); //Connect to mySQL
mysql_select_db("DBNAME"); //select a database
//Thats for selecting infromation from a table :)
$result = mysql_query("SELECT * FROM table");
while($rec = mysql_fetch_array($result)) {
$variable = $rec['field'];
}
there are a lot more, update, delete and etc
Amailer
Posted: Wed Jun 25, 2003 11:31 pm Post subject: (No subject)
Well no once likes PHP [[ THATS IMPOSSIABLE ]] but im still going to keep posting some scritps, once im sure...ill make a LOGN tuorial or what ever..
Now this script...Well ill just give you guys some tips and etc [[ I WANT POINTS!! ]]
Ok as we all might know we all start php with.
code:
<?
and...
?>
So...once we know that...lets see our php information.
code:
<?
phpinfo();
?>
Copy and past that in a file name it: phpinfo.php
and then run it on your browser.
You will see all your PHP INFO [[ er...ya.. ]]
Now some basic stuff
code:
<?
echo "Hello Compsci.ca...people";
?>
Now the echo is like print...in other languages you should know
But in php there is PRINT and ECHO
code:
<?
print "Hello Compsci.ca...people";
?>
Yes well, you should know what echo is...because you WILL ...be using it in ALL you scripts at some point
Now some if statements, with variables
code:
<?
$variable_name = "Aaron";
$variable_message = "My name is:";
if($variable_name == "Aaron") {
echo $variable_message . $variable_message;
} elseif($variable_name != "Aaron" AND $variable_name == "retard") {
echo "WHAT!! RETARD HAHAHAHAH!?";
} else {
echo "uh oh? what...oh..no one here...no name :( i feel sad :(";
?>
Ahh ok, hehe lil if statements
Ok now, != means NOT EQUAL
and you should know what the rest means...you all are programmers here right? RIGHT!
!
THIS TUTORIAL SUCKS..wait...its not 1 ahh im happy good.
OK NOW...DATE/TIME/YEAR SCRIPT!!..ya..
code:
<?
//Lets display the title.
echo "<center><h1><u>Month/Day/Year/Time/</U></h1></center>";
//File name for writign the date and time.
$file = "mdyt.txt";
//get current date and time
$month = date("M, D, Y");
$day = date("d");
$year = date("Y");
$time = date("H:i:s");
//Lets just display the information
echo "<b>Month:</b> $month<br>";
echo "<b>Day:</b> $day<br>";
echo "<b>Year:</b> $year<br>";
echo "<b>Time:</b> $time<br>";
echo "<br>";
//Ok, now this is the variable for the /day/year/time.
//Its used in the fwrite part.
$mdyt = "$month $day $year $time";
//lets write them in a file.
$fp = fopen($file, "w");
fwrite($fp, $mdyt);
fclose($fp);
?>
<br>
//Example 2: if you wan't time on your web site you can use this.
//Course you know you can change the style of the time.
//Just ajust the $time = date("H").":".date("i").":".date("s");
echo "<b>Example 2: Using the $ time on your site.</b><br>";
echo "Current time: $time";
echo "<br><br>";
//Example 2: if you wan't time on your web site you can use this.
//Course you know you can change the style of the time.
//Just ajust the $time = date("H").":".date("i").":".date("s");
echo "<b>Example 2: Using the $ time on your site.</b><br>";
echo "Current time: $time";
?>
Guys look at the post down....WHO on earth turns HTML ON? look what sort of things you can do when html is on
Amailer
Posted: Wed Jun 25, 2003 11:42 pm Post subject: (No subject)
Guys...why did you turn HTML ON!?
err look what CAN happne with html on :
Mod Edit: Thanks for that whonderfull Demo of what not to do
Dan
Posted: Thu Jun 26, 2003 12:09 am Post subject: (No subject)
well i have it on b/c i turst poleop for now, if poelop abuse it they lose it. (like the rime?).
it helps with other stuff but it is easy enfogth for now to stop any one who trys to do dum things.
Computer Science CanadaHelp with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!