evillair
Members-
Posts
44 -
Joined
-
Last visited
Never
Everything posted by evillair
-
It may be in the way you are using the $valid_user? I use $_SESSION's for things like this... $sql = mysql_query("SELECT * FROM table_name"); $userinfo = mysql_fetch_array($sql); $_SESSION['user_id'] = $userinfo['user_id']; $test = '001'; // if this works then use an array if ($_SESSION['user_id'] == $test) {...} echo out $valid_user and see shows up too.
-
You could try: $valid_user_id = array('000','001','002'); if ($valid_user == $valid_user_id) {...}
-
Have you tried == instead of = ? ($valid_user == array('000','001','002')
-
From the readme.txt: "Then, point your browser to the /install folder to begin the installation process." The install directory is empty.
-
I had this problem, this is probably not the best way to do it but... Something like... <?php if (isset($_POST['submited'])) { // Thank you once it IS submitted ?> <h1>Thank you for posting...</h1> blah blah... <?php // If it's not submitted I show the form } else { ?> <!-- Your Form --> <?php } ?> This worked for me.
-
Have you tried adding a hidden field on your form and check it if was submitted? <input name="is_submitted" type="hidden" value="1"> Then just check if it was submitted or not. $submitted = $_POST['is_submitted']; if ($submitted){ //do your code insert stuff } That might work...
-
You can try one of these: http://giombetti.com/snippets/5 http://www.codango.com/php/fnc/content/?tree=phpin/codesnips/usermana&id=7278310
-
I'm also working on displaying a 'new' icon on my forum project. Please note I am new and this is probably wrong. I did it a bit different though... I'm working off the "last post" msg id of a topic to see if it's new or not. I made a table 'sbb_log_topics'. This table gets inserted 3 values: - user_id (I insert the $_SESSION['user_id'] that I made at login) - topic_id (the id of the topic) - msg_id (the last post message id) I insert those values when a user views a message. Then when he views the topics page, I check to see if the values match with the "last post" msg id on that page. If they match he doesn't get a 'new' icon. Here are the functions I am using: // Get the last msg id from a topic function get_last_post($topic_id){ $sql="SELECT MAX(msg_id) AS lastpost FROM sbb_posts WHERE topic_id='$topic_id'"; $sqlresult=mysql_query($sql) or die(mysql_error()); $result=mysql_fetch_row($sqlresult); return($result); } // Add the msg id a seen function log_topic($userid, $topic_id, $last_post_id) { // Check if we added it or not $sql = "SELECT * FROM sbb_log_topics WHERE user_id='$userid' AND topic_id='$topic_id' AND msg_id='$last_post_id'"; $sqlresult = mysql_query($sql) or die(mysql_error()); $result=mysql_num_rows($sqlresult); if ($result < 1){ // We didn't add it, then let's add it... $sql1 = "INSERT INTO sbb_log_topics (user_id, topic_id, msg_id) VALUES('$userid', '$topic_id', '$last_post_id')"; $result1 = mysql_query($sql1) or die(mysql_error()); } } // Check to see if the user has seen the last posted messsage function check_topic($userid, $topic_id, $last_post_id) { $sql = "SELECT * FROM sbb_log_topics WHERE topic_id='$topic_id' AND user_id='$userid' AND msg_id='$last_post_id'"; $sqlresult=mysql_query($sql) or die(mysql_error()); $result=mysql_num_rows($sqlresult); return($result); } To display the new icon I do this: // Get the last msg id $topic_id = $topic['topic_id']; $lastpost = get_last_post($topic_id); $last_post = $lastpost[0]; if ($logged_in){ // get the last post $last_post_id = $last_post; // log topic seen vars $topic_id = $topic['topic_id']; $userid = $_SESSION['user_id']; $checktopic = check_topic($userid, $topic_id, $last_post_id); if ($checktopic < 1){ echo'<span class="smalltext"><strong>new</strong></span>'; } } And on my messages page I use this to add the values when a user views the message: // log topic seen vars $topic_id = $post['topic_id']; $userid = $_SESSION['user_id']; // Get the last post $lastpost = get_last_post($topic_id); $last_post = $lastpost[0]; // add the msg as seen log_topic($userid, $topic_id, $last_post); It's seems to be working for now. Like I said I am new so this might not be the best way to do it. The problem I can see is that the "sbb_log_topics" table will get very big.
-
I'll be working on that soon. - Added flood protection on replies.
-
I think it looks good. The horizontal shift is a bit annoying though. Good job.
-
Thank you very much.
-
Thanks It's something I designed and coded myself. I took some of the design elements from vbulletin since I really liked those and couldn't think of a better way to do them I'll be working on the tables soon, If you have the Web Developer plugin for firefox you'll see some are tables and some aren't. I haven't converted them all to divs yet. Thanks for looking.
-
I started a little forum project trying to learn php and this is what I have so far. It's not live, this is a test site right now. I'd like to get some critiques on the design. Although pretty standard for forums. http://www.sentry.dreamhosters.com/ You can switch to different style with the colored cubes on the right of the main menu. Thanks in advance.
-
I found this, works great: http://www.zend.com/code/codex.php?id=731&single=1 Just change the "Dauer: " to "Page created in ".
-
Odd, it should work anywhere. I just added it to the footer because of the way my site is. Have you tried what thorpe posted?
-
Thanks It's going to be Open Source if it's ever released. edit: - added the ability to change your password in the 'edit profile' page.
-
fixed it, thanks
-
This is the code I am using... I have this in the header: // Load time stuff $time = microtime(); $time = explode(" ", $time); $time = $time[1] + $time[0]; $start = $time; Then in my footer I have: $time = microtime(); $time = explode(" ", $time); $time = $time[1] + $time[0]; $finish = $time; $totaltime = ($finish - $start); //printf ("Page created in %f seconds with %g queries.", $totaltime, $num_queries); if ($show_footertime == '1') { printf ("Page created in %f seconds.", $totaltime); It works for me. ???
-
Try adding this to where you want it to display <?php printf ("Page created in %f seconds.", $totaltime); ?>
-
~ 5 seconds http://www.daily-sudoku.org/ ~3 seconds http://www.daily-sudoku.org/sudoku/tournament.php?t_id=6 ~3 seconds http://www.daily-sudoku.org/sudoku/monster.php?t_id=2 Canada, Quebec The content loaded quickly, the images took the longest.
-
Ohhhh, yeah, but you just break it for yourself since only you view your stats there. That user info will change, no point in showing your own location etc. I just wanted it working for now. Fixed that, oops.
-
I fixed it for now, I still haven't decided what to show on the memberlist, just added the basic stuff. I'll be working on some sort of spam filter soon. Stuff I have updated since last time are: - Added basic reputation system (spam not detected yet, will add a time between adding new rep. Images arn't in yet, just shows the text rep for now) - "Modify Post" is in (with text showing the last edited time and the username) - Post group is working - Style selection is working now also. (the little colored squares on the top right changes the style, got 4 of them now) - 'Almost' decided on a name. Sentry is just a working title for it. Thanks again
-
Got the registering double password fixed. Other fixes/additions - Fixed the avatar showing up in the profile when none was set. - Added pagination to the memberlist. Thanks
-
Fixed, I copied some code from another page, missed that one.
-
Perfect thanks. I updated the "edit profile" page. The fields that are checked are: Real name (needs to be none numeric) Avatar URL (needs to be a valid url) Birthdate (needs to only numbers and -) Location (needs to be none numeric) Website (needs to be a valid url) E-mail address (needs to be a email) MSN Messenger (needs to be a valid url) ICQ (needs to be only numbers)