evillair
Members-
Posts
44 -
Joined
-
Last visited
Never
About evillair
- Birthday 01/06/1971
Contact Methods
-
Website URL
http://evillair.net/v2
Profile Information
-
Gender
Male
-
Location
Canada
evillair's Achievements
Newbie (1/5)
0
Reputation
-
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?