Jump to content

cmgmyr

Members
  • Posts

    1,278
  • Joined

  • Last visited

    Never

Posts posted by cmgmyr

  1. My main Dev PC I built with an Intel Duel core CPU, 3 gb of ram and 256mb of vid ram, (2) 250 gb sata hd's and some other misc stuff here and there. Attached are 2 dell 20.1" widescreen monitors. I also have a new laptop (dell D830) that I do some testing on.

     

     

    ...XP Pro can accept up to 10 external monitors with no extra configuring...just insert the video cards and away you go!!! :)

  2. Well you have to record each vote or else you can really check if the same one has happened. I use something like this for one of my sites:

     

    Votes:

    --------

    id

    userid

    voterid

    vote

     

    I guess if you are talking about millions of votes you could make multiple tables to handle different userid's: votes1 (handles users 1-1,000,000), votes2 (handles users 1,000,001-2,000,000), etc... So when you vote for someone your script does a simple IF then finds what table it needs to look for...then does the rest.

  3. I believe you can only change the colors of the scrollbars (of the browser) in IE. If you want to make "custom" scroll bars for something like a div you will need to use some CSS with javascript.

  4. You could do something like this:

     

    form.php

    <?php
    if($_POST){
    //do what you need with POST here
    header("location: form.php?alert=1");
    }
    
    if($_GET['alert'] == 1){
    echo "Everything has been uploaded! Please upload some more!<br /><br />";
    }

  5. Ok, so I figured it out. Here it is if anyone wants to do something like this.

     

    1. make a "logged_time" column somewhere in your database (I put this in my users table)

    2. When they log in do something like this:

    <?php
    $_SESSION['user_id'] = $userid;
    $_SESSION['online_time'] = mktime();
    ?>

    3. On the top of each page...or in your header file have this:

    <?php
    if(getUser()){ //<- this checks to see if the user is logged on...you can do this anyway you want
    onlineTime(); //<- this alters/saves the online time
    }
    ?>

    4. Here are your main functions

    <?php 
    
    //This function logs the time into the database and makes a new time
    function onlineTime(){
    //Make DB connection here
    
    $timeout = 5; //this is the timout in minutes
    
    $userid = $_SESSION['user_id'];
    
    $now = time();
    $difference = $now - $_SESSION['online_time'];
    if($difference <= ($timeout * 60)){
    	mysql_query("UPDATE users SET logged_time = logged_time + $difference WHERE userid = $userid");
    }
    $_SESSION['online_time'] = mktime();
    }
    
    //This function calculates and outputs the logged time
    function showOnlineTime($userid){
    //Make DB connection here
    
    $result = mysql_query("SELECT logged_time FROM users WHERE userid = $userid");
    if(mysql_num_rows($result) > 0){
    	list($total) = mysql_fetch_row($result);
    	$days = floor($total / 86400);
    	$hours = floor(($total % 86400) / 3600);
    	$minutes = floor(($total % 3600) / 60);
    	echo "$days days, $hours hours and $minutes minutes.";
    }else{
    	echo "No Logged Time Available";
    }
    }
    
    ?>

     

    Simple enough right?

  6. It's something I use for the "owner" of the video/picture/whatever. If status is set to 0 then the owner didn't view it yet. Once they view the comment(s) then this is set to 1. It's up to you if you use this or not. If you don't you can just take it out of the query.

  7. You only need 1 comments table. This will have the comment id, user id, video id, comment, and whatever else you want like date left or status

     

    CREATE TABLE `comments` (
      `cid` int(11) NOT NULL auto_increment,
      `userid` int(11) NOT NULL default '0',
      `videoid` int(11) NOT NULL default '0',
      `message` text NOT NULL,
      `status` smallint(1) NOT NULL default '0',
      `date` datetime NOT NULL default '0000-00-00 00:00:00',
      PRIMARY KEY  (`cid`)
    );
    

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.