Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - effemmess

Pages: [1]
1
UPDATE 10.07.2013
10 years later some additions - see below

UPDATE 17.11.2003
Now it works with all providers...
:) :) :)
==============================================

Hi,

I edited the function check_email() in functions.php to check if a email-address is valid or not... With this extended version of this function many invalid mail-entries will be rejected in registration-form :) (but not all, because yahoo,... :( ).

I don´t know, if this mod works if you configured your 4images to use smtp. I think, ther must be some edits for this... Try it out and tell me your results (and your solution! ;) ).

to do:
replace in .../4images/includes/functions.php:
Code: [Select]
function check_email($email) {
...
}



with:

Code: [Select]
function check_email($email) {
  $state=0;
  $helo_server=gethostbyaddr(gethostbyname($_SERVER["HTTP_HOST"]));
  $from=$_SERVER["SERVER_ADMIN"];
  if (preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+\.)+([0-9A-Z]){2,4}$/i', $email) && !mailcheck($email, 2)) {
    list($mailbox,$domain) = explode('@',$email,2);
    // find preferred mailserver
    if(getmxrr($domain,$mailhosts,$pref)){
      array_multisort($mailhosts,$pref);
    }
    $mailhosts[]=$domain;
    foreach($mailhosts as $hosts){
      if($connection) {
        fputs($connection, "QUIT\r\n");
        fclose ($connection);
      }
      $mailserver =  $hosts;
      // Open an SMTP connection
      $connection = @fsockopen ($mailserver, 25, $errno, $errstr, 1);
      if (!$connection) continue;
      socket_set_timeout($connection, 3);
      $res=get_lines($connection);
      if(checkres($res) != "220") continue;

      // Introduce ourselves
      $sendstring="EHLO ".$helo_server."\r\n";
      fputs($connection,$sendstring);
      $res=get_lines($connection);
      if(checkres($res) != "250"){
        $sendstring="HELO ".$helo_server."\r\n";
        fputs($connection,$sendstring);
        $res=get_lines($connection);
      }
      if(checkres($res) != "250") continue;
      
      // Envelope from
      $sendstring="MAIL FROM: <".$from.">\r\n";
      fputs($connection,$sendstring);
      $res=get_lines($connection);
      if(checkres($res) != "250") continue;

      // Envelope to
      $sendstring="RCPT TO: <".trim($email).">\r\n";
      fputs($connection,$sendstring);
      $res=get_lines($connection);
      if(checkres($res) != "250") continue;

/*
    // Verify address
    $sendstring="VRFY <".$mailbox.">\r\n";
    print_res($sendstring,"Q");
    fputs($connection,$sendstring);
    $res=get_lines($connection);
    print_res($res,"A");
    if(checkres($res) != "250") continue;

    // The message
    $sendstring="DATA\r\n";
    print_res($sendstring,"Q");
    fputs($connection,$sendstring);
    $res=get_lines($connection);
    print_res($res,"A");
    if(checkres($res) != "354") continue;

    // Send To:, From:, Subject:, other headers, blank line, message, and finish
    // with a period on its own line.
    $sendstring="To: ".trim($_POST['p_email'])."\r\nFrom: $from\r\nSubject: $subject\r\n$headers\r\n\r\n$message\r\n.\r\n";
    print_res($sendstring,"Q");
    fputs($connection,$sendstring);
    $res=get_lines($connection);
    print_res($res,"A");
    if(checkres($res) != "250") continue;
*/
  
      // Say bye bye
      $sendstring="QUIT\r\n";
      fputs($connection,$sendstring);
      $res=get_lines($connection);
      if(checkres($res) != "250" && checkres($res) != "221") continue;
      fclose ($connection);
      // It worked! So break out of the loop which tries all the mail exchangers.
      $state=1;
      break;
    }      
  }
  return $state;
}

function mailcheck($Addr, $Level, $Timeout = 15000) {
    
//  Valid Top-Level Domains
    $gTLDs = "com:net:org:edu:gov:mil:int:arpa:aero:biz:coop:info:museum:name:";
    $CCs   = "ad:ae:af:ag:ai:al:am:an:ao:aq:ar:as:at:au:aw:az:ba:bb:bd:be:bf:".
             "bg:bh:bi:bj:bm:bn:bo:br:bs:bt:bv:bw:by:bz:ca:cc:cf:cd:cg:ch:ci:".
             "ck:cl:cm:cn:co:cr:cs:cu:cv:cx:cy:cz:de:dj:dk:dm:do:dz:ec:ee:eg:".
             "eh:er:es:et:fi:fj:fk:fm:fo:fr:fx:ga:gb:gd:ge:gf:gh:gi:gl:gm:gn:".
             "gp:gq:gr:gs:gt:gu:gw:gy:hk:hm:hn:hr:ht:hu:id:ie:il:in:io:iq:ir:".
             "is:it:jm:jo:jp:ke:kg:kh:ki:km:kn:kp:kr:kw:ky:kz:la:lb:lc:li:lk:".
             "lr:ls:lt:lu:lv:ly:ma:mc:md:mg:mh:mk:ml:mm:mn:mo:mp:mq:mr:ms:mt:".
             "mu:mv:mw:mx:my:mz:na:nc:ne:nf:ng:ni:nl:no:np:nr:nt:nu:nz:om:pa:".
             "pe:pf:pg:ph:pk:pl:pm:pn:pr:pt:pw:py:qa:re:ro:ru:rw:sa:sb:sc:sd:".
             "se:sg:sh:si:sj:sk:sl:sm:sn:so:sr:st:su:sv:sy:sz:tc:td:tf:tg:th:".
             "tj:tk:tm:tn:to:tp:tr:tt:tv:tw:tz:ua:ug:uk:um:us:uy:uz:va:vc:ve:".
             "vg:vi:vn:vu:wf:ws:ye:yt:yu:za:zm:zr:zw:";
    
//  The countries can have their own 'TLDs', e.g. mydomain.com.au
    $cTLDs = "com:net:org:edu:gov:mil:co:ne:or:ed:go:mi:aero:biz:coop:info:museum:name:";

    $fail = 0;
    
//  Shift the address to lowercase to simplify checking and trim
    $Addr = trim(strtolower($Addr));
    
//  Check for spaces
    if (ereg(" ", $Addr)) $fail = 1;

//  Split the Address into user and domain parts
    $UD = explode("@", $Addr);
    if (sizeof($UD) != 2 || !$UD[0]) $fail = 1;

//  Split the domain part into its Levels
    $Levels = explode(".", $UD[1]); $sLevels = sizeof($Levels);
    if (!$Levels[0] || !$Levels[1]) $fail = 1;

//  Get the TLD, strip off trailing ] } ) > and check the length
    $tld = $Levels[$sLevels-1];
    $tld = ereg_replace("[>)}]$|]$", "", $tld);
    if (strlen($tld) < 2
    || (strlen($tld) > 3 && !ereg(":$tld:", ":arpa:aero:coop:info:museum:name:"))) $fail = 1;

    $Level--;

//  If the string after the last dot isn't in the generic TLDs or country codes, it's invalid.
    if ($Level && !$fail) {
    $Level--;
    if (!ereg($tld.":", $gTLDs) && !ereg($tld.":", $CCs)) $fail = 2;
    }

//  If it's a country code, check for a country TLD; add on the domain name.
    if ($Level && !$fail) {
    $cd = $sLevels - 2; $domain = $Levels[$cd].".".$tld;
    if (ereg($Levels[$cd].":", $cTLDs)) { $cd--; $domain = $Levels[$cd].".".$domain; }
    }
    echo $fail;
    return $fail;
} //Mailcheck

 


Have fun!

[EDITED by V@no]
this mod is missing get_lines() function, because of that it doesn't work.

[EDITED by effemmess]
Here are some functions I used in some scripts, also the missing get_lines() function. I don´t know if it now works, at that time it worked for me. But now I haven´t a 4images-system, so I can´t test it.  :oops:

Code: [Select]
function get_lines($fp){
  $res = "";
  while($data = fgets($fp,515)) {
    $res .= $data;
    if(substr($data,3,1) == " ") { break; }
  }
return $res;
}

function checkres($res){
return substr($res,0,3);
}

function print_res($res,$typus){
  if ($typus=="A") {
    printf ("<b>Antwort:</b><br>");
  } elseif ($typus=="Q") {
    printf ("<b>Frage:</b><br>");
  }
  printf ($res."<br />");
return;
}


Have fun!

2
Mods & Plugins (Releases & Support) / [MOD]More than more statistics
« on: June 27, 2003, 03:59:07 PM »
Hallo an alle Statistik-Fetischisten!

ich bin dabei eine neue stats.php zu programmieren, die erstens viele Auswertungsmöglichkeiten bietet und zweitens sehr flexibel einsetzbar ist.
Die Idee dazu war geboren nach der Implementation von Vraxor´s stats.php. :D

Bisher (V1.0) habe ich verschiedene Funktionalitäten zur Auswertung der user und der votes eingebaut. Weitere werden folgen... :)
Als Beispiel schaut euch folgende Site an:http://www.auf-einem-blick.de/4images/index.php

Mindestvoraussetzungen:
- 4images 1.7  :wink:
erweiterte Voraussetzungen (nicht zwingend erforderlich aber sehr hilfreich!):
- v@no´s Votes saved in DB
- effemmess´s Extension for Votes saved in DB
- effemmess´s Old votes 2 DB


1. neue .../includes/stats.php anlegen
 (vorher natürlich evtl. existierende sichern!)
einfügen:
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);
?>

2. Sprachdatei ergänzen - .../lang/xxx/main.php:
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'];

für die beiden enthaltenen Beispiele sind hier noch keine Einträge vorhanden...
 3. .../templates/xxx/style.css ergänzen:
Code: [Select]
.head3 {

  background-color: #e1e1e1;

  color: #ffffff;

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

  font-size: 11px;

  font-weight: bold;

}

4. Templates erstellen - hier: .../templates/xxx/stats_box.html
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>

5.Eintrag {stats} an beliebiger Position in einem Haupt-Template platzieren - hier als Bsp. in .../template/xxx/home.html
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-->
...


Wie schon oben gesagt, werde ich das ganze weiter ausbauen. Es wird weitere Auswertungen für Kommentare, Downloads, Postcards und evtl. auch Hits geben. Die in der stats.php enthaltenen Funktionen werden zukünftig evtl. in die functions.php oder eine functions-stats.php ausgelagert.

Viel Spaß!  :)
effemmess

PS: wenn ihr die erweiterten Voraussetzungen nicht erfüllt, müsst ihr natürlich einige Funktionalitäten aus der stats.php entfernen!!! Man sollte aber leicht erkennen, was dort raus muß... :wink:

V1.0
- first release
V1.1
- bug fixed date(w)

3
Plugins / [Plugin] Old votes 2 DB
« on: June 21, 2003, 11:29:46 PM »
Hier nun das Plugin zur Übernahme der Vote-Daten aus der Tabelle "prefix_images" in die Tabelle "prefix_voted".

Hier nochmal die Links zu den Mods, die zwingende Voraussetzung für dieses plugin sind:

v@no´s Votes saved in DB: http://www.4homepages.de/forum/viewtopic.php?t=6123
effemmess´s Extension for Votes saved in DB: http://www.4homepages.de/forum/viewtopic.php?t=6404

Das Plugin errechnet aus dem aktuellen Rating ein mögliches Voting der user (da das tatsächliche nicht nachvollziehbar ist und verschiedene Varianten möglich sind). Dieses wird in der Tabelle "prefix_voted" mit einer einzustellenden user_id (source editieren! -2 voreingestellt!) und dem aktuellem Datum gespeichert.
Der Nutzen ist, daß man nun verschieden Auswertungen bezüglich der votes machen kann...

Anwendung:
- auspacken
- in das Verzeichnis 4images/admin/plugins kopieren
- Backup der DB !!!
- in Adminkonsole anklicken...

Downloadlink

PS:Der bei mir wichtigste Nutzen: auf meiner Site werden Bilder auch wieder gelöscht; daher würden die Statistiken nicht mehr stimmen. Mit Hilfe eigener Tabellen wird dieses Problem behoben! Allerdings müssen die Standardfunktionen zum Löschen von Bildern bzw. usern usw. noch angepasst werden, damit in den neuen Tabellen auch die entsprechenden Werte stehen (z.B. gelöschter user: user_id=-2). Das werde ich demnächst erledigen...und hier der Link zu meinen Statistiken.

4
Plugins / [Plugin][Mod] Extension for Votes saved in DB
« on: June 21, 2003, 11:13:37 PM »
Ich hab wiedermal ein wenig gebastelt und will euch die Ergebnisse nicht vorenthalten...
Dieses Mod mit Plugin ist zur Erweiterung von v@no´s Mod "Votes saved in DB" Variante A gedacht. Darum hier der Link zum Thread

Das Mod ändert folgendes in der Tabelle "prefix_voted":
1. Ändern der Feldeigenschaft von user_id von unsigned auf signed.
    Bei der Übernahme der Standard-Votings muß eine user-id angegeben werden. Deshalb führe ich für diese Übernahmewerte die user_id=-2 ein.
2. Hinzufügen des Feldes vote_date
    Zur weiteren Auswertung will ich das Vote-Datum mit speichern.

Anwendung:
- auspacken
- in das Verzeichnis 4images/admin/plugins kopieren
- Backup der DB !!!
- in Adminkonsole anklicken...

Nachfolgend kann mein weiteres Plugin zur Übernahme der bestehenden Votes verwendet werden. Hier der Link zum Thread

Downloadlink

5
Plugins / [Plugin] Import images from external webspace (Beta)
« on: June 06, 2003, 06:29:42 PM »
Allgemeines:

- Plugin zum Einstellen von images in die Datenbank von entferntem Webspace (kein Upload)
- entstanden aufgrund http://www.4homepages.de/forum/viewtopic.php?t=5773

Installation:

- Erstelle ein neues Verzeichnis plugins im admin Ordner
- Entpacke das zip
- editiere import_webimages.php (Defaultwerte einstellen)
- kopiere die Datei import_webimages.php in das neue plugins-Verzeichnis
- Logge Dich ins Control Panel ein, in der linken Navigation sollte eine neuer Menüpunkt erscheinen
- Draufklicken und Spass haben  :) 
- Kommentare, Hilfe und Vorschläge sind willkommen!
---------------------------------------------------------------------------------

General informations:

- Plugin for puting images into database from external webspace (no upload)
- developed due to http://www.4homepages.de/forum/viewtopic.php?t=5773

Installation:

- Create a new directory called plugins in your admin-folder
- Extract the zip
- edit import_webimages.php (set defaults)
- copy the file import_webimages.php to the new plugins-directory
- log in to your Control Panel, a new link should appear in the left navigation frame
- Click it an have fun  :)
- comments, help and suggestions are welcome


Download: http://pub.comnetonline.de/import_webimages_0.8.1.zip

Änderungen in V0.8.1:
- Änderung der Dateiendung der config-Datei
--------------------------------------------------------------
changes in V0.8.1
- config-file-extension changed
===================================
Änderungen in V0.8:
- Verarbeitung von Prefixes für Thumbnails integriert
- Auslagerung der Defaultwerte in eigene config-Datei
- einige Kommentare entfernt
--------------------------------------------------------------
changes in V0.8
- processing of thumb-prefixes
- paged out default values to its own config-file
- some comments removed

Pages: [1]