Author Topic: [Mod] Personal Greeting, and how many Images since last Visit  (Read 27789 times)

0 Members and 1 Guest are viewing this topic.

Rembrandt

  • Guest
Hi!

This modification  can personally greet your Guests and Members, and he can see how many Images since last Visit.
How many Images since last Visit works but without search result, do you want a correct searchresult,
 you must install step 2.) 2.1) and 2.2.) from this mod:
 http://www.4homepages.de/forum/index.php?topic=29119.0

1.) search in lang/yourlang/main.php "?>" and add before:
(deutsch)

//################## Start Personal Greeting  #############
$lang['user_good_morning'] = "Guten Morgen! ";
$lang['user_hello'] = "Guten Tag! ";
$lang['user_good_evening'] = "Guten Abend! ";
$lang['last_visit'] = "Dein letzter Besuch war vor:";
$lang['today_is'] = "Heute ist der: ";
$lang['new_images_since'] = "Neue Bilder seit deinem Letzten Besuch:";
$lang['years'] = " Jahr(en) ";
$lang['months'] = " Monat(en) ";
$lang['days'] = " Tag(en) ";
$lang['hours'] = " Std. ";
$lang['min'] = " Min. und ";
$lang['sec'] = " Sek. <br>";
//################## End Personal Greeting  ###############

(english)

//################## Start Personal Greeting  #############
$lang['user_good_morning'] = "Good Morning! ";
$lang['user_hello'] = "Good Day! ";
$lang['user_good_evening'] = "Good Evening! ";
$lang['last_visit'] = "Your last visit was before:";
$lang['today_is'] = "Today is: ";
$lang['new_images_since'] = "New Images since last Visit:";
$lang['years'] = " Year(s) ";
$lang['months'] = " Month(s) ";
$lang['days'] = " Day(s) ";
$lang['hours'] = " Hours. ";
$lang['min'] = " Min. and ";
$lang['sec'] = " Sec. <br>";
//################## Start Personal Greeting  #############


2.) search in includes/functions.php "?>" and add before:

//################## Start Personal Greeting  #############
function date_difference($d1$d2){
  
$d1 = (is_string($d1) ? strtotime($d1) : $d1);
  
$d2 = (is_string($d2) ? strtotime($d2) : $d2);

  
$diff_secs abs($d1 $d2);
  
$base_year min(date("Y"$d1), date("Y"$d2));

  
$diff mktime(00$diff_secs11$base_year);
  return array(
    
"years" => date("Y"$diff) - $base_year,
    
"months_total" => (date("Y"$diff) - $base_year) * 12 date("n"$diff) - 1,
    
"months" => date("n"$diff) - 1,
    
"days_total" => floor($diff_secs / (3600 24)),
    
"days" => date("j"$diff) - 1,
    
"hours_total" => floor($diff_secs 3600),
    
"hours" => date("G"$diff),
    
"minutes_total" => floor($diff_secs 60),
    
"minutes" => (int) date("i"$diff),
    
"seconds_total" => $diff_secs,
    
"seconds" => (int) date("s"$diff)
  );
}
//################## End Personal Greeting  ###############


3.) search in includes/page_header.php

//-----------------------------------------------------
//--- User Box ----------------------------------------
//-----------------------------------------------------

insert below:

//################## Start Personal Greeting  #############
   
if (date("H") <= 10) {
$welcome =  $lang['user_good_morning'];
} elseif (
date("H") <= 18) {
$welcome =  $lang['user_hello'];
} elseif (
date("H") <= 24) {
$welcome $lang['user_good_evening'];
}  

if (
$user_info['user_level'] >= USER) {
  
$sql "SELECT COUNT(image_id) AS new_images
          FROM "
.IMAGES_TABLE."
          WHERE image_active = 1 AND image_date >= "
.$user_info['user_lastvisit']."
          "
;
  
$result $site_db->query($sql);
  
$row mysql_fetch_object($result);
  
$how_new $row->new_images;
  
$format_date preg_replace("#[^a-zA-Z0-9]#",".",$config['date_format']);
  
$format_time preg_replace("#[^a-zA-Z0-9]#",":",$config['time_format']);
  
$date_time $format_date." ".$format_time;
  
  
$user_lastvisit = (date('d.m.Y H:i',$user_info['user_lastvisit']));
  
$search_date_link = ($how_new 0) ?"<a class=\"new\" href=\"".$site_sess->url(ROOT_PATH."search.php?search_date=".$user_lastvisit)." \">".$how_new."</a>"$how_new;

  
$lastvisit = (date('d.m.Y H:i',$user_info['user_lastvisit'])); 
    
  
$end date("Y-m-d H:i:s"time());
  
$current_date date("d.m.Y H:i:s"time());
  
$user_lastvisit = (date('Y-m-d H:i',$user_info['user_lastvisit'])); 
  
$lastaction = (date('Y-m-d H:i',$user_info['user_lastaction']));
  
$date_output date_difference($user_lastvisit$end); 
   
  
$loginmsg "<p style=\"margin:0px 0px 0px 0px;text-align:center;\">".$welcome."<br>";
  
$loginmsg .= "<span class=\"maincat\">".format_text($user_info['user_name'], 2)."</span></p>";
  
$loginmsg .= "<p style=\"text-align:center;margin:0px;\">".$lang['today_is']."".$current_date;
  
$loginmsg .= "<br>".$lang['last_visit']."<br>";
  
$loginmsg .= (!empty($date_output['years']))? $date_output['years'].$lang['years'] : "";
  
$loginmsg .= (!empty($date_output['months']))? $date_output['months'].$lang['months'] : "";
  
$loginmsg .= (!empty($date_output['days']))? $date_output['days'].$lang['days'] : "";
  
$loginmsg .= (!empty($date_output['hours']))? $date_output['hours'].$lang['hours'] : "";
  
$loginmsg .= (!empty($date_output['minutes']))? $date_output['minutes'].$lang['min'] : "";
  
$loginmsg .= (!empty($date_output['seconds']))? $date_output['seconds'].$lang['sec'] : "";
  
$loginmsg .= "am:&nbsp;&nbsp;".$lastvisit."<br>";
  
$loginmsg .= $lang['new_images_since'].$search_date_link."<p>";

}
//################## End Personal Greeting  #############

3.1) search:

$site_template
->register_vars("lang_loggedin_msg"preg_replace("/".$site_template->start."loggedin_user_name".$site_template->end."/siU"format_text($user_info['user_name'], 2), $lang['lang_loggedin_msg']));

and replace:

//################## Start Personal Greeting  #############
//$site_template->register_vars("lang_loggedin_msg", preg_replace("/".$site_template->start."loggedin_user_name".$site_template->end."/siU", format_text($user_info['user_name'], 2), $lang['lang_loggedin_msg']));
  
$site_template->register_vars"lang_loggedin_msg"preg_replace("/".$site_template->start."loggedin_user_name".$site_template->end."/siU"format_text($user_info['user_name'], 2), "<center>".$loginmsg."</b></center>"));
//################## End Personal Greeting  #############

3.2) search:

$user_box 
$site_template->parse_template("user_loginform");

insert above:

//################## Start Personal Greeting  #############
  
$site_template->register_vars"lang_loggedin_msg""<center>".$welcome."<br><b>"$lang['userlevel_guest']."</b></center>");
//################## End Personal Greeting  #############


4.) search in templates/yourTemplates/user_loginform.html:
Code: [Select]
<form action="{url_login}" method="post">
insert above:
Code: [Select]
{lang_loggedin_msg}
mfg Andi
« Last Edit: July 25, 2011, 10:29:55 PM by Rembrandt »

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.289
    • View Profile
    • Discover the New World of Kindersurprise
Re: [Mod] Personal Greeting, and how many Images since last Visit
« Reply #1 on: July 25, 2011, 05:10:19 PM »
mal wieder was für mich  :lol:

Big Thanks
Danke Harald




Rembrandt

  • Guest
Re: [Mod] Personal Greeting, and how many Images since last Visit
« Reply #2 on: July 25, 2011, 05:12:54 PM »
darum habe ich es ja gemacht  :mrgreen:

ne, ich habe ein bischen angefangen das Forum "Mods & Plugins (Releases & Support)" auf zu räumen.
und da der Mod bei mir schon länger herrum liegt habe ich in gepostet.

mfg Andi

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.289
    • View Profile
    • Discover the New World of Kindersurprise
Re: [Mod] Personal Greeting, and how many Images since last Visit
« Reply #3 on: July 25, 2011, 08:25:40 PM »
solltest aber nicht so schnell schreiben  :wink:

Lang/german/english

Code: [Select]
$lang['new_images_since'] = "Neue Bilder seit deinem Letzten Besuch:"
ändern in
$lang['new_images_since'] = "Neue Bilder seit deinem Letzten Besuch:";

mal sehn was ich noch finde  :wink:

edit:

habe noch diesen Fehler

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/vhosts/ue-ei-portal-sammlerkatalog.de/httpdocs/includes/page_header.php on line 588

$loginmsg .= (!empty($date_output['years']))? $date_output['years'].".$lang['years']." "";

einiges versucht, aber ohne Erfolg
« Last Edit: July 25, 2011, 08:42:56 PM by Jan-Lukas »
Danke Harald




Rembrandt

  • Guest
Re: [Mod] Personal Greeting, and how many Images since last Visit
« Reply #4 on: July 25, 2011, 09:37:59 PM »
sorry, step 3.) habe ich erneuert.
ich schreibe die mods immer in eine text datei, wenn ich eine änderung in der *.php vornehme und dann vergesse die änderung auch in der text datei vorzunehmen,
dann passiert sowas.

mfg Andi

Offline Jan-Lukas

  • Addicted member
  • ******
  • Posts: 1.289
    • View Profile
    • Discover the New World of Kindersurprise
Re: [Mod] Personal Greeting, and how many Images since last Visit
« Reply #5 on: July 25, 2011, 10:21:19 PM »
jetzt passt es

und bitte, weiter aufräumen  :wink:

Thanks

und die english Datei auch noch ändern
Danke Harald




Offline lexdiamond

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: [Mod] Personal Greeting, and how many Images since last Visit
« Reply #6 on: November 03, 2011, 06:59:13 PM »
Ich finde den Mod einfach Klasse, ich frage mich nur wie ich das ändern kann das nicht alle Bilder mitgezählt werden.

z.B.: Ein Benutzer loggt sich ein und es wird ihm angezeigt es gibt 30 neue Bilder, zehn davon kann er aber garnicht ansehen weil sie in einem Ordner liegen für die er keine Rechte hat!?

Wie kann ich das ändern, dass ihm nur die Bilderanzahl angezeigt für die er auch die Rechte besitzt?

mfg

Rembrandt

  • Guest
Re: [Mod] Personal Greeting, and how many Images since last Visit
« Reply #7 on: November 03, 2011, 07:27:21 PM »
Hi!

...Wie kann ich das ändern, dass ihm nur die Bilderanzahl angezeigt für die er auch die Rechte besitzt?
....

suche in step 3.):

WHERE image_active 
AND image_date >= ".$user_info['user_lastvisit']."

und ersetze es mit:

WHERE image_active 
AND (cat_id NOT IN (".get_auth_cat_sql("auth_viewimage", "NOTIN")."".get_auth_cat_sql("auth_viewcat", "NOTIN").")) AND image_date >= ".$user_info['user_lastvisit']."


mfg Andi

Offline lexdiamond

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: [Mod] Personal Greeting, and how many Images since last Visit
« Reply #8 on: November 03, 2011, 07:37:19 PM »
Danke für die schnelle Antwort, es scheint zu funktionieren.  :D

mfg Markus

Offline Honse

  • Newbie
  • *
  • Posts: 39
  • Fahre nie schneller, wie Dein Schutzengel fliegt
    • View Profile
    • Pe-Ch's Galerie
Re: [Mod] Personal Greeting, and how many Images since last Visit
« Reply #9 on: February 18, 2012, 07:10:46 PM »
Hallo Rembrandt,
Ich finde dieses Mod auch super.
Danke fürs Posten
Ich weiß, das ich nichts weis  ---- Sogrates ----

Rembrandt

  • Guest
Re: [Mod] Personal Greeting, and how many Images since last Visit
« Reply #10 on: February 18, 2012, 08:11:54 PM »
Hallo Rembrandt,
Ich finde dieses Mod auch super.
Danke fürs Posten
Danke!, sowas hört man gerne :)

mfg Andi

Offline asms

  • Full Member
  • ***
  • Posts: 154
    • View Profile
Re: [Mod] Personal Greeting, and how many Images since last Visit
« Reply #11 on: April 22, 2012, 10:03:38 AM »
thank's , this for Arabic site

//################## Start Personal Greeting  #############
$lang['user_good_morning'] = " ^_^ &#1589;&#1576;&#1575;&#1581; &#1575;&#1604;&#1582;&#1610;&#1585; ";
$lang['user_hello'] = "! &#1610;&#1608;&#1605; &#1605;&#1605;&#1578;&#1586; ";
$lang['user_good_evening'] = "!&#1605;&#1587;&#1575;&#1569; &#1575;&#1604;&#1582;&#1610;&#1585; ";
$lang['last_visit'] = "&#1575;&#1582;&#1585; &#1586;&#1610;&#1575;&#1585;&#1577; &#1603;&#1575;&#1606;&#1578; &#1601;&#1609;:";
$lang['today_is'] = "&#1575;&#1604;&#1610;&#1608;&#1605;: ";
$lang['new_images_since'] = "&#1575;&#1604;&#1580;&#1583;&#1610;&#1583; &#1605;&#1606;&#1584; &#1575;&#1582;&#1585; &#1586;&#1610;&#1575;&#1585;&#1577;:";
$lang['years'] = " &#1587;&#1606;&#1577;";
$lang['months'] = " &#1588;&#1607;&#1585; ";
$lang['days'] = " &#1610;&#1608;&#1605; ";
$lang['hours'] = " &#1587;&#1575;&#1593;&#1577;. ";
$lang['min'] = " &#1583;&#1602;&#1610;&#1602;&#1577; &#1608; ";
$lang['sec'] = " &#1579;&#1575;&#1606;&#1610;&#1577;. <br>";
//################## Start Personal Greeting  #############

enjoy..

Offline Allround

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: [Mod] Personal Greeting, and how many Images since last Visit
« Reply #12 on: April 25, 2012, 08:09:45 AM »
Bei diesen Mod viel mir auf, das der Link bei der Anzahl neuer Bilder bei mir nicht funzt, weil in der Adressleiste ein Datum steht.. gibts dazu auch eine extra Modifikation?

mfg

Rembrandt

  • Guest
Re: [Mod] Personal Greeting, and how many Images since last Visit
« Reply #13 on: April 25, 2012, 08:57:21 AM »
Hi!
Bei diesen Mod viel mir auf, das der Link bei der Anzahl neuer Bilder bei mir nicht funzt, weil in der Adressleiste ein Datum steht.. gibts dazu auch eine extra Modifikation?..
Ich Zitiere mich mal selber aus dem Eingangspost:
Quote
How many Images since last Visit works but without search result, do you want a correct searchresult,
 you must install step 2.) 2.1) and 2.2.) from this mod:
 http://www.4homepages.de/forum/index.php?topic=29119.0
...

mfg Andi

Offline Allround

  • Jr. Member
  • **
  • Posts: 66
    • View Profile
Re: [Mod] Personal Greeting, and how many Images since last Visit
« Reply #14 on: April 25, 2012, 11:18:45 PM »
Mist, das man ein Englisch kann  :oops: