Author Topic: ممكن حد يساعدنا لكي نركب هاذي الأحصائيات ا  (Read 17219 times)

0 Members and 1 Guest are viewing this topic.

Offline wasak

  • Newbie
  • *
  • Posts: 31
    • View Profile
السلام عليكم

هذا  احصائيات جديد ومتطورة ومطلوب حد يساعدنا في تركيبها هم شارحين ولاكن ما اعرف اي لغية

http://www.4homepages.de/forum/index.php?topic=6484.0

Offline asms

  • Full Member
  • ***
  • Posts: 154
    • View Profile
طيب لحضة شوي :D

Offline wasak

  • Newbie
  • *
  • Posts: 31
    • View Profile
اخوي تم التركيب والأحصائيات شغالة

ولاكن ضهرة مشكلة
« Last Edit: September 13, 2008, 02:33:18 PM by wasak »

Offline asms

  • Full Member
  • ***
  • Posts: 154
    • View Profile
انشاء صفحة باسم
stats.php
في مجلد
.../includes/
مثل
.../includes/stats.php
اضف التالي في الملف
Code: [Select]
<?PHP
//-----------------------------------------------------
//--- stats.php V1.1 by effemmess ---------------------
//--- based on Vraxor´s stats.php ---------------------
//--- for 4images V1.7 by Jan -------------------------
//-----------------------------------------------------

//-----------------------------------------------------
//--- Variableninitialisierung-------------------------
//-----------------------------------------------------
$time=time();
$m1 =60;
$h1 =$m1*60;
$T1 =$h1*24;
$T7 =$T1*7;
$T30=$T1*30;
(date("w",$time)==0) ? $date_w = 7 : $date_w = date("w",$time);


$ts_today_at_0           =mktime(0,0,0,date("m",$time),date("d",$time),date("Y",$time));
$ts_yesterday_at_0       =$ts_today_at_0-$T1;
$ts_1st_of_month         =mktime(0,0,0,date("m",$time),1,date("Y",$time));
$ts_1st_of_month_before  =mktime(0,0,0,date("m",$ts_1st_of_month-1),1,date("Y",$ts_1st_of_month-1));
$ts_this_monday          =$ts_today_at_0-$T1*($date_w-1);
$ts_last_monday          =$ts_this_monday-$T7;
$ts_24h_before           =$time-$T1;
$ts_7days_before         =$time-$T7;
$ts_30days_before        =$time-$T30;

//-----------------------------------------------------
//--- Funktionen --------------------------------------
//-----------------------------------------------------
function sql_add($from=0,$to=0,$field){
  $sql_add_from=$field." >= ".$from;
  $sql_add_to  =$field." <= ".$to;
  $sql_add = "";
  if ($from != 0 ||$to != 0){
    if ($from != 0) $sql_add .=$sql_add_from;
    if ($from != 0 && $to != 0) $sql_add .=" AND ";
    if ($to   != 0) $sql_add .=$sql_add_to;
  }
  return $sql_add;
}

function num_users($from=0,$to=0,$field="user_joindate"){
  global $site_db, $select_mode;

  if ($from != 0 ||$to != 0){
    $sql_where=" AND ";
  }
  $sql = "SELECT COUNT(*) as users
          FROM ".USERS_TABLE."
          WHERE user_id <> ".GUEST.$sql_where.sql_add($from,$to,$field);
  $row = $site_db->query_firstrow($sql);
  $num_users = $row['users'];
  return $num_users;
}
function num_votes_itable($from=0,$to=0,$field="image_date"){
  global $site_db, $select_mode;

  if ($from != 0 ||$to != 0){
    $sql_where=" WHERE ";
  }
  $sql = "SELECT SUM(image_votes) AS votes
          FROM ".IMAGES_TABLE.$sql_where.sql_add($from,$to,$field);  
  $row = $site_db->query_firstrow($sql);
  $num_votes = (isset($row['votes'])) ? $row['votes'] : 0;
  return $num_votes;
}

function num_votes_vtable($from=0,$to=0,$field="vote_date"){
  global $site_db, $select_mode;
  if ($from != 0 ||$to != 0){
    $sql_where=" WHERE ";
  }
  $sql = "SELECT count(*) AS votes
          FROM ".VOTED_TABLE.$sql_where.sql_add($from,$to,$field);  
  $row = $site_db->query_firstrow($sql);
  $num_votes = (isset($row['votes'])) ? $row['votes'] : 0;
  return $num_votes;
}
//-----------------------------------------------------
//--- Show number of Users ----------------------------
//-----------------------------------------------------
//total
  $total_users = num_users();
  $lang_total_users = $lang['users'];
  $lang_since_begin_new_users = $lang['since_begin_new_users'];
  $site_template->register_vars("total_users", $total_users);
  $site_template->register_vars("lang_total_users", $lang_total_users);
  $site_template->register_vars("lang_since_begin_new_users", $lang_since_begin_new_users);
  unset($total_users);
  unset($lang_total_users);
//today new
  $today_new_users = num_users($ts_today_at_0,0);
  $lang_today_new_users = $lang['today_new_users'];
  $site_template->register_vars("today_new_users", $today_new_users);
  $site_template->register_vars("lang_today_new_users", $lang_today_new_users);
  unset($today_new_users);
  unset($lang_today_new_users);
//yesterday new
  $yesterday_new_users = num_users($ts_yesterday_at_0,$ts_today_at_0);
  $lang_yesterday_new_users = $lang['yesterday_new_users'];
  $site_template->register_vars("yesterday_new_users", $yesterday_new_users);
  $site_template->register_vars("lang_yesterday_new_users", $lang_yesterday_new_users);
  unset($yesterday_new_users);
  unset($lang_yesterday_new_users);
//this week new
  $this_week_new_users = num_users($ts_this_monday,0);
  $lang_this_week_new_users = $lang['this_week_new_users'];
  $site_template->register_vars("this_week_new_users", $this_week_new_users);
  $site_template->register_vars("lang_this_week_new_users", $lang_this_week_new_users);
  unset($this_week_new_users);
  unset($lang_this_week_new_users);
//last week new
  $last_week_new_users = num_users($ts_last_monday,$ts_this_monday);
  $lang_last_week_new_users = $lang['last_week_new_users'];
  $site_template->register_vars("last_week_new_users", $last_week_new_users);
  $site_template->register_vars("lang_last_week_new_users", $lang_last_week_new_users);
  unset($last_week_new_users);
  unset($lang_last_week_new_users);
//this month new
  $this_month_new_users = num_users($ts_1st_of_month,0);
  $lang_this_month_new_users = $lang['this_month_new_users'];
  $site_template->register_vars("this_month_new_users", $this_month_new_users);
  $site_template->register_vars("lang_this_month_new_users", $lang_this_month_new_users);
  unset($this_month_new_users);
  unset($lang_this_month_new_users);
//last month new
  $last_month_new_users = num_users($ts_1st_of_month_before,$ts_1st_of_month);
  $lang_last_month_new_users = $lang['last_month_new_users'];
  $site_template->register_vars("last_month_new_users", $last_month_new_users);
  $site_template->register_vars("lang_last_month_new_users", $lang_last_month_new_users);
  unset($last_month_new_users);
  unset($lang_last_month_new_users);

//-----------------------------------------------------
//--- Votes -------------------------------------------
//-----------------------------------------------------
//total
  $total_votes = num_votes_vtable();
  $lang_total_votes = $lang['votes'];
  $lang_since_begin_new_votes = $lang['since_begin_new_votes'];
  $site_template->register_vars("total_votes", $total_votes);
  $site_template->register_vars("lang_total_votes", $lang_total_votes);
  $site_template->register_vars("lang_since_begin_new_votes", $lang_since_begin_new_votes);
  unset($total_votes);
  unset($lang_total_votes);
//today new
  $today_new_votes = num_votes_vtable($ts_today_at_0,0);
  $lang_today_new_votes = $lang['today_new_votes'];
  $site_template->register_vars("today_new_votes", $today_new_votes);
  $site_template->register_vars("lang_today_new_votes", $lang_today_new_votes);
  unset($today_new_votes);
  unset($lang_today_new_votes);
//yesterday new
  $yesterday_new_votes = num_votes_vtable($ts_yesterday_at_0,$ts_today_at_0);
  $lang_yesterday_new_votes = $lang['yesterday_new_votes'];
  $site_template->register_vars("yesterday_new_votes", $yesterday_new_votes);
  $site_template->register_vars("lang_yesterday_new_votes", $lang_yesterday_new_votes);
  unset($yesterday_new_votes);
  unset($lang_yesterday_new_votes);
//this week new
  $this_week_new_votes = num_votes_vtable($ts_this_monday,0);
  $lang_this_week_new_votes = $lang['this_week_new_votes'];
  $site_template->register_vars("this_week_new_votes", $this_week_new_votes);
  $site_template->register_vars("lang_this_week_new_votes", $lang_this_week_new_votes);
  unset($this_week_new_votes);
  unset($lang_this_week_new_votes);
//last week new
  $last_week_new_votes = num_votes_vtable($ts_last_monday,$ts_this_monday);
  $lang_last_week_new_votes = $lang['last_week_new_votes'];
  $site_template->register_vars("last_week_new_votes", $last_week_new_votes);
  $site_template->register_vars("lang_last_week_new_votes", $lang_last_week_new_votes);
  unset($last_week_new_votes);
  unset($lang_last_week_new_votes);
//this month new
  $this_month_new_votes = num_votes_vtable($ts_1st_of_month,0);
  $lang_this_month_new_votes = $lang['this_month_new_votes'];
  $site_template->register_vars("this_month_new_votes", $this_month_new_votes);
  $site_template->register_vars("lang_this_month_new_votes", $lang_this_month_new_votes);
  unset($this_month_new_votes);
  unset($lang_this_month_new_votes);
//last month new
  $last_month_new_votes = num_votes_vtable($ts_1st_of_month_before,$ts_1st_of_month);
  $lang_last_month_new_votes = $lang['last_month_new_votes'];
  $site_template->register_vars("last_month_new_votes", $last_month_new_votes);
  $site_template->register_vars("lang_last_month_new_votes", $lang_last_month_new_votes);
  unset($last_month_new_votes);
  unset($lang_last_month_new_votes);
//by 10<=user_id<=20 (example!)
  $from =18;
  $to   =18;
  $field="user_id";
  $user_id_votes = num_votes_vtable($from,$to,$field);
  $lang_user_id_votes = $lang['user_id_votes'];
  $site_template->register_vars("user_id_votes", $user_id_votes);
  $site_template->register_vars("lang_user_id_votes", $lang_user_id_votes);
  unset($user_id_votes);
  unset($lang_user_id_votes);
//by 1000<=image_id<=2000 (example!)
  $from =1000;
  $to   =2000;
  $field="image_id";
  $image_id_votes = num_votes_itable($from,$to,$field);
  $lang_image_id_votes = $lang['image_id_votes'];
  $site_template->register_vars("image_id_votes", $image_id_votes);
  $site_template->register_vars("lang_image_id_votes", $lang_image_id_votes);
  unset($image_id_votes);
  unset($lang_image_id_votes);

//-----------------------------------------------------
//--- Hits --------------------------------------------
//-----------------------------------------------------
  $sql = "SELECT SUM(image_hits) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_hits = $row['sum'];
  $lang_total_hits = $lang['total_hits'];
  
  $site_template->register_vars("total_hits", $total_hits);
  $site_template->register_vars("lang_total_hits", $lang_total_hits);
  unset($total_hits);
  unset($lang_total_hits);

//-----------------------------------------------------
//--- Downloads ---------------------------------------
//-----------------------------------------------------
  $sql = "SELECT SUM(image_downloads) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_downloads = $row['sum'];
  $lang_total_downloads = $lang['total_downloads'];
  
  $site_template->register_vars("total_downloads", $total_downloads);
  $site_template->register_vars("lang_total_downloads", $lang_total_downloads);
  unset($total_downloads);
  unset($lang_total_downloads);

//-----------------------------------------------------
//--- Comments ----------------------------------------
//-----------------------------------------------------
  $sql = "SELECT SUM(image_comments) AS sum
          FROM ".IMAGES_TABLE;
  $row = $site_db->query_firstrow($sql);

  $sum = (isset($row['sum'])) ? $row['sum'] : 0;
  $total_comments = $row['sum'];
  $lang_total_comments = $lang['total_comments'];
  
  $site_template->register_vars("total_comments", $total_comments);
  $site_template->register_vars("lang_total_comments", $lang_total_comments);
  unset($total_comments);
  unset($lang_total_comments);

  $lang_total_images = $lang['total_images'];
  $site_template->register_vars("lang_total_images", $lang_total_images);
  unset($lang_total_comments);
  $lang_total_categories = $lang['total_categories'];
  $site_template->register_vars("lang_total_categories", $lang_total_categories);
  unset($lang_total_categories);

//-----------------------------------------------------
//--- Templates ---------------------------------------
//-----------------------------------------------------
  $stats = $site_template->parse_template("stats_box");
  $site_template->register_vars("stats", $stats);
  unset($stats);
?>
اضف التالي في
/lang/xxx/main.php
xxx ملف اللغة العرببة
Code: [Select]
//-----------------------------------------------------
//--- Statistics --------------------------------------
//-----------------------------------------------------
$lang['total_images']          = "Bilder:";
$lang['total_categories']      = "Kategorien:";
$lang['users']                 = "Mitglieder:";
$lang['total_hits']            = "Hits:";
$lang['total_votes']           = "Votes:";
$lang['total_downloads']       = "Downloads:";
$lang['total_comments']        = "Kommentare:";

$lang['today_new_users']       = "heute:";
$lang['yesterday_new_users']   = "gestern:";
$lang['this_week_new_users']   = "diese Woche:";
$lang['last_week_new_users']   = "letzte Woche:";
$lang['this_month_new_users']  = "diesen Monat:";
$lang['last_month_new_users']  = "letzten Monat:";
$lang['since_begin_new_users'] = "seit Anfang:";
                                                                  
$lang['today_new_votes']       = $lang['today_new_users'];      
$lang['yesterday_new_votes']   = $lang['yesterday_new_users'];  
$lang['this_week_new_votes']   = $lang['this_week_new_users'];
$lang['last_week_new_votes']   = $lang['last_week_new_users'];
$lang['this_month_new_votes']  = $lang['this_month_new_users'];
$lang['last_month_new_votes']  = $lang['last_month_new_users'];
$lang['since_begin_new_votes'] = $lang['since_begin_new_users'];
اضاف التالي في
ملف
/templates/xxx/style.css
xxx الثيم المستخدام
Code: [Select]
.head3 {

  background-color: #e1e1e1;

  color: #ffffff;

  font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;

  font-size: 11px;

  font-weight: bold;

}
انشاء ملف باسم
stats_box.html
في
/templates/xxx/stats_box.html
xxx الثيم المستخدام

Code: [Select]
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="head2" height="20" align="center">S i t e - S t a t i s t i k</td>
  </tr>
  <tr>
    <td class="head3" height="20" align="center">Gesamt-Statistik</td>
  </tr>
  <tr>
    <td class="row2">
      <table width="100%" border="0">
        <tr class="row1">
          <td align="left" width=60%>
            {lang_total_images}<br>
            {lang_total_categories}<br>
            {lang_total_users}<br>
            {lang_total_hits}<br>
            {lang_total_downloads}
            {lang_total_votes}<br>
            {lang_total_comments}<br>
          </td>
          <td align="right" width="40%">
            <B>{total_images}</B><br>
            <B>{total_categories}</B><br>
            <B>{total_users}</B><br>
            <B>{total_hits}</B><br>
            <B>{total_downloads}</B><br>
            <B>{total_votes}</B><br>
            <B>{total_comments}</B><br>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="head3" height="20" align="center">neue Mitglieder</td>
  </tr>
  <tr>
    <td class="row2">
      <table width="100%" border="0">
        <tr class="row1">
          <td align="left" width=60%>
            {lang_today_new_users}<br>
            {lang_yesterday_new_users}<br>
            {lang_this_week_new_users}<br>
            {lang_last_week_new_users}<br>
            {lang_this_month_new_users}<br>
            {lang_last_month_new_users}<br>
            {lang_since_begin_new_users}<br>
          </td>
          <td align="right" width="40%">
            <B>{today_new_users}</B><br>
            <B>{yesterday_new_users}</B><br>
            <B>{this_week_new_users}</B><br>
            <B>{last_week_new_users}</B><br>
            <B>{this_month_new_users}</B><br>
            <B>{last_month_new_users}</B><br>
            <B>{total_users}</B><br>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="head3" height="20" align="center">neue Stimmen</td>
  </tr>
  <tr>
    <td class="row2">
      <table width="100%" border="0">
        <tr class="row1">
          <td align="left" width=60%>
            {lang_today_new_votes}<br>
            {lang_yesterday_new_votes}<br>
            {lang_this_week_new_votes}<br>
<!--
            {lang_last_week_new_votes}<br>
            {lang_this_month_new_votes}<br>
            {lang_last_month_new_votes}<br>
-->
            {lang_since_begin_new_votes}<br>
          </td>
          <td align="right" width="40%">
            <B>{today_new_votes}</B><br>
            <B>{yesterday_new_votes}</B><br>
            <B>{this_week_new_votes}</B><br>
<!--
            <B>{last_week_new_votes}</B><br>
            <B>{this_month_new_votes}</B><br>
            <B>{last_month_new_votes}</B><br>
-->
            <B>{total_votes}</B><br>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
</table>
وافي الصفحة
home.html
الي في
.../template/xxx/home.html
xxx الثيم المستخدام
ابحث عن
Code: [Select]
{stats}واستبدالة
Code: [Select]
<!--rechts-->
 {if random_image}
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head2" height="20" align="center"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_random_image}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                    <tr>
                      <td align="center" class="row1">
   <br />
                        {random_image}
<br />
                        <br />
                      </td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
                    </tr>
                  </table>
 {endif random_image}
 {potd_image}
                  {stats}
<!--rechts Ende-->

Offline wasak

  • Newbie
  • *
  • Posts: 31
    • View Profile
شكرا لك اخوي وجاري التجربة

Offline asms

  • Full Member
  • ***
  • Posts: 154
    • View Profile
اخوي الخطاء
An unexpected error occured. Please try again later.
القاعدة MySQLمن
كل شوي تطلع عندي في الموقع
http://2game2.com

Offline wasak

  • Newbie
  • *
  • Posts: 31
    • View Profile
اخوي لا يوجد    

 {stats}

في الملف  

home.html

Offline asms

  • Full Member
  • ***
  • Posts: 154
    • View Profile
انت مركبة
هذي طريقة التركيب
بس

Offline wasak

  • Newbie
  • *
  • Posts: 31
    • View Profile
بس اخوي خطوة الأخيرة ما سويتها

نسخة الكود ولصقتة في الملف
home.html

Offline wasak

  • Newbie
  • *
  • Posts: 31
    • View Profile
طيب اخوي

في  احصائيات ثانية مركبة في موقع عربي

مثال
http://www.m111m.com/4images/





الأضافة  هي
عدد الصور


Offline asms

  • Full Member
  • ***
  • Posts: 154
    • View Profile
Re: ممكن حد يساعدنا لكي نركب هاذي الأحصائيات ا
« Reply #10 on: September 13, 2008, 02:15:07 PM »
اخوي عندك
مشكلة ثانية
عند التسجيل


Offline wasak

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: ممكن حد يساعدنا لكي نركب هاذي الأحصائيات ا
« Reply #12 on: September 13, 2008, 02:17:53 PM »
اخوي الأحصائيات

$lang['users'] = "عدد الأعضاء:";
$lang['total_hits'] = "عدد الزيارات:";
$lang['total_votes'] = "عدد التصويتات:";
$lang['total_downloads'] = "عدد مرات التنزيل:";
$lang['total_comments'] = "عدد التعليقات:";


ناقصها
عدد الصور

Offline asms

  • Full Member
  • ***
  • Posts: 154
    • View Profile
Re: ممكن حد يساعدنا لكي نركب هاذي الأحصائيات ا
« Reply #13 on: September 13, 2008, 02:25:52 PM »
عدد الصور
موجودة في الثيم الاصلي
مثل
http://demo.4homepages.de/?l=english

Offline asms

  • Full Member
  • ***
  • Posts: 154
    • View Profile
Re: ممكن حد يساعدنا لكي نركب هاذي الأحصائيات ا
« Reply #14 on: September 13, 2008, 02:29:17 PM »
اضف هذ الي
home.html
Code: [Select]
{lang_site_stats}

 

Post your comments here