Activity Stream
48,167 MEMBERS
6804 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 8 of 8
  1.     
    #1
    Banned
    Website's:
    WarezRelease.org ThatHosting.co

    Default Display banned sites + their time

    this is the right way to show? cos nothing is displaying:

    PHP Code: 
            $current time();
            
    $expiry mysql_query("SELECT url,expires FROM wcddl_blacklist WHERE expires < IN(0,86400,259200,604800,864000,1209600,2592000)");
            
            while(
    $row mysql_fetch_assoc($expiry)) {
                
                
    $getExpireSites $row['expires'];
                
    $Bsite $row['url'];
                
                
    $diff $current-$getExpireSites;
            
            switch(
    1) {
                
                case(
    $diff 60 && $diff 3600);
                
    $count floor($diff 60);
                                
                if (
    $count == 1$suffix 'minute';
                else 
    $suffix 'minutes';
                break;
                                
                case(
    $diff 3600 && $diff 86400);
                
    $count floor($diff 3600);
                                
                if (
    $count == 1$suffix 'hour';
                else 
    $suffix 'hours';
                break;
            }
            echo 
    '<div align="center">Your '$Bsite .'\'s ban expires in '$count .' '$suffix .'</div><br />';
            
            } 
    im only trying/want to show in my admin mod......

    EDIT:updated query, still no l7uxk......
    Chris2k Reviewed by Chris2k on . Display banned sites + their time this is the right way to show? cos nothing is displaying: $current = time(); $expiry = mysql_query("SELECT url,expires FROM wcddl_blacklist WHERE expires < IN(0,86400,259200,604800,864000,1209600,2592000)"); while($row = mysql_fetch_assoc($expiry)) { $getExpireSites = $row; $Bsite = $row; Rating: 5

  2.   Sponsored Links

  3.     
    #2
    You can call me G
    At first glance, appears as bad use of the switch statement.

    Here's how the cases are evaluated:

    PHP Code: 
    switch($x) {
        case 
    'blah':
            echo 
    "Something";
            break;
        case 
    'w00t':
            echo 
    "uhmm";
        default:
            echo 
    "meh";

    Note: I left a break in the second case intentionally for the example.

    lets say we have the following set of values for x: "blah","w00t","crap"

    the output in each case will be:

    1. Something
    2. uhmmmeh
    3. meh

    I think its clear from above that case only checks if $x has the same value as the one specified in the case else default block is executed.
    also, the statements following a case block that matches successfully are executed until a break is encountered or the end of a switch block (refer to output 2)

    Go ahead, make some changes to the control structures now

    Regards,
    Gaurav



    My Langotiya Yaars (Chaddi buddies): JmZ, humour, Chutad, Esotorisk, l0calhost, Daniel, Mind Freak?, TLK, Amz

  4.     
    #3
    Member
    Website's:
    tehMoviez.com 0Senes.com GeekFaceGames.com
    you can only use switch statement for equalities.
    PHP Code: 
            $current time();
            
    $expiry mysql_query("SELECT url,expires FROM wcddl_blacklist WHERE expires < IN(0,86400,259200,604800,864000,1209600,2592000)");
            
            while(
    $row mysql_fetch_assoc($expiry)) {
                
                
    $getExpireSites $row['expires'];
                
    $Bsite $row['url'];
                
                
    $diff $current-$getExpireSites;
            
                if(
    $diff 60 && $diff 3600)[{
                  
    $count floor($diff 60);
                                
                  if (
    $count == 1$suffix 'minute';
                  else 
    $suffix 'minutes';
                } elseif  (
    $diff 3600 && $diff 86400){
                  
    $count floor($diff 3600);
                                
                  if (
    $count == 1$suffix 'hour';
                  else 
    $suffix 'hours';
                }
            echo 
    '<div align="center">Your '$Bsite .'\'s ban expires in '$count .' '$suffix .'</div><br />';
            
            } 

  5.     
    #4
    Banned
    Website's:
    WarezRelease.org ThatHosting.co
    Hi

    ive got it working, the query was wrong .....

    Hmm now im looking to do a cuount to the banned times:

    $allowed = array(
    'bTime' => array(0,86400,259200,604800,864000,1209600,2592000 ),

    then delete if expired.

    any Help??????

  6.     
    #5
    Respected Member
    I really don't understand what you are asking.

    $time is now.
    $expires is length of ban.
    what is the variable for starting time of the banishment???

  7.     
    #6
    Banned
    Website's:
    WarezRelease.org ThatHosting.co
    Im not sure how i'd go about a start time?

    I only insert the expires time.

    ---------- Post added at 04:27 PM ---------- Previous post was at 01:10 AM ----------

    My bad, i've the date converted by strtotime() func, so thats the start time,....

    now just need help doing the if the time's expired, then delete..

  8.     
    #7
    Banned
    Website's:
    WarezRelease.org ThatHosting.co
    bump

  9.     
    #8
    Banned
    Website's:
    WarezRelease.org ThatHosting.co
    here's my updated code:

    PHP Code: 
            $x 0;
            
    $current time();
            
    $expiry mysql_query("SELECT * FROM wcddl_blacklist WHERE expires < 2592000 AND expires > 43200");
            
            while(
    $row mysql_fetch_assoc($expiry)) {
                
    $blackurl $row['url'];
                
    $expires $row['expires'];
                
                
    //Should be: Ymd, so we implode it.
                
    $sDate preg_replace('/[^a-zA-Z0-9 ]/','',$row['dat']);
                
    $todays_date date('Ymd'mktime (000date ('m'), date ('d'), date ('Y')));
                
                
    //Convert $sDate to timestamp.
                
    $timestamp strtotime($sDate);
                
    $timestamp += 24*60*60 $expires;
                
    $expiry_date date("Ymd"$timestamp);
                
                if (
    $expiry_date >= $todays_date) {
                    
    mysql_query("DELETE FROM wcddl_blacklist WHERE url='"$blackurl ."'");
                    
                    
    $x++;
                }
                
                echo 
    '<p class="warn_message">Still banned: '$blackurl .' for '. ($timestamp $expires 3600) .' hours</p>';
            }
            
            echo 
    '<p class="warn_message">'$x .' sites have been automatically unbanned.</p>'
    This is wqorking cool, for my 3rd attempt, problem is: it's banning for 1 or 2 mins.

    Any help?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. It's time to add the Open Graph to Sites
    By Mr Happy in forum Feedback and Suggestions
    Replies: 5
    Last Post: 21st Mar 2012, 04:13 AM
  2. File sharing sites, that pays and has no down time?
    By johnwooo in forum Webmasters, Money Making
    Replies: 9
    Last Post: 7th Sep 2011, 11:09 PM
  3. Download Sites - time to viability
    By winton in forum Polling Plaza
    Replies: 1
    Last Post: 7th Sep 2011, 03:21 PM
  4. Any Good Pre Time Porn Sites?
    By dede110 in forum File Host Discussion
    Replies: 9
    Last Post: 26th Jun 2011, 01:16 PM
  5. How To: Display Time & Date on Site/Forum
    By iHate in forum Tutorials and Guides
    Replies: 1
    Last Post: 25th Aug 2010, 06:41 PM

Tags for this Thread

BE SOCIAL