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 - x23piracy

Pages: 1 [2] 3 4
16
Chit Chat / Jquery Paketunterschiede?
« on: December 01, 2010, 12:50:10 AM »
Hi,

von jquery gibt es ja bekanntlich 2 Versionen, die standard und die minimal version.
Gibts es eine sichere Methode festzustellen ob mir die minimal Version reicht?

Aktuell lade ich in der header das standard jquery und da die min version um einiges
kleiner ist würde ich das gerne tauschen allerdings erst wenn ich über die
Unterschiede bescheid weiß.

EDIT:

Ich habe das hier gefunden:

Code: [Select]
The minified versions, while having a larger file size than the packed versions (note: packed version is not available in current release),
are generally the best versions to use on production deployments. The packed versions require non-trivial client-side processing time to
uncompress (unpack) the code whereas the minified versions do not. The packed versions of jQuery will take less time to download than
the minified or uncompressed versions; however, each time the library is loaded (initially or from the browser cache) it will need to be
uncompressed which will cause a non-trivial delay in the execution of any jQuery code each time it is loaded.

Wenn ich das richtig verstehe gibt es garkeinen Inhaltlichen Unterschied sondern lediglich die kompression,
allerdings verstehe ich den text oben so das bei benutzung der minified version bei jedem Aufruf der
Seite der jquery code extrahiert werden muss. Korrekt?

Aktuell liegt der Unterschied zwischen den beiden Versionen bei 102kb, ist stell mir jetzt die Frage ob das laden der 102kb nicht schneller
ist als die Zeit die ins Land streicht wenn die komprimierte Version erstmal entpackt wird.

Ich rede hier wahrscheinlich von Zeiten unterhalb einer Sekunde aber interessieren würde es mich schon.


Gruß Jens

17
Hi,

i found this usefull script for scrolling pages up completely by clicking to an image
that appears after scrolling the page down.

Demo: http://www.dynamicdrive.com/dynamicindex3/scrolltop.htm
Youtube / Video: http://www.youtube.com/watch?v=zGwa-Y-vL4U
(I made the video with missing show cursor setting, so if the page scrolls up i clicked on the image in the bottom right corner)


Here we go:

Add this to header.html between the <head></head> tag:
Code: [Select]
<script type="text/javascript" src="./js/scrolltopcontrol.js"></script>
Place the following attached files into your /root/js/ folder:

- scrolltopcontrol.js
- up.png

That's it


Troubleshooting:

If you are using a non standard template that is based on div's like me, it can happen that
you see the image for scrolling up the page but you cannot click it.

In this case add this to your style.css:
Code: [Select]
#topcontrol {
z-index: 999;
}

(If you have higher values then 999 increase it to the highest value you are using.)


Tweaking:

in scrolltopcontrol.js you can change:

Code: [Select]
//startline: Integer. Number of pixels from top of doc scrollbar is scrolled before showing control
//scrollto: Keyword (Integer, or "Scroll_to_Element_ID"). How far to scroll document up when control is clicked on (0=top).
setting: {startline:100, scrollto: 0, scrollduration:1000, fadeduration:[500, 100]},
controlHTML: '<img src="./js/up.png" style="width:48px; height:48px; z-index:1000" />', //HTML for control, which is auto wrapped in DIV w/ ID="topcontrol"
controlattrs: {offsetx:10, offsety:80}, //offset of control relative to right/ bottom of window corner
anchorkeyword: '#top', //Enter href value of HTML anchors on the page that should also act as "Scroll Up" links

a simple Link to scroll back to top can be set by:
Code: [Select]
<a href="#top">Back to Top</a>

Greetz X23

18
Hi,

furchtbares Durcheinander, wieso wird nicht mal ein bisschen aufgeräumt.
Es muss ja kein beschneiden alter Beiträge sein aber vielleicht was übersichtliches
in einem neuen Beitrag.


Gruß Jens

19
Hi,

i was a bit surprised what a bunch off changes have to be done for one of the existing mods like:
[MOD] Dynamic Page Title for v1.7 & v1.7.1

I have done the following changes to my 1.7.9

Actually there is a problem with the latest 4images release 1.7.9 with tags like
( {if categories}...{endif categories} )

The Tags i needed don't work with the out of the box release, to fix it go here:
[1.7.7 - 1.7.9] {categories},{details},{index},{lightbox},etc tags don't work


Here we go:


in header.html search for:
Code: [Select]
<title>{site_name}</title>
change it for example to:
Code: [Select]
<title>{site_name} {if page_categories}/ {cat_name}{endif page_categories} {if page_details}/ {cat_name} / {image_name}{endif page_details}</title>

You can change everything between <title></title> to your needs.


Greetz X23

20
Hi,

here is a font size changer that changes font size for all elements procentual, it also saves
the state of choosen fontsize into a cookie.

You can setup the default size and the procentual adjustment steps for in or decreasing.


Here we go:

Place in your header.html between <head></head> tag:

Code: [Select]
<script type="text/javascript" src="./js/font_cookie.js"></script>
<script type="text/javascript" src="./js/font_size.js"></script>

Place early in your header.html after the <body> tag:

Code: [Select]
<script type="text/javascript">if (efa_fontSize) efa_fontSize.efaInit();</script>
Place this in any template where you want to show the font size changer buttons:

Code: [Select]
<div class="selectFontSize"><script type="text/javascript">if (efa_fontSize) document.write(efa_fontSize.allLinks);</script></div>
Place the attached files (see post attachment) into your root/js/ directory:

- root/js/font_size.js
- root/jsfont_cookie.js
- root/js/font_zoomin_32.png
- root/js/font_normal_32.png
- root/jsfont_zoomout_32.png


Your done  :mrgreen:


Settings:

in font_size.js:

Code: [Select]
var efa_default = 70; //default text size as percentage of user default
var efa_increment = 10; //percentage to increase/decrease font size

You can play around with this two settings.

In the attachment there is also a font_size.html file, this only for local testing and is not
needed for uploading.

Here is a little teaser screenshot snip, don't wonder i just placed it for testing into my
mac like dock bar:




Greetz X23

21
Hi,

this is a simple mod that lets you toggle between the next and previous images on details page.
(Nothing visible just a bit of javascript)

Browser compatibility: tested... (FF, IE, Safari, Opera, Chrome)


First of all is the base script, add this into your details.html template file:
(maybe on top after the {header})

[New Code (thanks to Lucifix) now the keypress doesn't have any effect if you are in input fields]
jquery is required!


Code: [Select]
<script type="text/javascript">

$(document).ready(function(){

function checkKey(e){
if (e.target.tagName.match(/input|textarea/i)) return;

switch (e.keyCode) {
case 37:
var MyId = document.getElementById('next_image_url');
if ( MyId != null) {
document.location.href = document.getElementById('next_image_url').href;
}
break;
case 39:
var MyId = document.getElementById('prev_image_url');
if ( MyId != null) {
document.location.href = document.getElementById('prev_image_url').href;
}
break;
default:
}      
}

if ($.browser.mozilla) {
$(document).keypress (checkKey);
} else {
$(document).keydown (checkKey);
}

});

</script>


[This is the old code, that also changes the picture even if you are in an input field, like writing an comment or something]
only use this if you are not using the script above, you have to decide what to use...


Code: [Select]
<script type="text/javascript">

function onk(ev) {
  if (!ev) ev = window.event;
  if (ev.which) { tcode = ev.which; }
  else if (ev.keyCode) { tcode = ev.keyCode; }

  if(tcode == 37 ) {
 var MyId = document.getElementById('prev_image_url');
  if ( MyId != null) {
  document.location.href = document.getElementById('prev_image_url').href;
  }
  }

  if(tcode == 39 ) {
 var MyId = document.getElementById('next_image_url');
  if ( MyId != null) {
  document.location.href = document.getElementById('next_image_url').href;
  }
  }
}

document.onkeydown = onk;

</script>

To get image url caching work you need to set an identifier (id):

search for:

Code: [Select]
<a href="{next_image_url}">{next_image_name}</a>
and

Code: [Select]
<a href="{prev_image_url}">{prev_image_name}</a>
add to each matching identifiers like:

Code: [Select]
<a href="{next_image_url}" id="next_image_url">{next_image_name}</a>
and

Code: [Select]
{prev_image_url}" id="prev_image_url">{prev_image_name}</a>

That's it i believe... it works for me  :mrgreen:

From now you can use left and right arrow for changing the picture.

If you want other key for trigger previous and next image check this site for example:
http://www.aspdotnetfaq.com/Faq/What-is-the-list-of-KeyCodes-for-JavaScript-KeyDown-KeyPress-and-KeyUp-events.aspx

It's also possible to trigger other stuff by keypresses like entering lightbox, starting a slideshow, deleting a photo etc...
Any idea's suggestions or any unrelated bulls*it let me hear it.


Greetz X23

22
Hi,

based on the existing MOD: [MOD] Scale Images to fit in browser/ Bilder dem Browser anpassen
i added heigth support to the scaling because it was important for my site to keep scrollbars away.

This only works with javascript enabled browser!

This is my code in template/media/jpg.html:

Code: [Select]
<script language="javascript">
var savewidth = 0;

function scaleImg(what){
what = document.getElementById(what);
 if (navigator.appName=="Netscape")
  winW = window.innerwidth;
 if (navigator.appName.indexOf("Microsoft")!=-1)
  winW = document.body.offsetwidth;
 if (what.width>(720) || savewidth>(720)) {
  if (what.width==(720))
   what.width=savewidth;

else
 {
 savewidth = what.width;
 what.style.cursor = "pointer";
 what.width=(720);
 }

}
}
</script>

<table border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>
        <table border="0" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
            <tr>
                <td align="center" valign="middle">

<script language="JavaScript">
var graphicHeight = window.innerHeight*0.7;
document.write("<img id='picture' alt='Highslide JS'  {limit_var}='{new_limit}' usemap='#navi' onClick='scaleImg('picture')' onLoad='scaleImg('picture')' src='{media_src}' height="+graphicHeight+">");
</script>

</td>
            </tr>
        </table>
    </td>
  </tr>
</table>



Adjusting the Image height:

Edit the following line: var graphicHeight = window.innerHeight*0.7;
(where 0.7 is the percentage from inner height of the browser window.)


Note:

This script can be much more simple in future i'll change it and remove the based on MOD code.
There must be also a solution for none enabled javascript browser, maybe just displaying the pic in original size.
The best solution should be some php stuff.

If you have suggestions post them here.


How it looks like:

1280x800

1024x768

800x600



Greetz X23

23
Hi,

i need a working {if lightbox} {endif lightbox} tag i was wondering
{if details} {endif details} is working but lightbox tag not.

Howto make this work?

I have a control panel in header where all the buttons relies but i have to hide
them if iam not on the right page

For example:
Code: [Select]
{if details}
{lightbox_button}
{postcard_button}
<br>
<a href="#" onclick="toggle_onoff('details_comments')"><img title="Kommentare anzeigen" border="0" src="{template_url}/images/comments.png"></a>
{endif details}
{if user_loggedin}
<a href="#" onclick="toggle_offon('menu')"><img title="Menüs ausblenden" border="0" src="{template_url}/images/controls.png"></a>
<a href="#" onclick="toggle_onoff('mp3player')"><img title="MP3 Player" border="0" src="{template_url}/images/player.png"></a>
{endif user_loggedin}
{upload_button}
{if has_rss}<a href="{rss_url}"><img src="{template_url}/images/rss.png" title="{rss_title}" border="0" alt="{rss_title}" /></a>
{endif has_rss}
{if details}
{download_button}
<br>
{download_zip_button}
<a href="#info" rel="facebox"><img title="Kommentieren" border="0" src="{template_url}/images/comment.png"></a>
<br>
{endif details}
{if admin_links}
{admin_links}
{endif admin_links}

For the future how to find out which tags allready available? i hate trying.


Greetz X23

24
Hi,

da Andi meinen Ursprungthread (Link) geschlossen hat und ich
auf den 1.7.9 Problem Thread (Link) verwiesen wurde in dem ich mit meinem Problem
aber scheinbar falsch oder nicht willkommen bin hier mein eigener:

Ich habe aktuell das Problem das ich in einer neu installieren 1.7.9 keine Subkategorien erstellen,
bzw. als solche einstellen kann.

Versuche ich eine neue Kategorie als Subkategorie zu erstellen wird daraus eine Hauptkategorie,
versuche ich diese nochmals zu ändern sagt das ACP brav gespeichert aber es bleibt bei der
Hauptkategorie...

Als mir das aufgefallen ist hatte ich bereits einige Kategorien erstellt, ich editiere also im ACP
eine existierende und Stelle ein das diese nun eine Unterkategorie von XY sein soll, sende das
Formular und sehe das die Kategorie noch immer eine Hauptkategorie ist.

Das gleiche mit einer neu angelegten Kategorie sie wird trotz Unterkategorie Einstellung eine
Hauptkategorie... hmm sehr komisch

Hmm hat jemand eine Idee was das sein kann? Ich möchte das unbedingt lösen


Gruß Jens

25
Hi,

wenn ich meine Lightbox leere sehe ich kurz folgenden Fehler...

Code: [Select]
DB Error: Bad SQL Query: SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_active, i.image_media_file, i.image_thumb_file, c.cat_name, u.user_name FROM (4images_images i, 4images_categories c) LEFT JOIN 4images_users u ON (u.user_id = i.user_id) WHERE image_active = 1 AND image_id IN () AND c.cat_id = i.cat_id AND i.cat_id NOT IN (0) ORDER BY image_name ASC, i.image_id ASC
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND c.cat_id = i.cat_id AND i.cat_id NOT IN (0) ORDER BY image_name AS' at line 4

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/www/web2/html/includes/db_mysql.php on line 116

Danach lande ich wieder in meiner leeren lightbox, allerdings mit falscher Schriftgröße:



Der SQL Fehler tritt immer dann auf wenn die Lightbox leer betreten wird oder man sie leert.


Hier ist meine Lightbox.php:

<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: lightbox.php                                         *
 *        Copyright: (C) 2002-2010 Jan Sorgalla                           *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.9                                                *
 *                                                                        *
 *    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.                              *
 *                                                                        *
 *************************************************************************/

$templates_used 'lightbox,thumbnail_bit';
$main_template 'lightbox';

define('GET_CACHES'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

if (
$user_info['user_level'] == GUEST || $user_info['user_level'] == USER_AWAITING) {
  
show_error_page($lang['lightbox_register']);
}

//-----------------------------------------------------
//--- Show Images -------------------------------------
//-----------------------------------------------------
$imgtable_width ceil((intval($config['image_table_width'])) / $config['image_cells']);
if ((
substr($config['image_table_width'], -1)) == "%") {
  
$imgtable_width .= "%";
}

$download_allowed false;

$num_rows_all 0;
$num_rows 0;

if (!empty(
$user_info['lightbox_image_ids']))  {
  
$image_id_sql str_replace(" "", "trim($user_info['lightbox_image_ids']));
  
$sql "SELECT COUNT(image_id) AS images
          FROM "
.IMAGES_TABLE."
          WHERE image_active = 1 AND image_id IN (
$image_id_sql) AND cat_id NOT IN (".get_auth_cat_sql("auth_viewcat""NOTIN").")";
  
$result $site_db->query_firstrow($sql);
  
$num_rows_all $result['images'];
}

$link_arg $site_sess->url(ROOT_PATH."lightbox.php");
include(
ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page$perpage$num_rows_all$link_arg);
$offset $getpaging->get_offset();
$site_template->register_vars(array(
  
"paging" => $getpaging->get_paging(),
  
"paging_stats" => $getpaging->get_paging_stats()
));

if (
$num_rows_all) {
  
$sql "SELECT COUNT(image_id) AS images
          FROM "
.IMAGES_TABLE."
          WHERE image_active = 1 AND image_id IN (
$image_id_sql) AND cat_id NOT IN (".get_auth_cat_sql("auth_download""NOTIN").")";
  
$result $site_db->query_firstrow($sql);
  
$download_allowed intval($result['images']) > 0;

  
$additional_sql "";
  if (!empty(
$additional_image_fields)) {
    foreach (
$additional_image_fields as $key => $val) {
      
$additional_sql .= ", i.".$key;
    }
  }
  
$sql "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.""user_name")."
          FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
          LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
          WHERE i.image_active = 1 AND i.image_id IN (
$image_id_sql) AND c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat""NOTIN").")
          ORDER BY i."
.$config['image_order']." ".$config['image_sort'].", i.image_id ".$config['image_sort']."
          LIMIT 
$offset$perpage";
  
$result $site_db->query($sql);
  
$num_rows $site_db->get_numrows($result);
}

if (!
$num_rows)  {
  
$thumbnails "";
  
$msg .= ($msg != "") ? "<p>".$lang['lightbox_no_images'] : $lang['lightbox_no_images'];
}
else {
  
set_download_token($user_info['lightbox_image_ids']);

  
$thumbnails "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">\n";
  
$count 0;
  
$bgcounter 0;
  while (
$image_row $site_db->fetch_array($result)) {
    if (!
$download_allowed && check_permission("auth_download"$image_row['cat_id'])) {
      
$download_allowed true;
    }

    if (
$count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
$thumbnails .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    
$thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

    
show_image($image_row"lightbox");
    
$thumbnails .= $site_template->parse_template("thumbnail_bit");
    
$thumbnails .= "\n</td>\n";

    
$count++;
    if (
$count == $config['image_cells']) {
      
$thumbnails .= "</tr>\n";
      
$count 0;
    }
  } 
// end while
  
if ($count 0)  {
    
$leftover = ($config['image_cells'] - $count);
    if (
$leftover >= 1) {
      for (
$i 0$i $leftover$i++){
        
$thumbnails .= "<td width=\"".$imgtable_width."\">\n&nbsp;\n</td>\n";
      }
      
$thumbnails .= "</tr>\n";
    }
  }
  
$thumbnails .= "</table>\n";
// end else

$lightbox_lastaction format_date($config['date_format']." ".$config['time_format'], $user_info['lightbox_lastaction']);
if (empty(
$user_info['lightbox_lastaction'])) {
  
$lightbox_lastaction "n/a";
}

$site_template->register_vars(array(
  
"thumbnails" => $thumbnails,
  
"lightbox_lastaction" => $lightbox_lastaction
));
unset(
$thumbnails);

// [MOD] Slideshow with HIGHSLIDE START

  
$sql1 "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_active, i.image_media_file, i.image_thumb_file".$additional_sql.", c.cat_name".get_user_table_field(", u.""user_name")."
        FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
        WHERE image_active = 1 AND image_id IN (
$image_id_sql) AND c.cat_id = i.cat_id AND i.cat_id NOT IN (".get_auth_cat_sql("auth_viewcat""NOTIN").")
        ORDER BY "
.$config['image_order']." ".$config['image_sort'].", i.image_id ".$config['image_sort']."";
  
$result1 $site_db->query($sql1);
  
$num_rows $site_db->get_numrows($result1);
if (
$num_rows) {

	


$highslide_link "<a id=\"thumb1\" class='highslide' href='javascript:;' onclick=\"document.getElementById('gallery').onclick(); return false;\"><b>Slideshow<b></a>";

  
$count 0;
  
$bgcounter 0;
  
$slideshow_highslide "<div class=\"highslide-gallery hidden-container\" bgcolor=\"black\">\n";
  while (
$image_row $site_db->fetch_array($result)){
   
$slideshow_highslide .= "<a class=\"highslide\" id=\"gallery\" href=\"./".MEDIA_DIR."/".$image_row['cat_id']."/".$image_row['image_media_file']."\" title=\"".$image_row['image_name']."\" onclick=\"return hs.expand(this, miniGalleryOptions1)\"><img src=\"".ROOT_PATH.THUMB_DIR."/".$image_row['cat_id']."/".$image_row['image_media_file']."\"></a>\n";
  }
// end while
     
$slideshow_highslide .= "</div>";

    
$highslide_js .= "\n<script type=\"text/javascript\" src=\"".ROOT_PATH."js/highslide/highslide-full.js\"></script>\n";
    
$highslide_js .= "\n<script type=\"text/javascript\" src=\"".ROOT_PATH."js/highslide/highslide_cfg_slide.js\" charset=\"utf-8\"></script>";
    
$highslide_js .= "\n<link rel=\"stylesheet\" type=\"text/css\" href=\"".ROOT_PATH."js/highslide/highslide.css\" />\n";
$site_template->register_vars(array(
  
"highslide_link" => $highslide_link,
  
"highslide_js" => $highslide_js,
  
"slideshow_highslide" => $slideshow_highslide
));

}
// [MOD] Slideshow with HIGHSLIDE END


//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].$lang['lightbox']."</span>";

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$download_button "";
if (
function_exists("gzcompress") && function_exists("crc32")) {
  if (
$download_allowed && !empty($user_info['lightbox_image_ids'])) {
    
$download_button "<a href=\"".$site_sess->url(ROOT_PATH."download.php?action=lightbox")."\"><img src=\"".get_gallery_image("download_zip.png")."\" border=\"0\" title=\"Leuchtkasten komprimiert herunterladen\" alt=\"\" /></a>";
  }
  else {
    
$download_button "<img src=\"".get_gallery_image("download_zip_off.png")."\" border=\"0\" alt=\"\" />";
  }
}

$site_template->register_vars(array(
  
"msg" => $msg,
  
"clickstream" => $clickstream,
  
"lang_lightbox" => $lang['lightbox'],
  
"lang_delete_lightbox" => $lang['delete_lightbox'],
  
"url_delete_lightbox" => $site_sess->url(ROOT_PATH."lightbox.php?action=clearlightbox"),
  
"lang_delete_lightbox_confirm" => $lang['delete_lightbox_confirm'],
  
"lang_lightbox_lastaction" => $lang['lighbox_lastaction'],
  
"download_button" => $download_button
));

$site_template->print_template($site_template->parse_template($main_template));
include(
ROOT_PATH.'includes/page_footer.php');
?>


Wenn ein fremder MOD diesen Fehler verursacht kommt eigentlich nur highslide oder
das lightbox ajax refresh mod in frage.

Kann mir bitte jemand helfen?


MfG Jens

26
Hi,

da es mich ziemlich nervt wenn man sich seine Infos aus etlichen Threads zusammensuchen muss,
hier mal die Zusammenfassung.

Die Änderung von Andi bzgl. des Datums ist hier schon eingeflossen


Email verschicken wenn ein Kommentar geschrieben wurde:

Schritt 1.

Suche in details.php:
if (!$error)  {
      
$sql "INSERT INTO ".COMMENTS_TABLE."
              (image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
              VALUES
              (
$id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
      
$site_db->query($sql);
      
$commentid $site_db->get_insert_id();
      
update_comment_count($id$user_info['user_id']);
      
$msg $lang['comment_success'];
    }
  }
  unset(
$row);
  unset(
$spam_row);
}



Ersetze mit (wenn nur der User eine Email erhalten soll):
   if (!$error)  {
      
$sql "INSERT INTO ".COMMENTS_TABLE."
              (image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
              VALUES
              (
$id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
      
$site_db->query($sql);
      
$commentid $site_db->get_insert_id();
      
update_comment_count($id$user_info['user_id']);
      
$msg $lang['comment_success'];
        
$sql "SELECT image_name FROM ".IMAGES_TABLE." WHERE image_id = $id"
    
$image_name $site_db->query($sql); 
    
$sql "SELECT user_id FROM ".IMAGES_TABLE." WHERE image_id = $id"
    
$user_id $site_db->query($sql); 
    
    
$recipient_name $image_row['user_name']; 
    
$recipient_email $image_row['user_email'];
    
$image_url $script_url."/details.php?".URL_IMAGE_ID."=".$id.""

    
    
// Start Emailer für comments 
    
include(ROOT_PATH.'includes/email.php'); 
    
$site_email = new Email(); 
    
$site_email->set_to($recipient_email); 
    
$site_email->set_from($config['site_email'], $config['site_name']); 
    
$site_email->set_subject("Neuer Kommentar zu deinem Bild"); 
    
$site_email->register_vars(array( 
      
"user_name" => $image_row['user_name'], 
      
"recipient_name" => $recipient_name
      
"image_name" => $image_row['image_name'], 
      
"comment_date" => format_date($config['date_format']." ".$config['time_format'], time()),
      
"site_name" => $config['site_name'],
      
"image_url" => $image_url,
      
"comment_text" =>$comment_text,
      
"comment_headline"=>$comment_headline,
          )); 
    
$site_email->set_body("comment_email"$config['language_dir']); 
    
$site_email->send_email(); 
    }
  }
  unset(
$row);
  unset(
$spam_row);
}


oder...

Ersetze mit (wenn nur der Admin eine Email erhalten soll):
   if (!$error)  {
      
$sql "INSERT INTO ".COMMENTS_TABLE."
              (image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
              VALUES
              (
$id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
      
$site_db->query($sql);
      
$commentid $site_db->get_insert_id();
      
update_comment_count($id$user_info['user_id']);
      
$msg $lang['comment_success'];
        
$sql "SELECT image_name FROM ".IMAGES_TABLE." WHERE image_id = $id"
    
$image_name $site_db->query($sql); 
    
$sql "SELECT user_id FROM ".IMAGES_TABLE." WHERE image_id = $id"
    
$user_id $site_db->query($sql); 
    
    
$recipient_name $image_row['user_name']; 
    
$recipient_email $image_row['user_email'];
    
$image_url $script_url."/details.php?".URL_IMAGE_ID."=".$id.""
    
    
// Start Admin-Mail 
    
$recipient_name $config['site_name'];
    
$recipient_email $config['site_email'];

    
$site_email = new Email(); 
    
$site_email->set_to($recipient_email); 
    
$site_email->set_from($config['site_email'], $config['site_name']); 
    
$site_email->set_subject("Neuer Kommentar wurde geschrieben"); 
    
$site_email->register_vars(array( 
      
"user_name" => $image_row['user_name'], 
      
"recipient_name" => $recipient_name
      
"image_name" => $image_row['image_name'], 
      
"comment_date" => format_date($config['date_format']." ".$config['time_format'], time()),
      
"site_name" => $config['site_name'],
      
"image_url" => $image_url,
      
"comment_text" =>$comment_text,
      
"comment_headline"=>$comment_headline,
          )); 
    
$site_email->set_body("comment_email"$config['language_dir']); 
    
$site_email->send_email(); 
    }
  }
  unset(
$row);
  unset(
$spam_row);
}


oder...

Ersetze mit (wenn sowohl der Admin als auch der User eine Email erhalten sollen):
   if (!$error)  {
      
$sql "INSERT INTO ".COMMENTS_TABLE."
              (image_id, user_id, user_name, comment_headline, comment_text, comment_ip, comment_date)
              VALUES
              (
$id, ".$user_info['user_id'].", '$user_name', '$comment_headline', '$comment_text', '".$session_info['session_ip']."', ".time().")";
      
$site_db->query($sql);
      
$commentid $site_db->get_insert_id();
      
update_comment_count($id$user_info['user_id']);
      
$msg $lang['comment_success'];
        
$sql "SELECT image_name FROM ".IMAGES_TABLE." WHERE image_id = $id"
    
$image_name $site_db->query($sql); 
    
$sql "SELECT user_id FROM ".IMAGES_TABLE." WHERE image_id = $id"
    
$user_id $site_db->query($sql); 
    
    
$recipient_name $image_row['user_name']; 
    
$recipient_email $image_row['user_email'];
    
$image_url $script_url."/details.php?".URL_IMAGE_ID."=".$id.""

    
    
// Start Emailer für comments 
    
include(ROOT_PATH.'includes/email.php'); 
    
$site_email = new Email(); 
    
$site_email->set_to($recipient_email); 
    
$site_email->set_from($config['site_email'], $config['site_name']); 
    
$site_email->set_subject("Neuer Kommentar zu deinem Bild"); 
    
$site_email->register_vars(array( 
      
"user_name" => $image_row['user_name'], 
      
"recipient_name" => $recipient_name
      
"image_name" => $image_row['image_name'], 
      
"comment_date" => format_date($config['date_format']." ".$config['time_format'], time()),
      
"site_name" => $config['site_name'],
      
"image_url" => $image_url,
      
"comment_text" =>$comment_text,
      
"comment_headline"=>$comment_headline,
          )); 
    
$site_email->set_body("comment_email"$config['language_dir']); 
    
$site_email->send_email();
    
    
// Start Admin-Mail 
    
$recipient_name $config['site_name'];
    
$recipient_email $config['site_email'];

    
$site_email = new Email(); 
    
$site_email->set_to($recipient_email); 
    
$site_email->set_from($config['site_email'], $config['site_name']); 
    
$site_email->set_subject("Neuer Kommentar wurde geschrieben"); 
    
$site_email->register_vars(array( 
      
"user_name" => $image_row['user_name'], 
      
"recipient_name" => $recipient_name
      
"image_name" => $image_row['image_name'], 
      
"comment_date" => format_date($config['date_format']." ".$config['time_format'], time()),  
      
"site_name" => $config['site_name'],
      
"image_url" => $image_url,
      
"comment_text" =>$comment_text,
      
"comment_headline"=>$comment_headline,
          )); 
    
$site_email->set_body("comment_email"$config['language_dir']); 
    
$site_email->send_email(); 
    }
  }
  unset(
$row);
  unset(
$spam_row);
}




Schritt 2.

Erstelle in Verzeichnis ../lang/[deine Sprache]/email/ die Datei "comment_email.html"

Diese Datei stellt den Mail Body also die Nachricht dar, innerhalb dieser Datei können
folgende Variablen verwendet werden:

  • {recipient_name}
  • {user_name}
  • {image_name}
  • {site_name}.
  • {comment_headline}
  • {comment_text}
  • {image_url}
  • {comment_date}

Ein fertiges Beispiel für ein Email Template wäre z.B.:

Code: [Select]
Hallo {recipient_name},

{user_name} gab einen Kommentar zu deinem Bild "{image_name}" ab in {site_name}.

Kommentar:

{comment_headline}

{comment_text}

Hier kannst du den Kommentar ansehen: {image_url}

Datum: {comment_date}

------
Mit freundlichen Grüssen,
{site_name}


Schritt 3 (optional)

Wer seinen Usern noch anbieten möchte selbst zu entscheiden ob Sie bei neuen Kommentaren
zu Ihren Bildern eine Email wünschen ist folgendes notwendig:

Datenbank erweitern:

Code: [Select]
ALTER TABLE 4images_users ADD (user_mail_text INT UNSIGNED);
UPDATE 4images_users SET user_mail_text =1;

Datenbankfeld bekannt machen:

Ergänze in db_field_definitions.php:
Code: [Select]
$additional_user_fields['user_mail_text'] = array($lang['mail_text'], "radio", 0);
Ergänze in member_editprofile.html:

Code: [Select]
<!-- Mod Mail -->
<tr>
            <td class="row2"><b>Benachrichtigung bei Kommentar</b></td>
            <td class="row2">
              <input type="radio" name="user_mail_text" value="1"{user_mail_text_yes} />
              {lang_yes}&nbsp;&nbsp;&nbsp;
              <input type="radio" name="user_mail_text" value="0"{user_mail_text_no} />
              {lang_no}
            </td>
          </tr>
<!-- Mod Mail -->


Tweaks:

Wer seine User nicht zwingen möchte einen Kommentar-Betreff zu schreiben macht folgendes:

in der details.php löschen/auskommentieren:
Code: [Select]
if ($comment_headline == "")  {
  $msg .= (($msg != "") ? "<br />" : "").$lang['headline_required'];
  $error = 1;
}


Um auch im ACP Bereich davon befreit zu sein:

in der admin/comments.php löschen/auskommentieren:
Code: [Select]
 if ($comment_headline == "") {
    $error['comment_headline'] = 1;
  }


Falls diese Art von zusammentragen auf Freude stößt verschiebt das ganze ein Mod ins richtige Forum.


Gruß Jens





27
Hi,

how to do that?

I allready tryed to set a div into div with explicit 100 transparency but no effort.
That's what i tryed:

html:

Code: [Select]
<div id="father">
transparent content
<div id="son">
not transparent content
</div>
</div>

css:

Code: [Select]
father {
        opacity: 0.85; /* Webkit und Opera  */
        -moz-opacity: 0.85; /* Mozilla Browser */
filter: alpha(opacity = 85); /* IE */
}

son {
        opacity: 1.0; /* Webkit und Opera  */
        -moz-opacity: 1.0; /* Mozilla Browser */
filter: alpha(opacity = 100); /* IE */
}

But it's not working where is the trick?
Any clues?

Seems that the childs always inherits of there parents?


Greetz X23

28
Hi,

i like hide the {comments} tag if there is no comment available.
So is it possible to make for example that tag available?:

Code: [Select]
{if comment_available} blubbel...bla {if comment_available}

Greetz X23

29
Hi,

this changes randomly (page reload) the background image in your galery.
For me it's used for the hole galery but it can be easily adapted to work
for different categories or template html files...

Before we begin some examples (press strg while clicking on image):




Here we go:

Step 1

Add this to your style.css:

Code: [Select]
img.bg {
/* Set rules to fill background */
min-height: 100%;
min-width: 1024px;

/* Set up proportionate scaling */
width: 100%;
height: auto;

/* Set up positioning */
position: fixed;
top: 0;
left: 0;
}

@media screen and (max-width: 1024px){
img.bg {
left: 50%;
margin-left: -512px; }
}



Step 1.2

This step is important, else you will just see the background image

In your style.css locate you main container (normally "container") and set:

Code: [Select]
position: relative;


Step 2

Create a file called "randombg.php" and paste:

Code: [Select]
<?php
#FILE: random_image.php - Version 1.3
#
#INSTALLATION INSTRUCTIONS:
# 1) Save this php code to your server.
# 2) Make sure the script has execute permissions.
# 3) Make sure your $IMAGE_DIRECTORY has read permissions, as well
# as the files within that directory.
# 4) Change:
# $IMAGE_DIRECTORY = "../pictures/";
# as described in the php code below.
# 5) Make your IMG tag look similar to the following:
# <IMG SRC="/scripts/random_image.php" ALT="">
#
#ABOUT THIS SCRIPT:
#       This is a very simple php script. All it does is grab a 
#random image from a directory and print it out, hiding the actual
#filename of the image displayed. Currently, this
#script just works with gif and jpg/jpeg images. 
#
#HISTORY:
# ??/??/?? 1.3 Updated and streamlined the code with
# release of java version
# ??/??/?? 1.2 Updated with ASP release
# ??/??/?? 1.1 Original release
#
#AUTHOR:
# http://www.davelozinski.com/scripts
#
#BEGIN CONFIGURATION ITEMS:
#The full path listing to the directory which contains the images
#to be randomly chosen and displayed. 
#Unix users should be able to get away with specifying a relative path.
#NT users may have to specify the full system path, which will probably
#need to look similar to: 
#"c:\\wwwroot\\htdocs\\images\\" or
#"f:/Inetpub/wwwroot/images/"
$IMAGE_DIRECTORY "";

###Nothing below this line should need to be configured.###
$line "";
$randomNumber0;
$imageFiles = array();
$fileName "";
$x=0;
if (
$DIR opendir($IMAGE_DIRECTORY)) {
while ($fileName readdir($DIR)) {
if (is_dir($IMAGE_DIRECTORY $fileName)) { continue; }
if (!preg_match("/\w/"$fileName)) { continue; }
if (preg_match("/\.gif$|\.jpg$|\.jpeg$/i",$fileName)) {
$imageFiles[$x] = $fileName;
$x+=1;
}
}
closedir($DIR);
srand((double)microtime()*1000000);
$randomNumber rand(0,(count($imageFiles) - 1));
Header ("Pragma: no-cache\n");
if (preg_match("/\.gif$/i",$imageFiles[$randomNumber])) {
Header ("Content-type: image/gif\n\n");
} elseif (preg_match("/\.jpg$|\.jpeg$/i",$imageFiles[$randomNumber])) {
Header ("Content-type: image/jpg\n\n");
} else { #Not a gif or jpeg file. Exit the program.
exit;
}
$fp fopen ($IMAGE_DIRECTORY $imageFiles[$randomNumber], "rb");
echo (fread($fp,filesize($IMAGE_DIRECTORY $imageFiles[$randomNumber])));
fclose($fp);
}
exit;
# random_image.php
?>



Step 2.1

in randombg.pgp set the path to your background images:

Code: [Select]
$IMAGE_DIRECTORY = "";


Step 3

Place this in every template file where you want to display the background image:

Code: [Select]
<img border="0" src="randombg.php" class="bg">

All done



Tips

You can also point $IMAGE_DIRECTORY = ""; to your data directory for use with
background images out of the category where you within.


Greetz X23

30
Hi,

ich habe aktuell das Problem das ich in einer neu installieren 1.7.9 keine Subkategorien mehr erstellen,
bzw. als solche einstellen kann.

Versuche ich eine neue Kategorie als Subkategorie zu erstellen wird daraus eine Hauptkategorie,
versuche ich diese nochmals zu ändern sagt das ACP brav gespeichert aber es bei der
Hauptkategorie...

Hmm hat jemand eine Idee was das sein kann?


Gruß Jens

threadtitel geändert @Rembrandt

Pages: 1 [2] 3 4