Crazyhour

Started by john, November 28, 2011, 03:33:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

john

Quote from: swizzles on December 02, 2011, 07:22:00 PM
Hi john
The crazyhour in the stdhead is red when crazyhour is off and when mouseover it tells you when the next one is. It only ever tells you when the next crazyhour is going to be in shout.

I might be wrong.... :P

ok done this checks all set and ok but still not showing at all

Diablo999

#6
I don't see anything wrong with those scripts.
Are you sure the 2 cache files is chmodded to 777.
Does it show crazy hour in global message or is only in shoutbox, that you have problems.
Are you sure that the crazy hour is active at all?
Guess you should be able to see, if it changes in the 2 cache files. I haven't been using this source for a couple of month now, but I guess the others in here will correct me, if I'm wrong(at least i hope so). :P

swizzles

Hi john
The crazyhour in the stdhead is red when crazyhour is off and when mouseover it tells you when the next one is. It only ever tells you when the next crazyhour is going to be in shout.

I might be wrong.... :P

john

#4
here is the crazyhour.php and as you can see the cat-free is there to tell members and no its not showing at all when it starts
    if (curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_REPORTS && $BLOCKS['global_staff_report_on']){
    require(BLOCK_DIR.'global/report.php');
    }

    if (curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_UPLOADAPP && $BLOCKS['global_staff_uploadapp_on']){
    require(BLOCK_DIR.'global/uploadapp.php');
    }

      if (curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_HAPPYHOUR && $BLOCKS['global_happyhour_on']){
      require(BLOCK_DIR.'global/happyhour.php');
      }

    if (curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_STAFF_MESSAGE && $BLOCKS['global_staff_warn_on']){
    require(BLOCK_DIR.'global/staffmessages.php');
    }

      if (curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_NEWPM && $BLOCKS['global_message_on']){
      require(BLOCK_DIR.'global/message.php');
      }

    if (curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_DEMOTION && $BLOCKS['global_demotion_on']){
    require(BLOCK_DIR.'global/demotion.php');
    }

      if (curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_FREELEECH && $BLOCKS['global_freeleech_on']){
      require(BLOCK_DIR.'global/freeleech.php');
      }

             if (curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_CRAZYHOUR && $BLOCKS['global_crazyhour_on']){
          require(BLOCK_DIR.'global/crazyhour.php');
          }
      $htmlout .="</ul></div>";


the above is in the template
<?php
//==pdq crazyhour
 if (isset($CURUSER)) {
   
$transfer_filename  $INSTALLER09['cache'].'/transfer_crazyhour.txt';
   
$crazyhour_filename $INSTALLER09['cache'].'/crazy_hour.txt';
   
$crazyhour_cache fopen($crazyhour_filename,'r+');
   
$crazyhour_var fread($crazyhour_cachefilesize($INSTALLER09['cache'].'/crazy_hour.txt'));
   
fclose($crazyhour_cache);
   
$cimg '<img src=\''.$INSTALLER09["pic_base_url"].'cat_free.gif\' alt=\'FREE!\' />';
   if (
$crazyhour_var >= TIME_NOW && $crazyhour_var TIME_NOW 3600) { // is crazyhour
       
$htmlout .="
       <li>
       <a class='tooltip' href='#'><b>CrazyHour ON</b><span class='custom info'><img src='./templates/11/images/Info.png' alt='CrazyHours' height='48' width='48' /><em>CrazyHour</em>
       "
.$INSTALLER09['crazy_title']." Ends in ".mkprettytime($crazyhour_var TIME_NOW)."<br />
       "
$INSTALLER09['crazy_message']."</span></a></li>";
        if (
is_file($transfer_filename))
            
unlink($transfer_filename);
    }
    elseif (
$crazyhour_var TIME_NOW 3600 && !is_file($transfer_filename)) { //== crazyhour over
        
$transfer_file_created fopen($transfer_filename'w') or die('no perms?');
        
fclose($transfer_file_created);
        
$crazyhour['crazyhour_new']       = mktime(235959date('m'), date('d'), date('y'));
        
$crazyhour['crazyhour']['var']    = mt_rand($crazyhour['crazyhour_new'], ($crazyhour['crazyhour_new'] + 86400));
        
$fp fopen($crazyhour_filename'w');
        
fwrite($fp$crazyhour['crazyhour']['var']);
        
fclose($fp); 
        
write_log('Next Crazyhour is at '.date('F j, g:i a T'$crazyhour['crazyhour'] ['var'])); 
        
        
$htmlout .="
        <li>
         <a class='tooltip' href='#'>CrazyHour<span class='custom info'><img src='./templates/11/images/Info.png' alt='CrazyHours' height='48' width='48' /><em>CrazyHour</em>
         "
." Crazyhour will be ".get_date($crazyhour['crazyhour']['var'], '')."  
         "
.mkprettytime($crazyhour['crazyhour']['var'] - TIME_NOW)." remaining till Crazyhour
        </span></a></li>"
;
        }
        else 
// make date look prettier with countdown etc even :]
        
$htmlout .="
        <li>
         <a class='tooltip' href='#'>CrazyHour<span class='custom info'><img src='./templates/11/images/Info.png' alt='CrazyHours' height='48' width='48' /><em>CrazyHour</em>
         "
." Crazyhour will be ".get_date($crazyhour_var'')."  
         "
.mkprettytime($crazyhour_var TIME_NOW)." remaining till Crazyhour
        </span></a></li>"
;
        }
      // crazyhour end
?>

Diablo999

john - No, I said that you missing it in stdhead and that's in your template.php.
Pretty obvious since you got the problem after using a new theme, right. ;)

Diablo999

If it's in the global message it ain't showing, then you probably missing this in stdhead along wit all the others message scripts.
Code (php) Select
      if (curuser::$blocks['global_stdhead'] & block_stdhead::STDHEAD_CRAZYHOUR && $BLOCKS['global_crazyhour_on']){
      require(BLOCK_DIR.'global/crazyhour.php');
      }


Ain't sure about the missing message in shoutbox without checking the codes, but I bet others can tell you.

john

System Next Crazyhour im using a different theme and i do not use theme 1 no more and ive set the crazyhour.php  to this


<?php
//==pdq crazyhour
 if (isset($CURUSER)) {
   
$transfer_filename  $INSTALLER09['cache'].'/transfer_crazyhour.txt';
   
$crazyhour_filename $INSTALLER09['cache'].'/crazy_hour.txt';
   
$crazyhour_cache fopen($crazyhour_filename,'r+');
   
$crazyhour_var fread($crazyhour_cachefilesize($INSTALLER09['cache'].'/crazy_hour.txt'));
   
fclose($crazyhour_cache);
   
$cimg '<img src=\''.$INSTALLER09["pic_base_url"].'cat_free.gif\' alt=\'FREE!\' />';
   if (
$crazyhour_var >= TIME_NOW && $crazyhour_var TIME_NOW 3600) { // is crazyhour
       
$htmlout .="
       <li>
       <a class='tooltip' href='#'><b>CrazyHour ON</b><span class='custom info'><img src='./templates/10/images/Info.png' alt='CrazyHours' height='48' width='48' /><em>CrazyHour</em>
       "
.$INSTALLER09['crazy_title']." Ends in ".mkprettytime($crazyhour_var TIME_NOW)."<br />
       "
$INSTALLER09['crazy_message']."</span></a></li>";
        if (
is_file($transfer_filename))
            
unlink($transfer_filename);
    }
    elseif (
$crazyhour_var TIME_NOW 3600 && !is_file($transfer_filename)) { //== crazyhour over
        
$transfer_file_created fopen($transfer_filename'w') or die('no perms?');
        
fclose($transfer_file_created);
        
$crazyhour['crazyhour_new']       = mktime(235959date('m'), date('d'), date('y'));
        
$crazyhour['crazyhour']['var']    = mt_rand($crazyhour['crazyhour_new'], ($crazyhour['crazyhour_new'] + 86400));
        
$fp fopen($crazyhour_filename'w');
        
fwrite($fp$crazyhour['crazyhour']['var']);
        
fclose($fp); 
        
write_log('Next Crazyhour is at '.date('F j, g:i a T'$crazyhour['crazyhour'] ['var'])); 
        
        
$htmlout .="
        <li>
         <a class='tooltip' href='#'>CrazyHour<span class='custom info'><img src='./templates/10/images/Info.png' alt='CrazyHours' height='48' width='48' /><em>CrazyHour</em>
         "
." Crazyhour will be ".get_date($crazyhour['crazyhour']['var'], '')."  
         "
.mkprettytime($crazyhour['crazyhour']['var'] - TIME_NOW)." remaining till Crazyhour
        </span></a></li>"
;
        }
        else 
// make date look prettier with countdown etc even :]
        
$htmlout .="
        <li>
         <a class='tooltip' href='#'>CrazyHour<span class='custom info'><img src='./templates/10/images/Info.png' alt='CrazyHours' height='48' width='48' /><em>CrazyHour</em>
         "
." Crazyhour will be ".get_date($crazyhour_var'')."  
         "
.mkprettytime($crazyhour_var TIME_NOW)." remaining till Crazyhour
        </span></a></li>"
;
        }
      // crazyhour end
?>

now when the times up its not telling user crazyhour up and not going into shoutbox or at top of site telling everyone crazyhour for said time on said torrents any thous on this one please?