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

Pages: [1] 2
1
This tutorial explains, how to get existing keywords in searchform:

example:



1. create a new php-file called ajax-list-keywords.php in root/4images with this code in it (edit host-username-password-dbName):

Code: [Select]
<?php

$conn 
mysql_connect("host","username","password");
mysql_select_db("dbName",$conn);

if(isset(
$_GET['getKeywordsByLetters']) && isset($_GET['letters'])){
$letters $_GET['letters'];
$letters preg_replace("/[^a-z0-9 ]/si","",$letters);
$res mysql_query("select word_id,word_text from 4images_wordlist where word_text like '".$letters."%'") or die(mysql_error());
#echo "1###select word_id,word_text from 4images_wordlist where word_text like '".$letters."%'|";
while($inf mysql_fetch_array($res)){
echo $inf["word_id"]."###".$inf["word_text"]."|";
}
}

?>


2. add the following files to your gallery in root/4images/js folder
http://www.snuup.de/4img_mods/ajax-js.zip
[EDIT] zip file attached to the bottom of this post

3. edit: templates/default/header.html

find:
Code: [Select]
<link rel="stylesheet" href="{template_url}/style.css" />
add after:

Code: [Select]
<style type="text/css">

/* Big box with list of options */
#ajax_listOfOptions{
position:absolute; /* Never change this one */
width:175px; /* Width of box */
height:250px; /* Height of box */
overflow:auto; /* Scrolling features */
border:1px solid #317082; /* Dark green border */
background-color:#FFF; /* White background color */
text-align:left;
font-size:0.9em;
z-index:100;
}
#ajax_listOfOptions div{ /* General rule for both .optionDiv and .optionDivSelected */
margin:1px;
padding:1px;
cursor:pointer;
font-size:0.9em;
}
#ajax_listOfOptions .optionDiv{ /* Div for each item in list */

}
#ajax_listOfOptions .optionDivSelected{ /* Selected item in the list */
background-color:#317082;
color:#FFF;
}
#ajax_listOfOptions_iframe{
background-color:#F00;
position:absolute;
z-index:5;
}

form{
display:inline;
}

</style>
<script type="text/javascript" src="js/ajax.js"></script>
<script type="text/javascript" src="js/ajax-dynamic-list.js"></script>

4. edit: templates/default/search_form.html

find:

Code: [Select]
<input type="text" name="search_keywords" size="40" value="{search_keywords}" class="input" />
replace with:

Code: [Select]
<input type="text" name="search_keywords" size="40" value="{search_keywords}" class="input" onkeyup="ajax_showOptions(this,'getKeywordsByLetters',event)" />
you can use this searchform also in your header of 4images:



edit every toplevel html-file like details.html, home.html, register.html, lightbox.html, member.html and some more... and find:

Code: [Select]
<input type="text" name="search_keywords" size="15" class="searchinput" />
replace with:

Code: [Select]
<input type="text" name="search_keywords" size="15" class="searchinput" onkeyup="ajax_showOptions(this,'getKeywordsByLetters',event)" />
Hope it works 4you!

Cu by Flo :wink:

2
Many users of 4images search this MOD, know I have a little idea to get this!

We can use it like the same way as we use the lightbox function!

features:

- see for which files youīll receive comments
- add / delete subscribed files
- view subscribed files with thumbnails

for examle:

Users can click a button on details page e.g. called "subscribe", know the file will added like the same way 4images-files are added into the lightbox.

Now its a little bit tricky, but I think we can use this MOD from Vraxtor (http://www.4homepages.de/forum/index.php?topic=2705.0):

Code: [Select]
//-----------------------------------------------------
// Start Emailer for comments
//-----------------------------------------------------

    $recipient_name = $image_row['user_name'];
   $recipient_email = $image_row['user_email'];
   $image_url = $script_url."/details.php?".URL_IMAGE_ID."=".$id."";

$sql = "SELECT user_allowemails FROM ".USERS_TABLE." WHERE user_name = '$recipient_name'";
$result = $site_db->query($sql);
$row = $site_db->fetch_array($result);
$user_allowemails = ($row['user_allowemails']);

if ($user_allowemails == 1) {
   $current_time = time();
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($lang['send_comment_emailsubject']);
    $site_email->register_vars(array(
      "user_name" => stripslashes($user_name),
      "recipient_name" => stripslashes($image_row['user_name']),
      "image_name" => $image_row['image_name'],
      "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();
    }

So we have to figured out to tell the emailer he should send this notification all users wich have subscribed to this file (when a comment is posted).

e.g.

1. user Hero (user_id=1) & user Max (user_id=2) subscribed to image trees (image_id=1)
2. a guest posted a comment for image 1
3. emailer search db which users will receive a notification for this comment and send user_id=1 & user_id=2 an email.

Hope somebody can help! Many users will be happy when this works :!: :wink:


3
Discussion & Troubleshooting / BBCode Strange error in comments
« on: October 10, 2006, 09:21:15 PM »
Hi, in my comments, Iīve got some strange errors. I use smilies and when some useres post comments, sometimes it looks like:

&lt;img src="./templates/default/smiles/confused.gif" alt="" border="0"&gt;

and sometimes it works, but why?

Greetz by Flo

4
Feedback & Suggestions / Postcard and Captcha
« on: October 08, 2006, 09:43:17 AM »
I think Iīve found an error.

When I try to send a postcard, it would be send without captcha, but captcha is enabled :?

I added javascript to the header.

Ciao by Flo

Edit: Well, I think I know whats going wrong... itīs better to be logged out :oops:

5
This little script keeps the agree button (in register_signup.html) inactive until 10 seconds. So users have some time to read the agreements 8)

Example:


Files to modify:

templates/default/register_signup.html
templates/default/register.html

1. edit register_signup.html and find:

Code: [Select]
<form method="post" action="{url_register}">
<input type="hidden" name="action" value="register" />
<input type="submit" value="{lang_agree}" class="button" />
</form>

replace with:

Code: [Select]
<form method="post" action="{url_register}" name="sform">
<input type="hidden" name="action" value="register" />
<input type="hidden" name="disclaimer" value="viewed">
<input type="submit" name="submitbtn" value="{lang_agree}" class="button" />
</form>

2. open register.html and find: {footer}

Add above

Code: [Select]
<script language="javascript">
<!--
var secs = 10;
var wait = secs * 1000;
document.sform.submitbtn.disabled=true;

for(i=1;i<=secs;i++) {
 window.setTimeout("update(" + i + ")", i * 1000);
}

window.setTimeout("timer()", wait);

function update(num) {
 if(num == (wait/1000)) {
  document.sform.submitbtn.value = "Akzeptieren";
 }
 else {
  printnr = (wait/1000)-num;
  document.sform.submitbtn.value = "Akzeptieren (" + printnr + ")";
 }
}

function timer() {
 document.sform.submitbtn.disabled=false;
}
//-->
</script>

I really donīt know if itīs the best place to embed this script here above the footer, but it works - try it yourself  :wink:

Best regards by Flo

6
This thread should help you to use the captcha function from 4images version 1.7.3 also in [MOD] guestbook -> http://www.4homepages.de/forum/index.php?topic=7409.0

Features:
+ switch the captcha function on / off
+ use the words.txt to define your own words
+ create your own backgrounds like in the new version 1.7.3

Note: You need 4images version 1.7.3 to run this modification

Files which you have to modifi:

- guestbook.php
- guestbook_form.html
- config.php

1. open guestbook.php and find:

Code: [Select]
// Flood Check
add above:
Code: [Select]
//-----------------captcha function from 4images 1.7.3 ----------------------------
$captcha = (isset($HTTP_POST_VARS['captcha'])) ? un_htmlspecialchars(trim($HTTP_POST_VARS['captcha'])) : "";
//-----------------captcha function from 4images 1.7.3 ----------------------------

find:
Code: [Select]
if (!$error)  {
      if ($comment_site =="http://") {
         $comment_site = "";

add above:
Code: [Select]
//-----------------captcha function from 4images 1.7.3 ----------------------------
if ($captcha_enable_guestbook && !captcha_validate($captcha)) {
      $msg .= (($msg != "") ? "<br />" : "").$lang['captcha_required'];
      $error = 1;
    }
//-----------------captcha function from 4images 1.7.3 ----------------------------

find:
Code: [Select]
"lang_comment" => $lang['comment'] (without > , < behind)

replace with:
Code: [Select]
"lang_comment" => $lang['comment'],
"lang_captcha" => $lang['captcha'],
"lang_captcha_desc" => $lang['captcha_desc'],
"captcha_guestbook" => (bool)$captcha_enable_guestbook

2. open guestbook_form.html
find:
Code: [Select]
<td>{bbcode}</td>
</tr>

add after:
Code: [Select]
{if captcha_guestbook}
                <tr>
                  <td width="90" valign="top"><b>{lang_captcha}</b></td>
                  <td>
                    <a href="javascript:new_captcha_image();"><img src="{url_captcha_image}" border="0" id="captcha_image" /></a>
                    <br />
                    <input type="text" name="captcha" size="30" value="" class="commentinput" id="captcha_input" />
                    <br />
                    {lang_captcha_desc}
                  </td>
                </tr>
{endif captcha_guestbook}

3. open config.php

find:

Code: [Select]
define("4IMAGES_ACTIVE", 1);
add after:
Code: [Select]
$captcha_enable_guestbook = 1;
Iīll hope youīve got it! Ciao by Flo

7
Installation, Update & Configuration / Fileserver
« on: August 30, 2006, 07:20:37 PM »
How can I do so?

Homepage (/4images) = server1

Files (/data) = server2

Please help! :?


8
Chit Chat / +++ Project Newsletter +++ Lets talk about!
« on: April 04, 2006, 06:08:18 PM »
The emailfunction from 4images isnīt bad, but Iīve found a software (mutlilang)
which you can install on your pc and integrate in your 4images Homepage!

With this program your guests can subscribe/unsubscribe to the newsletter.
The software is used to download the list (which is on your server) where users sub/unsubscribe and to send the newsletter as text and also in formated html.

Here some pics:


To get the actual list of subscribed users:


So Iīve said your guests can sub/unsubscribe - weīll thatīs the point...
This program isnīt able to search members-email from mysql db...
perhaps somebody has an idea :idea: how we can add a function, which integrates
a user in this list when heīs register to 4images :idea:

I hope itīs interessting 4u

9
Discussion & Troubleshooting / Repeat email when register
« on: February 26, 2006, 11:01:20 PM »
Sometimes I get failure notice when somebodyīs register to my site.

How can I do this that user must repeat their email address when they register?

THX by Flo


10
Mods & Plugins (Requests & Discussions) / Random gallery banner 2006
« on: February 25, 2006, 09:57:32 PM »
I have found a script which can be very usefull for your website.

The following MOD looks like "random-image" on your gallery but it works with your gallery-banner

Each refresh on your page loads new banner with different urls -> you can try this here http://www.snuup.de/lite

1. Create a new file e.g. banner_2006.php and paste this code into it -> save it in root of 4images gallery

1b. Define the path of $base_dir & $img_url

Code: [Select]
<?php

/* Banner Simple, Version 1.0
 * by Dan Kaplan <dan@abledesign.com>
 * Last Modified: January 10, 2003
 * --------------------------------------------------------------------
 *
 * USE THIS LIBRARY AT YOUR OWN RISK; no warranties are expressed or
 * implied. You may modify the file however you see fit, so long as
 * you retain this header information and any credits to other sources
 * throughout the file.  If you make any modifications or improvements,
 * please send them via email to Dan Kaplan <dan@abledesign.com>.
 * --------------------------------------------------------------------
*/

$base_dir '/path/to/www/';
$img_url 'http://www.mysite.com/4images/templates/default/images/banner';

// add any banner sizes (width x height) that you will use:
// IAB Standards & Guidelines:  http://www.iab.net/standards/adunits.asp
$banner_sizes = array ("468x60""100x60""405x60""100x38""300x250""250x250""240x400""336x280""180x150""234x60""88x31""120x90""120x60""120x240""125x125""160x600""120x600");

$srand_called FALSE;
$last_file '';
$array '';

function 
get_banner($size='') {
global $base_dir$img_url$banner_sizes$srand_called$last_file$array;

if (empty($size) || !in_array($size$banner_sizes)) {
$size "468x60";
}

$size_split explode("x"$size);
$width $size_split[0];
$height $size_split[1];

if (empty($last_file) || ($size != $last_file) || !is_array($array)) {
// if calling muliple banners on one page, no need to read in the same file repeatedly.  so,
// if the last banner file read in is the next one called, pull the $array array from memory.

$file $base_dir."/templates/default/images/banner/banner_".$size.".txt";
if (!file_exists($file)) {
// could not load the banner file, so create a default blank image and exit
$banner "<img src=\"\" width=\"$width\" height=\"$height\" border=\"0\" alt=\"broken image\">";
return $banner;
}
$array file($file); // read $file into an array
$last_file $size; // save the last read-in file into memory
}

if (!$srand_called) {
// slightly less random without this; srand() should only be called once for multiple banners
mt_srand ((double) microtime() * 1000000);
$srand_called TRUE;
}

$rand mt_rand(1count($array)-1); // start at 1 to ignore comment line
$line chop($array[$rand]);

# URL | target="_blank" (1/0) | off-site image (1/0) | image | Alt text
$banner_split explode("|"$line);
$URL $banner_split[0];
$blank $banner_split[1];
$off_site $banner_split[2];
$image $banner_split[3];
$alt $banner_split[4];

if ($blank == 1) {
$target "target=\"_blank\"";
} else {
$target "";
}

if ($off_site == 1) {
$image $image;
} else {
$image "$img_url/$image";
}

$banner "<a href=\"$URL\" $target><img src=\"$image\" width=\"$width\" height=\"$height\" border=\"0\" alt=\"$alt\"></a>";
return $banner;
}

?>

2. Create a new folder templates/default/images/banner

3. Create a new txt file called banner_405x60.txt and paste this line into it
Code: [Select]
# URL | target="_blank" (1 = Yes, 0 = No) | off-site image (1 = Yes, 0 = No) | image | Alt text
4. Now you can add your banner and define url, target, image,... (off-site image 1 -> image is remote linked)
Code: [Select]
# URL | target="_blank" (1 = Yes, 0 = No) | off-site image (1 = Yes, 0 = No) | image | Alt text
http://www.mysite.com/4images/index.php|0|0|gallery_home.gif|Welcome to our gallery

5. Edit the following files:

categories.php
details.php
guestbook.php*
index.php
lightbox.php
member.php
memberlist.php*
pm.php*
postcards.php
register.php
search.php
top.php

*when you have installed this mod

Note: If you have installed other MODs - you have also edit these "TopLevel PHP" files!

Search in every file which is listed above:

Code: [Select]
require(ROOT_PATH.'includes/sessions.php');
Add below:

Code: [Select]
include(ROOT_PATH.'banner_2006.php');
6. Open your templates/default/

categories.html
details.html
guestbook.html*
home.html
lightbox.html
member.html
memberlist.html*
pm.html*
postcards.html
register.html
search.html
top.html

Find:
Code: [Select]
<img src="{template_url}/images/header_logo.gif" width="405" height="60" alt="" />
Replace:
Code: [Select]
<?php
echo 
get_banner("405x60");
?>

If you have installed a Template from Bali-Webdesign you have only edit header.html

*when you have installed this mod

The positive effect of this script is that you can call banner with different sizes with the same banner_2006.php

e.g.
Code: [Select]
<?php
echo 
get_banner("88x31");
?>

Now I hope Iīve nothing forget to explain! Good luck! :wink:

11
Chit Chat / Keep gallery clean / Galerie sauber halten
« on: February 21, 2006, 08:22:09 AM »
Hy @ all!

Has somebody a good idea to keep the gallery clean?
Or a good method to sort categories?

---------------------------------------------------------------------------------------------

Hat jemand eine gute Idee wie man die Galerie sauber halten kann?
Oder eine gute Methode um die Kategorien zu sortieren?

12
Discussion & Troubleshooting / Show dynamic link of image in details.html
« on: January 16, 2006, 04:49:20 PM »
Hello everybody :!:

I want to show the complete link of the file in details.html

exactly like this - without session ID
Code: [Select]
http://www.snuup.de/lite/details.php?image_id=1030
Please anybody can help :|

13
For few seconds Iīve got this error message:

Code: [Select]
Warning: mysql_connect(): User (my db user) has already more than 'max_user_connections' active connections in /www/htdocs/my account/path/includes/db_mysql.php on line 39

DB Error: Could not connect to the database server (localhost, my db).


Line 39: if (!$this->connection = $connect_handle($db_host, $db_user, $db_password)) {

I have nothing changed!  :?

Please Help!

Ciao by Flo

14
Templates & Styles (Requests & Discussions) / Add new box to navbar
« on: December 27, 2005, 11:35:32 PM »
Hello everybody!

Iīve got a question.

When I create a new box e.g. called "Partner" to my navbar, I have to add this box to all template files like: postcard_create.html, search.html, home.html, lightbox.html, top.html...... much more

Now when Iīll change links in this box, I have to repeat this again in every *.html file  8O

Is there another way to do this easier?

like:
Code: [Select]
<table border="0" cellpadding="0" cellspacing="0" width="150">
<tbody>
<tr>
<td background="{template_url}/images/top-in-tab.gif" width="150" height="28">&nbsp; {lang_partner_box}</td>
</tr>
<tr>
<td background="{template_url}/images/in-tab.gif" width="150">

{partner_box}

</td>
</tr>
<tr>
<td width="150" height="9" background="{template_url}/images/bot-in-tab.gif"></td>
</tr>
</tbody>
</table>

So I only must change my partner_box.html and this will take effect to all *.html files :?:

15
Hello again and sorry for this new topic!

My users downloads a lot, but I donīt know the most wanted of today!

Does a mod exists which shows me the last downloaded files of today on my gallery?

- I donīt know how itīs called - e.g. more than more than more than more statistic ? :?

I think this forum is in a mess and I contributed too  :oops:

O.K. perhaps you can help me to find the right topic if it exists... - I really searched for it :!:


Pages: [1] 2
Post your comments here