View Single Post
ישן 16-12-05, 10:06   # 3
Espire
משתמש בעל גישה מוגבלת
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
מיקום: ישראל קיריית מלאכי
גיל: 34
הודעות: 441
שלח הודעה באמצעות ICO אל Espire שלח הודעה באמצעות AIM אל Espire שלח הודעה באמצעות MSN אל Espire

Espire לא מחובר  

עוד אחד
כמה פעמים נכנסת לדף מסויים:

PHP קוד:
<?
session_start
();
if(
$_SESSION['Count'])
{
 
$_SESSION['Count']++;
 if(
$_SESSION['Count'] == 10)
  {
    unset(
$_SESSION['Count']);
    echo 
"נכנסת 10 פעמים, המונה אופס";
  }
 else
  {
    echo 
"נכנסת ".$_SESSION['Count']."  פעמים לדף זה";
  }
}
else
{
 
$_SESSION['Count'] = 1;
 echo 
"לא נמצאה אף כניסה שלך, המונה התחיל לספר";
}
?>


ותצוגת תמונות שקוראת מתוך תיקייה ומציגה כסלייד שואו:
PHP קוד:
<?php
    $DIRECTORY 
"./5";
    function 
is_image($file)
    {
        
$ext substr(strrchr(strtolower($file), "."), 1);
        return(
'$ext == "jpg" || $ext == "jpeg" || $ext == "gif" || $ext == "png" ||');
    }
?>
<html>
        <title>התמונות שלי</title>        
        <script language="javascript" type="text/javascript">
        <!--
            var IMAGES = new Array(
            <?php
                
if(!file_exists($DIRECTORY))
                    die(
$DIRECTORY " לא קיימת!");                

                
$dir opendir($DIRECTORY);
                
$count 1;
                
$files = array();

                while(
false !== ($file readdir($dir)))
                    if(
is_dir($file) == false && is_image($file))
                        
$files[sizeof($files)] = $file;

                
closedir($dir);

                if(
sizeof($files) > 0)
                {
                    foreach(
$files as $file)
                    {
                        echo(
"\"./{$DIRECTORY}/{$file}\"");
                        if(
$count sizeof($files))
                            echo(
",");
                        
$count++;
                    }
                }  
            
?>);
            // Variables:
            var DELAY         = 1;  
            var OUTPUT        = "imgSlideshow";
            var NUMBER_OUTPUT = "imgSlideshowPages";

            var intCount      = new Number(0);
            var bolPaused     = false;
            
            var objOutput       = null;  
            var objNumberOutput = null;     
      

            function SetOutput()
            {
                objOutput       = document.getElementById(OUTPUT);
                objNumberOutput = document.getElementById(NUMBER_OUTPUT);
            }

            function DoNumbers()
            {
                objNumberOutput.innerHTML = "";
                for(var i = 1; i <= IMAGES.length; i++)
                    objNumberOutput.innerHTML += "&nbsp;&nbsp;" +
                                      ((intCount == i - 1) ? "<b>[" + String(i) + "]</b>" :
                                      String(i));
            }

            function StartStop(me)
            {
                bolPaused = !bolPaused;
                if(bolPaused)
                    me.innerHTML = "המשך";
                else
                    me.innerHTML = "עצור";
            }

            function RunSlideshow()
            {
                if(objOutput == null)
                    SetOutput();          
                
                if(intCount >= IMAGES.length)
                    intCount = 0;
                
                // Proceed only if not paused
                if(!bolPaused)
                {
                    objOutput.src = IMAGES[intCount];                                
              DoNumbers();
                    intCount++;
                }
                
                window.setTimeout('RunSlideshow()', (DELAY * 1000));
            }
            -->
        </script>
    </head>
    <body onload="RunSlideshow();">
    <div align="center">
            <img src="" id="imgSlideshow" border="0" alt=""><br>
        <span id="imgSlideshowPages"></span><br>
        <a id="imgSlideshowStatus" href="#" onclick="StartStop(this);">עצור</a>
    </div>
    </body>
</html>

ולוח שנה:
PHP קוד:
<html dir="rtl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
<title>לוח שנה על ידי Espire</title>
<style type="text/css">
<!-- 
.table.calendar {
border: 0px solid #efefef; 
border: dashed; 
color: #000000; 
background: #efefef; 
}
.td.today { 
border: 1px solid white; 
color: #000000; 
background: #EFEFEF; 
font-weight: bold;
}
.td.monthdays {
border: 1px solid #434470; 
color: #000000; 
background: #FFFFFF;
}
.td.nonmonthdays { 
border: 1px solid white; 
color: #000000; 
background: #EFEFEF;
}
-->
</style>
<body>
<center>
<font size="4" face="ARIAL"><b><u>
לוח שנה על ידי Espire
</u></b></font><br /><br />
<?php
error_reporting
('0');
ini_set('display_errors''0');

if(!isset(
$_REQUEST['date'])){
   
$date mktime(0,0,0,date('m'), date('d'), date('Y'));
} else {
   
$date $_REQUEST['date'];
}

$day date('d'$date);
$month date('m'$date);
$year date('Y'$date);

$month_start mktime(0,0,0,$month1$year);
$month_name date('M'$month_start);
$month_start_day date('D'$month_start);

switch(
$month_start_day){
    case 
"Sun"$offset 0; break;
    case 
"Mon"$offset 1; break;
    case 
"Tue"$offset 2; break;
    case 
"Wed"$offset 3; break;
    case 
"Thu"$offset 4; break;
    case 
"Fri"$offset 5; break;
    case 
"Sat"$offset 6; break;
}

if(
$month == 1){
   
$num_days_last cal_days_in_month(012, ($year -1));
} else {
   
$num_days_last cal_days_in_month(0, ($month -1), $year);
}
$num_days_current cal_days_in_month(0$month$year);

for(
$i 1$i <= $num_days_current$i++){
    
$num_days_array[] = $i;
}


for(
$i 1$i <= $num_days_last$i++){
    
$num_days_last_array[] = $i;
}


if(
$offset 0){
    
$offset_correction array_slice($num_days_last_array, -$offset$offset);
    
$new_count array_merge($offset_correction$num_days_array);
    
$offset_count count($offset_correction);
}


else {
    
$offset_count 0;
    
$new_count $num_days_array;
}


$current_num count($new_count);

if(
$current_num 35){
   
$num_weeks 6;
   
$outset = (42 $current_num);
} elseif(
$current_num 35){
   
$num_weeks 5;
   
$outset = (35 $current_num);
}
if(
$current_num == 35){
   
$num_weeks 5;
   
$outset 0;
}
// Outset Correction
for($i 1$i <= $outset$i++){
   
$new_count[] = $i;
}

$weeks array_chunk($new_count7);



$previous_link "<a href=\"".$_SERVER['PHP_SELF']."?date=";
if(
$month == 1){
   
$previous_link .= mktime(0,0,0,12,$day,($year -1));
} else {
   
$previous_link .= mktime(0,0,0,($month -1),$day,$year);
}
$previous_link .= "\">חודש קודם</a>";

$next_link "<a href=\"".$_SERVER['PHP_SELF']."?date=";
if(
$month == 12){
   
$next_link .= mktime(0,0,0,1,$day,($year 1));
} else {
   
$next_link .= mktime(0,0,0,($month +1),$day,$year);
}
$next_link .= "\">חודש הבא</a>";

echo 
"<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" width=\"300\" class=\"calendar\" style=\"border: dashed\" bordercolor=\"#efefef\">\n".
     
"<tr>\n".
     
"<td colspan=\"7\">\n".
     
"<table align=\"center\">\n".
     
"<tr>\n".
     
"<td colspan=\"2\" width=\"75\" align=\"left\">$previous_link</td>\n".
     
"<td colspan=\"3\" width=\"150\" align=\"center\">$month_name $year</td>\n".
     
"<td colspan=\"2\" width=\"75\" align=\"right\">$next_link</td>\n".
     
"</tr>\n".
     
"</table>\n".
     
"</td>\n".
     
"<tr>\n".
     
"<td>ראשון</td><td>שני</td><td>שלישי</td><td>רביעי</td><td>חמישי</td><td>שישי</td><td>שבת</td>\n".
     
"</tr>\n";

$i 0;
foreach(
$weeks AS $week){
       echo 
"<tr>\n";
       foreach(
$week as $d){
         if(
$i $offset_count){
             
$day_link "<a href=\"".$_SERVER['PHP_SELF']."?date=".mktime(0,0,0,$month -1,$d,$year)."\">$d</a>";
             echo 
"<td class=\"nonmonthdays\">$day_link</td>\n";
         }
         if((
$i >= $offset_count) && ($i < ($num_weeks 7) - $outset)){
            
$day_link "<a href=\"".$_SERVER['PHP_SELF']."?date=".mktime(0,0,0,$month,$d,$year)."\">$d</a>";
           if(
$date == mktime(0,0,0,$month,$d,$year)){
               echo 
"<td class=\"today\">$d</td>\n";
           } else {
               echo 
"<td class=\"days\">$day_link</td>\n";
           }
        } elseif((
$outset 0)) {
            if((
$i >= ($num_weeks 7) - $outset)){
               
$day_link "<a href=\"".$_SERVER['PHP_SELF']."?date=".mktime(0,0,0,$month +1,$d,$year)."\">$d</a>";
               echo 
"<td class=\"nonmonthdays\">$day_link</td>\n";
           }
        }
        
$i++;
      }
      echo 
"</tr>\n";   
}
echo 
'<tr><td colspan="7" class="days"> </td></tr>';
echo 
'</table>';
?>
</center>
</body>
</html>
  Reply With Quote