• [Mod] Aktivitäten beim Hinzufügen zum Leuchtkasten anzeigen 5 0 5 1
Currently:  

Author Topic: [Mod] Aktivitäten beim Hinzufügen zum Leuchtkasten anzeigen  (Read 55869 times)

0 Members and 1 Guest are viewing this topic.

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
[Mod] Aktivitäten beim Hinzufügen zum Leuchtkasten anzeigen
« on: August 25, 2010, 01:24:00 PM »
Hallo zusammen,

ich habe mal wieder ein Idee und dazu eine Frage:
kann man eine art box bauen (und diese auf allen seiten einbinden), die anzeigt, welche user gerade welches foto zu ihrer "leuchtbox (lighhtbox)" hinzugefügt haben...

d.h. anzeige der letzten 10 Aktivitäten á la
Quote
user1234 hat Bild123456 hinzugefügt
(wobei user und bild jeweils verlinkt sind)

gibt es so etwas schon oder kann man das irgendwie leicht realisieren?

danke und schöner Gruss,
bergblume

Rembrandt

  • Guest
Re: Aktivitäten beim Hinzufügen zum Leuchtkasten anzeigen
« Reply #1 on: August 25, 2010, 10:43:54 PM »
..
gibt es so etwas schon oder kann man das irgendwie leicht realisieren?..
leicht ist relativ :)


1.) suche in der includes/page_header.php:

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

füge darüber ein:

//###################################### Start Mod Lightbox Activity #################################################
$light_activity="";
if (
$user_info['user_level'] > GUEST ) {
  
$light_activity_num ="10"// number e.g. 1,2,3,10,15,20,50,100... e.t.c
/*          
  $sql = "SELECT substring_index(l.lightbox_image_ids,' ',-1) AS img_id, l.lightbox_lastaction,l.user_id,i.image_id,i.image_name".get_user_table_field(", u.", "user_name")."
          FROM ".LIGHTBOXES_TABLE." l
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = l.user_id)
          LEFT JOIN ".IMAGES_TABLE." i ON (i.image_id = substring_index(l.lightbox_image_ids,' ',-1))
          ORDER BY lightbox_lastaction DESC
          LIMIT $light_activity_num
         "; 
*/
  
$sql "SELECT substring_index(l.lightbox_image_ids,' ',-1) AS img_id, l.lightbox_lastaction,l.user_id,i.image_id,i.image_name".get_user_table_field(", u.""user_name")."
          FROM ("
.LIGHTBOXES_TABLE." l,".IMAGES_TABLE." i)
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = l.user_id)
          WHERE i.image_id = substring_index(l.lightbox_image_ids,' ',-1)
          ORDER BY l.lightbox_lastaction DESC
          LIMIT 
$light_activity_num
         "
;
         
  
$result $site_db->query($sql);
  
$lightbox_cache = array();
  
$c=1;
  while (
$row $site_db->fetch_array($result)){
    if(!empty(
$row['img_id'])){
      
$lightbox_cache[$c] = array(
        
'user_id'             => $row['user_id'],
        
'lightbox_lastaction' => $row['lightbox_lastaction'],
        
'user_name'           => $row['user_name'],
        
'image_id'            => $row['img_id'],
        
'image_name'          => $row['image_name']
      );
      
$c++;
    }
  }
  
$count  =  count($lightbox_cache);  
    
  
$light_activity "<table style=\"width:".$config['image_table_width']."; border-style:none;\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"summary=\"new thumbs\">";
  if(
$count){
    
$bgcounter 0;
    for (
$i 1$i <= $count$i++) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
      
$light_activity .= "<tr>";
      
$light_activity .= "<td class=\"row".$row_bg_number."\">";
      
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/"$lightbox_cache[$i]['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$lightbox_cache[$i]['user_id'];
      
$light_activity .= "<b><a href=\"".$site_sess->url($user_profile_link)."\">".format_text($lightbox_cache[$i]['user_name'])."</a></b>";
      
$light_activity .= $lang['at_least'];
      
$light_activity .= "<b>".format_date($config['date_format']." ".$config['time_format'], $lightbox_cache[$i]['lightbox_lastaction'])."</b>";
      
$light_activity .= $lang['lightbox_updated'];
      
$light_activity .= $lang['last_image'];
      
$light_activity .= "<b><a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$lightbox_cache[$i]['image_id'])."\">".format_text($lightbox_cache[$i]['image_name'], 2)."</a></b>";
      
$light_activity .= "</td>\n";
      
$light_activity .= "</tr>";     
    } 
// end for
  
}
  else{
    
$light_activity .= "<tr><td class=\"row1\">".$lang['no_activity']."</td></tr>";
  }
  
$light_activity .= "</table>\n";
  
  
$site_template->register_vars(array(
    
"lang_lightbox_activity" => $lang['lightbox_activity'],
    
"no_activity" => $lang['no_activity']
  ));
}
  
$site_template->register_vars("light_activity",$light_activity);
//###################################### END Mod Lightbox Activity ##################################################


2.) in der lang/main.php füge das ein:
(deutsch)

$lang
['at_least'] = " hat zuletzt am ";
$lang['lightbox_updated'] = " die Lightbox Aktualisiert,";
$lang['last_image'] = " letztes hinzugefügtes Bild: ";
$lang['lightbox_activity'] = "Lightbox Aktivität";
$lang['no_activity'] = "Keine Lightbox Aktivitäten";

(english)

$lang
['at_least'] = " has at least ";
$lang['lightbox_updated'] = " the Lightbox Updated,";
$lang['last_image'] = " recently added Image: ";
$lang['lightbox_activity'] = "Lightbox Activity";
$lang['no_activity'] = "No Lightbox Activities";


3.) suche in der home.html:
Code: [Select]
{whos_online}
 <br />
füge darunter ein:
Code: [Select]
{if light_activity}
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td class="head1">
                <table width="100%" border="0" cellspacing="0" cellpadding="4">
                  <tr>
                    <td class="head1" valign="top">{lang_lightbox_activity}</td>
                  </tr>
                </table>
              </td>
            </tr>
            <tr>
              <td class="head1">{light_activity}</td>
            </tr>
          </table>
          <br>
          {endif light_activity}

mfg Andi
« Last Edit: July 16, 2011, 05:59:03 AM by Rembrandt »

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: Aktivitäten beim Hinzufügen zum Leuchtkasten anzeigen
« Reply #2 on: August 25, 2010, 11:37:37 PM »
servus andi!!

genial!! works like a charm!!!
du bist super!!! vielen dank ... ne geniale erweiterung, die 4images nun aus meiner sicht fast zu einem optimalen web2.0 werkzeug werden lässt  :D

vielen dank nochmal für deine hilfe!
bergblume

Offline kubiczek

  • Full Member
  • ***
  • Posts: 211
    • View Profile
    • Gross Peterwitz
Re: Aktivitäten beim Hinzufügen zum Leuchtkasten anzeigen
« Reply #3 on: August 26, 2010, 09:19:34 AM »
Hallo,

eine wirklich supper sache, habe mich gewundert das meine User so viel Bilder in den Leuchtkasten stellen.

es sollte sichtbar sein nur für Mitglieder, deshalb habe ich es ein wennig abgeändert.


suche in der includes/page_header.php:
Code: [Select]
  $site_template->register_vars(array(
  "light_activity" => $light_activity,
  "lang_hat_das_Bild" => $lang['hat_das_Bild'],
  "lang_am" => $lang['am'],
  "lang_hinzugefügt" => $lang['hinzugefügt']

ersetze es mit
Code: [Select]
$site_template->register_vars(array(
  "light_activity" => $light_activity,
  "lang_hat_das_Bild" => $lang['hat_das_Bild'],
  "lang_am" => $lang['am'],
  "lang_hinzugefügt" => $lang['hinzugefügt'],

  "lang_no_permission" => $lang['no_permission']


suche in der home.html

Code: [Select]
{whos_online}
  <br />

ersetze es mit
Code: [Select]
{if light_activity}
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td class="head1">Lightbox Activity</td>
            </tr>
            <tr>
              <td class="reg_table"><table width="600" border="0" align="center">
                <tr>
                  <td>{if user_loggedin}
                    {light_activity}
                     {endif user_loggedin}{if user_loggedout}{lang_no_permission}{endif user_loggedout}</td>
                </tr>
              </table></td>
            </tr>
          </table>
          <br>
          {endif light_activity}

Vielen Dank Rembrandt für diese TOOOLLLLE erweiterung


Rembrandt

  • Guest
Re: Aktivitäten beim Hinzufügen zum Leuchtkasten anzeigen
« Reply #4 on: August 26, 2010, 10:15:49 AM »
es sollte sichtbar sein nur für Mitglieder, deshalb habe ich es ein wennig abgeändert.
danke für den hinweis, ich habe den code im ersten post geändert.

mfg Andi

Offline kubiczek

  • Full Member
  • ***
  • Posts: 211
    • View Profile
    • Gross Peterwitz
Re: Aktivitäten beim Hinzufügen zum Leuchtkasten anzeigen
« Reply #5 on: August 26, 2010, 12:14:28 PM »
wenn ich die suchfunktion benutze kommt folgende meldung

Notice: Undefined variable: additional_sql in /www/htdocs/w00aca3c/gp/includes/page_header.php on line 418

http://www.grosspeterwitz.org/gp/search.php?l=deutsch

Code: [Select]
416. $light_activity_num ="10"; // number e.g. 1,2,3,10,15,20,50,100... e.t.c
417.
[color=red]418. $sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_active, i.image_media_file, i.image_thumb_file,l.lightbox_lastaction,l.user_id, u.user_name".$additional_sql."[/color]
419.   FROM (".LIGHTBOXES_TABLE." l,".IMAGES_TABLE." i,".USERS_TABLE." u)
420.    WHERE i.image_active = 1 AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat", "NOTIN").") AND l.user_id = u.user_id AND l.lightbox_image_ids = i.image_id
421.       ORDER BY lightbox_lastaction DESC
422.     LIMIT $light_activity_num";


« Last Edit: August 26, 2010, 12:25:12 PM by kubiczek »

Rembrandt

  • Guest
Re: Aktivitäten beim Hinzufügen zum Leuchtkasten anzeigen
« Reply #6 on: August 26, 2010, 04:58:00 PM »
..
Notice: Undefined variable: additional_sql in /www/htdocs/w00aca3c/gp/includes/page_header.php on line 418...
das:
Code: [Select]
".$additional_sql."kannst du aus dem code löschen.

mfg Andi

Offline kubiczek

  • Full Member
  • ***
  • Posts: 211
    • View Profile
    • Gross Peterwitz
Re: Aktivitäten beim Hinzufügen zum Leuchtkasten anzeigen
« Reply #7 on: August 26, 2010, 08:36:14 PM »
..
Notice: Undefined variable: additional_sql in /www/htdocs/w00aca3c/gp/includes/page_header.php on line 418...
das:
Code: [Select]
".$additional_sql."kannst du aus dem code löschen.

mfg Andi


Hat geklappt,  hoffe nur das es nicht für was anderes gebraucht wird.

besten dank

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Re: [Mod] Aktivitäten beim Hinzufügen zum Leuchtkasten anzeigen
« Reply #8 on: October 28, 2010, 02:33:30 AM »
Hi,

der Code:

Code: [Select]
{if light_activity}
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td class="head1">Lightbox Activity</td>
            </tr>
            <tr>
              <td class="reg_table"><table width="600" border="0" align="center">
                <tr>
                  <td>{if user_loggedin}
                    {light_activity}
                     {endif user_loggedin}{if user_loggedout}{lang_no_permission}{endif user_loggedout}</td>
                </tr>
              </table></td>
            </tr>
          </table>
          <br>
          {endif light_activity}

produziert bei mir im nicht eingeloggten Zustand einen <br> obwohl ja sowieso
nicht sichtbar sein soll schiebt mir aber einen unnötigen Umbruch unter.
Nehme ich das ganze raus ist dieser weg.

Kann ich das verhindern?


Gruß Jens

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Aktivitäten beim Hinzufügen zum Leuchtkasten anzeigen
« Reply #9 on: October 28, 2010, 02:44:38 PM »
es sollte sichtbar sein nur für Mitglieder, deshalb habe ich es ein wennig abgeändert.
danke für den hinweis, ich habe den code im ersten post geändert.

mfg Andi
In order for {if light_activity}{endif light_activity} to work that tag must be registered (available) no matter if user logged in or not. In your code that tag is only available when user is logged in.


//###################################### Start Mod Lightbox Activity #################################################
$light_activity ="";
if (
$user_info['user_level'] > GUEST ) {
  
$light_activity_num ="10"// number e.g. 1,2,3,10,15,20,50,100... e.t.c
  
  
$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_active, i.image_media_file, i.image_thumb_file,l.lightbox_lastaction,l.user_id, u.user_name
          FROM ("
.LIGHTBOXES_TABLE." l,".IMAGES_TABLE." i,".USERS_TABLE." u)
          WHERE i.image_active = 1 AND i.cat_id NOT IN ("
.get_auth_cat_sql("auth_viewcat""NOTIN").") AND l.user_id = u.user_id AND l.lightbox_image_ids = i.image_id
          ORDER BY lightbox_lastaction DESC
          LIMIT 
$light_activity_num";
  
$result $site_db->query($sql);

  
$light_activity "<table style=\"width:".$config['image_table_width']."; border-style:none;\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"summary=\"new thumbs\">";
 
  
$count 0;
  
$bgcounter 0;
  while (
$image_row2 $site_db->fetch_array($result)){
    
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
    
$light_activity .= "<tr>";
    
$light_activity .= "<td class=\"row".$row_bg_number."\">";
  
   
    
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/"$image_row2['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$image_row2['user_id'];
    
$light_activity .= "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($image_row2[$user_table_fields['user_name']])."</a>";
    
    
$light_activity .=  $lang['hat_das_Bild'];
    
$light_activity .= (check_permission("auth_viewimage"$image_row2['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_row2['image_id'])."\">".format_text($image_row2['image_name'], 2)."</a>" format_text($image_row2['image_name'], 2);
    
$light_activity .= $lang['am'];
    
$light_activity .= format_date($config['date_format']." ".$config['time_format'], $image_row2['lightbox_lastaction'])." "$lang['hinzugefugt'];
    
$light_activity .= "</td>\n"
  
  } 
// end while
  
$light_activity .= "</table>\n";

}
$site_template->register_vars(array(
  
"light_activity" => $light_activity,
  
"lang_hat_das_Bild" => $lang['hat_das_Bild'],
  
"lang_am" => $lang['am'],
  
"lang_hinzugefugt" => $lang['hinzugefugt'],
  
"lang_lightbox_activity" => $lang['lightbox_activity']
));
unset(
$light_activity);

//###################################### END Mod Lightbox Activity ##################################################
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Re: [Mod] Aktivitäten beim Hinzufügen zum Leuchtkasten anzeigen
« Reply #10 on: October 29, 2010, 12:53:28 AM »
Hi,

@Rembrandt hast du oben irgendwas aktualisiert?
Ich sehe das zwar an dem Datum / Zeit Stempel aber ich lese nix
von einer Änderung.


Gruß Jens

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--

Rembrandt

  • Guest
Re: [Mod] Aktivitäten beim Hinzufügen zum Leuchtkasten anzeigen
« Reply #11 on: October 29, 2010, 05:24:46 AM »
..
@Rembrandt hast du oben irgendwas aktualisiert?...
ja den php code

Offline InAction

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: [Mod] Aktivitäten beim Hinzufügen zum Leuchtkasten anzeigen
« Reply #12 on: November 05, 2010, 08:18:33 PM »
bekomme folgende Fehlermeldung:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /www/htdocs/w00cd503/4images/includes/page_header.php on line 400

Hier der Auszug:

<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: page_header.php                                      *
 *        Copyright: (C) 2002-2009 Jan Sorgalla                           *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.7                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
if (!defined('ROOT_PATH')) {
  die(
"Security violation");
}

// Cache Templates
/*$template_list = 'header,footer,category_dropdown_form,user_logininfo,user_loginform';
if (isset($templates_used) && $templates_used != "") {
  $template_list = $template_list.",".$templates_used;
}
$site_template->cache_templates($template_list);*/

//-----------------------------------------------------
//--- Register Global Vars ----------------------------
//-----------------------------------------------------
$total_images 0;
$total_categories 0;
$auth_cat_sql['auth_viewcat']['IN'] = 0;
$auth_cat_sql['auth_viewcat']['NOTIN'] = 0;

$cache_id create_cache_id(
  
'data.auth_and_info',
  array(
$user_info[$user_table_fields['user_id']])
);

if (!
$data get_cache_file($cache_idnull)) {
  if (!empty(
$cat_cache)) {
    foreach (
$cat_cache as $key => $val) {
      if (
check_permission("auth_viewcat"$key)) {
        
$total_categories++;
        if (isset(
$val['num_images'])) {
          
$total_images += $val['num_images'];
        }
        else {
          
$cat_cache[$key]['num_images'] = 0;
        }
        
$auth_cat_sql['auth_viewcat']['IN'] .= ", ".$key;
      }
      else {
        
$auth_cat_sql['auth_viewcat']['NOTIN'] .= ", ".$key;
      }
    }
  }

  
$data = array();

  
$data['total_images'] = $total_images;
  
$data['total_categories'] = $total_categories;
  
$data['auth_viewcat']['IN'] = $auth_cat_sql['auth_viewcat']['IN'];
  
$data['auth_viewcat']['NOTIN'] = $auth_cat_sql['auth_viewcat']['NOTIN'];

  
save_cache_file($cache_idserialize($data));

} else {
  
$data unserialize($data);

  
$total_images $data['total_images'];
  
$total_categories $data['total_categories'];
  
$auth_cat_sql['auth_viewcat']['IN'] = $data['auth_viewcat']['IN'];
  
$auth_cat_sql['auth_viewcat']['NOTIN'] = $data['auth_viewcat']['NOTIN'];
}

$file get_included_files();
$file get_file_name(basename($file[0]));
$list = array("categories""details""index""member""postcards""register""search""top");
$array = array();
foreach (
$list as $name)
{
  
$array[$name] = ($name == $file);
}
$site_template->register_vars($array);

$site_template->register_vars(array(
  
"home_url"  => ROOT_PATH,
  
"media_url" => MEDIA_PATH,
  
"thumb_url" => THUMB_PATH,
  
"icon_url" => ICON_PATH,
  
"template_url" => TEMPLATE_PATH,
  
"template_image_url" => TEMPLATE_PATH."/images",
  
"template_lang_image_url" => TEMPLATE_PATH."/images_".$config['language_dir'],
  
"site_name" => $config['site_name'],
  
"site_email" => $config['site_email'],
  
"user_loggedin" => ($user_info['user_level'] == GUEST || $user_info['user_level'] == USER_AWAITING) ? 1,
  
"user_loggedout" => ($user_info['user_level'] == GUEST || $user_info['user_level'] == USER_AWAITING) ? 0,
  
"is_admin" => ($user_info['user_level'] == ADMIN) ? 0,
  
"self" => $site_sess->url($self_url),
  
"self_full" => $site_sess->url($script_url."/".$self_url),
  
"script_version" => SCRIPT_VERSION,
  
"cp_link" => ($user_info['user_level'] != ADMIN) ? "" "\n<p align=\"center\">[<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php")."\">Admin Control Panel</a>]</p>\n",
  
"total_categories" => $total_categories,
  
"total_images" => $total_images,
  
"url_new_images" => $site_sess->url(ROOT_PATH."search.php?search_new_images=1"),
  
"url_top_images" => $site_sess->url(ROOT_PATH."top.php"),
  
"url_top_cat_images" => $site_sess->url(ROOT_PATH."top.php".(($cat_id && preg_match("/categories.php/"$self_url)) ? "?".URL_CAT_ID."=".$cat_id "")),
  
"url_register" => (!empty($url_register)) ? $site_sess->url($url_register) : $site_sess->url(ROOT_PATH."register.php"),
  
"url_search" => $site_sess->url(ROOT_PATH."search.php"),
  
"url_lightbox" => $site_sess->url(ROOT_PATH."lightbox.php"),
  
"url_control_panel" => (!empty($url_control_panel)) ? $site_sess->url($url_control_panel) : $site_sess->url(ROOT_PATH."member.php?action=editprofile"),
  
"url_categories" => $site_sess->url(ROOT_PATH."categories.php"),
  
"url_home" => $site_sess->url(ROOT_PATH."index.php"),
  
"url_login" => (!empty($url_login)) ? $site_sess->url($url_login) : $site_sess->url(ROOT_PATH."login.php"),
  
"url_logout" => (!empty($url_logout)) ? $site_sess->url($url_logout) : $site_sess->url(ROOT_PATH."logout.php"),
  
"url_member" => (!empty($url_member)) ? $site_sess->url($url_member) : $site_sess->url(ROOT_PATH."member.php"),
  
"url_upload" => (!empty($url_upload)) ? $site_sess->url($url_upload) : $site_sess->url(ROOT_PATH."member.php?action=uploadform"),
  
"url_lost_password" => (!empty($url_lost_password)) ? $site_sess->url($url_lost_password) : $site_sess->url(ROOT_PATH."member.php?action=lostpassword"),
  
"url_captcha_image" => $site_sess->url(ROOT_PATH."captcha.php"),
  
"thumbnails" => "",
  
"paging" => "",
  
"paging_stats" => "",
  
"has_rss" => false,
  
"rss_title" => "",
  
"rss_url" => "",
  
"copyright" => '
<p id="copyright" align="center">
  Powered by <b>4images</b> '
.SCRIPT_VERSION.'
  <br />
  Copyright &copy; 2002-'
.date('Y').' <a href="http://www.4homepages.de" target="_blank">4homepages.de</a>
</p>
'
,
));

if (!empty(
$additional_urls)) {
  
$register_array = array();
  foreach (
$additional_urls as $key => $val) {
    
$register_array[$key] = $site_sess->url($val);
  }
  
$site_template->register_vars($register_array);
}

// Replace Globals in $lang
$lang $site_template->parse_array($lang);

$site_template->register_vars(array(
  
"lang_site_stats" => $lang['site_stats'],
  
"lang_registered_user" => $lang['registered_user'],
  
"lang_random_image" => $lang['random_image'],
  
"lang_categories" => $lang['categories'],
  
"lang_sub_categories" => $lang['sub_categories'],
  
"lang_new_images" => $lang['new_images'],
  
"lang_top_images" => $lang['top_images'],
  
"lang_search" => $lang['search'],
  
"lang_advanced_search" => $lang['advanced_search'],
  
"lang_lightbox" => $lang['lightbox'],
  
"lang_register" => $lang['register'],
  
"lang_control_panel" => $lang['control_panel'],
  
"lang_login" => $lang['login'],
  
"lang_auto_login" => $lang['lang_auto_login'],
  
"lang_logout" => $lang['logout'],
  
"lang_lost_password" => $lang['lost_password'],
  
"lang_user_name" => $lang['user_name'],
  
"lang_password" => $lang['password'],
  
"lang_go" => $lang['go'],
  
"lang_images_per_page" => $lang['images_per_page'],
  
"charset" => $lang['charset'],
  
"direction" => $lang['direction']
));

//-----------------------------------------------------
//--- Category Dropdown -------------------------------
//-----------------------------------------------------

if (!$cache_enable) {
    
$category_dropdown_selfjump get_category_dropdown($cat_id1);
} else {
  
$cache_id create_cache_id(
    
'data.dropdown_selfjump',
    array(
      
$user_info[$user_table_fields['user_id']],
      
$config['template_dir'],
      
$config['language_dir']
    )
  );

  if (!
$category_dropdown_selfjump get_cache_file($cache_id)) {
    
// Always append session id if cache is enabled
    
$old_session_mode $site_sess->mode;
    
$site_sess->mode 'get';

    
// Set $cat_id to 0 to ensure that no category is selected
    
$category_dropdown_selfjump get_category_dropdown(01);

    
$site_sess->mode $old_session_mode;

    
save_cache_file($cache_id$category_dropdown_selfjump);
  }
}

$site_template->register_vars("category_dropdown_selfjump"$category_dropdown_selfjump);
unset(
$category_dropdown_selfjump);

// -------------------------------------
if (!$cache_enable) {
    
$category_dropdown_form $site_template->parse_template("category_dropdown_form");
} else {
  
$cache_id create_cache_id(
    
'data.dropdown_form',
    array(
      
$user_info[$user_table_fields['user_id']],
      
// $cat_id, // uncomment if the current category should be selected, will increase the number of cache files
      
$config['template_dir'],
      
$config['language_dir']
    )
  );

  if (!
$category_dropdown_form get_cache_file($cache_id)) {
    
// Always append session id if cache is enabled
    
$old_session_mode $site_sess->mode;
    
$site_sess->mode 'get';

    
$category_dropdown_form $site_template->parse_template("category_dropdown_form");

    
$site_sess->mode $old_session_mode;

    
save_cache_file($cache_id$category_dropdown_form);
  }
}

$site_template->register_vars("category_dropdown_form"$category_dropdown_form);
unset(
$category_dropdown_form);

//-----------------------------------------------------
//--- Random Image ------------------------------------
//-----------------------------------------------------
$random_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" get_random_image();
$site_template->register_vars("random_image"$random_image);
unset(
$random_image);

//-----------------------------------------------------
//--- Set Paging Vars ---------------------------------
//-----------------------------------------------------
if (isset($HTTP_POST_VARS['setperpage'])) {
  
$setperpage intval($HTTP_POST_VARS['setperpage']);
  if (
$setperpage) {
    
$site_sess->set_session_var("perpage"$setperpage);
    
$session_info['perpage'] = $setperpage;
  }
}

if (isset(
$session_info['perpage'])) {
  
$perpage $session_info['perpage'];
}
else {
  
$perpage ceil($config['default_image_rows'] * $config['image_cells']);
}

//-----------------------------------------------------
//--- Set Perpage Dropdown ----------------------------
//-----------------------------------------------------
$setperpage_dropdown "\n<select onchange=\"if (this.options[this.selectedIndex].value != 0 && typeof forms['perpagebox'] != 'undefined'){ forms['perpagebox'].submit() }\" name=\"setperpage\" class=\"setperpageselect\">\n";
for(
$i 1$i <= $config['custom_row_steps']; $i++) {
  
$setvalue $config['image_cells'] * $i;
  
$setperpage_dropdown .= "<option value=\"".$setvalue."\"";
    if (
$setvalue == $perpage) {
    
$setperpage_dropdown .= " selected=\"selected\"";
  }
  
$setperpage_dropdown .= ">";
  
$setperpage_dropdown .= $setvalue;
  
$setperpage_dropdown .= "</option>\n";
}
$setperpage_dropdown .= "</select>\n";
if (
$cat_id != 0) {
  
$setperpage_dropdown .= "<input type=\"hidden\" name=\"cat_id\" value=\"".$cat_id."\" />\n";
}
if (isset(
$show_result) && $show_result == 1) {
  
$setperpage_dropdown .= "<input type=\"hidden\" name=\"show_result\" value=\"1\" />\n";
}
$site_template->register_vars("setperpage_dropdown"$setperpage_dropdown);
$setperpage_dropdown_form $site_template->parse_template("setperpage_dropdown_form");
$site_template->register_vars("setperpage_dropdown_form"$setperpage_dropdown_form);

$site_template->un_register_vars("setperpage_dropdown");
unset(
$setperpage_dropdown);
unset(
$setperpage_dropdown_form);

//-----------------------------------------------------
//--- Add & Delete from Lists -------------------------
//-----------------------------------------------------
if ($action == "addtolightbox" && $id) {
  if (
$user_info['user_level'] >= USER) {
    
$msg = (add_to_lightbox($id)) ? $lang['lightbox_add_success'] : $lang['lightbox_add_error'];
  }
  else {
    
$msg $lang['lightbox_register'];
  }
}
if (
$action == "removefromlightbox" && $id) {
  if (
$user_info['user_level'] >= USER) {
    
$msg = (remove_from_lightbox($id)) ? $lang['lightbox_remove_success'] : $lang['lightbox_remove_error'];
  }
  else {
    
$msg $lang['lightbox_register'];
  }
}
if (
$action == "clearlightbox") {
  if (
$user_info['user_level'] >= USER) {
    
$msg = (clear_lightbox()) ? $lang['lightbox_delete_success'] : $lang['lightbox_delete_error'];
  }
  else {
    
$msg $lang['lightbox_register'];
  }
}

//-----------------------------------------------------
//--- Save Rating -------------------------------------
//-----------------------------------------------------
if ($action == "rateimage" && $id) {
  
$rating intval($HTTP_POST_VARS['rating']);
  
$cookie_name = (defined("COOKIE_NAME")) ? COOKIE_NAME "4images_";
  
$cookie_rated = isset($HTTP_COOKIE_VARS[$cookie_name.'rated']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookie_name.'rated'])) : array();
  if (
$rating && $rating <= MAX_RATING && $id) {
    if (!isset(
$session_info['rated_imgs'])) {
      
$session_info['rated_imgs'] = $site_sess->get_session_var("rated_imgs");
    }
    
$split_list = array();
    if (!empty(
$session_info['rated_imgs'])) {
      
$split_list explode(" "$session_info['rated_imgs']);
    }
    if (!
in_array($id$split_list) && !in_array($id$cookie_rated)) {
      
$session_info['rated_imgs'] .= " ".$id;
      
$session_info['rated_imgs'] = trim($session_info['rated_imgs']);
      
$site_sess->set_session_var("rated_imgs"$session_info['rated_imgs']);
      
$cookie_rated[] = $id;
      
$cookie_expire time() + 60 60 24 4;
      
setcookie($cookie_name.'rated'serialize($cookie_rated), $cookie_expireCOOKIE_PATHCOOKIE_DOMAINCOOKIE_SECURE);
      
update_image_rating($id$rating);
      
$msg $lang['voting_success'];
    }
    else {
      
$msg $lang['already_voted'];
    }
  }
  else {
    
$msg $lang['voting_error'];
  }
}
//###################################### Start Mod Lightbox Activity #################################################
$light_activity ="";
if (
$user_info['user_level'] > GUEST ) {
  
$light_activity_num ="10"// number e.g. 1,2,3,10,15,20,50,100... e.t.c
  
  
$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_active, i.image_media_file, i.image_thumb_file,l.lightbox_lastaction,l.user_id, u.user_name
          FROM ("
.LIGHTBOXES_TABLE." l,".IMAGES_TABLE." i,".USERS_TABLE." u)
          WHERE i.image_active = 1 AND i.cat_id NOT IN ("
.get_auth_cat_sql("auth_viewcat""NOTIN").") AND l.user_id = u.user_id AND l.lightbox_image_ids = i.image_id
          ORDER BY lightbox_lastaction DESC
          LIMIT 
$light_activity_num";
  
$result $site_db->query($sql);

  
$light_activity "<table style=\"width:".$config['image_table_width']."; border-style:none;\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"summary=\"new thumbs\">";
 
  
$count 0;
  
$bgcounter 0;
  while (
$image_row2 $site_db->fetch_array($result)){
    
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
    
$light_activity .= "<tr>";
    
$light_activity .= "<td class=\"row".$row_bg_number."\">";
  
   
    
$user_profile_link = (!empty($url_show_profile)) ? preg_replace("/{user_id}/"$image_row2['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$image_row2['user_id'];
    
$light_activity .= "<a href=\"".$site_sess->url($user_profile_link)."\">".format_text($image_row2[$user_table_fields['user_name']])."</a>";
    
    
$light_activity .=  $lang['hat_das_Bild'];
    
$light_activity .= (check_permission("auth_viewimage"$image_row2['cat_id'])) ? "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_row2['image_id'])."\">".format_text($image_row2['image_name'], 2)."</a>" format_text($image_row2['image_name'], 2);
    
$light_activity .= $lang['am'];
    
$light_activity .= format_date($config['date_format']." ".$config['time_format'], $image_row2['lightbox_lastaction'])." "$lang['hinzugefugt'];
    
$light_activity .= "</td>\n"
  
  } 
// end while
  
$light_activity .= "</table>\n";

}
$site_template->register_vars(array(
  
"light_activity" => $light_activity,
  
"lang_hat_das_Bild" => $lang['hat_das_Bild'],
  
"lang_am" => $lang['am'],
  
"lang_hinzugefügt" => $lang['hinzugefügt'],
  
"lang_no_permission" => $lang['no_permission']
  
"lang_lightbox_activity" => $lang['lightbox_activity']
));
unset(
$light_activity);

//###################################### END Mod Lightbox Activity ##################################################

//-----------------------------------------------------
//--- User Box ----------------------------------------
//-----------------------------------------------------
if ($user_info['user_level'] >= USER) {
  
$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']));
  
$user_box $site_template->parse_template("user_logininfo");
  
$site_template->register_vars(array(
    
"user_box" => $user_box,
    
"user_loggedin" => 1,
    
"user_loggedout" => 0,
    
"is_admin" => ($user_info['user_level'] == ADMIN) ? 0
  
));
  
$site_template->un_register_vars("user_logininfo");
  unset(
$user_box);
}
else {
  
$user_box $site_template->parse_template("user_loginform");
  
$site_template->register_vars(array(
    
"user_box" => $user_box,
    
"user_loggedin" => 0,
    
"user_loggedout" => 1,
    
"is_admin" => 0
  
));
  
$site_template->un_register_vars("user_loginform");
  unset(
$user_box);
}

?>


folgende frage habe ich noch:

n der lang/main.php füge das ein:
$lang['hat_das_Bild'] = " hat das Bild ";
$lang['hinzugefügt'] = " hinzugefügt.";
$lang['am'] = " am ";
$lang['lightbox_activity'] = "Lightbox Aktivität"; unter welchen Abschnitt???


suche in der home.html:

« Last Edit: November 05, 2010, 08:36:36 PM by Rembrandt »

Rembrandt

  • Guest
Re: [Mod] Aktivitäten beim Hinzufügen zum Leuchtkasten anzeigen
« Reply #13 on: November 05, 2010, 08:42:28 PM »
wenn du das nächste mal einen php code im forum einstellst verwende bitte die dafür vorgesehenen "bbcodes" (steht PHP darauf).

bekomme folgende Fehlermeldung:.......
in der zeile 399 hast du den beistrich gelöscht, brauchst du nur mit meinen code vergleichen.

Quote
.....folgende frage habe ich noch:
...
wenn du dir die main.php ansiehst wirst du festellen das es vollkommen egal ist in welcher zeile du die neuen hineinschreibst.

mfg Andi


Offline InAction

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: [Mod] Aktivitäten beim Hinzufügen zum Leuchtkasten anzeigen
« Reply #14 on: November 05, 2010, 10:19:05 PM »
super danke, allerdings ist das Logo auf der Startseite weg, meine Navigation die ich selber hinzugefügt habe...das ist blöd