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.


Messages - Buggy Driver

Pages: [1] 2
2
In de code you added in step 3 look for

Code: [Select]
background-color:#FFF; /* White background color */

add after
Code: [Select]
color:#000000;  /* text color   (000000 for Black   FFFFFF for White)  */


3
Its actually very easy (once you know the answer  :wink:)

1 = ON
0 = OFF

so in your case, you don’t need the shortURL so it has to be off     
$shortURL   = 0;   



And this maybe off interest to some of you.
I have several private categories and if I give those url s to Google it will end up at the start page because Google doesn’t have permission to view the image.  I changed the query string so that Google will only get the url for public images.

Code: [Select]
$categories = mysql_query('SELECT cat_id FROM ' . $table_prefix . 'categories WHERE auth_viewimage = 0');

and
Code: [Select]
$images = mysql_query('SELECT image_id,image_active,image_date
                       FROM ' . $table_prefix . 'images
                       WHERE image_active = 1
                       AND cat_id IN (SELECT cat_id
                                      FROM 4images_categories
                                      WHERE auth_viewimage = 0)'); 

4
No problem we al have to learn 

I am happy to help

5
Are you sure someone download an image after the install? The mod cant backtrack downloads that hap pent in the past

Admin en guests downloads don’t get listed.

I cant remember if I needed to change something when I install it on 4images 1.7.4


6
I am not sure I understand

Is it a problem at the mod it self or just by the ad on I created? 

7
Dorn  I have integrated my phpBB in to 4 images

Change username to user_name in

$sql = "SELECT `user_id` , `username`



EDIT

you will need to change more than that
I hoop I got evriting

Code: [Select]
// START list users who download this image
$dl_users = "";
// change ADMIN   USER  GUEST   to set user Permission
if ($user_info['user_level'] >=  USER) {

  $img_id = $image_row['image_id'];

  $sql = "SELECT `user_id` , `user_name`
          FROM ".USERS_TABLE."
          WHERE `downloaded_image_ids` LIKE '$img_id'
          OR `downloaded_image_ids` LIKE '$img_id %'
          OR `downloaded_image_ids` LIKE '% $img_id'
          OR `downloaded_image_ids` LIKE '% $img_id %'";

  $result = $site_db->query($sql);
  if ($result) {
    while ($row = $site_db->fetch_array($result)) {
      // change ADMIN   USER  GUEST   to set Permission   link to other download same user  - - > link to user profile
      if ($user_info['user_level'] >= ADMIN) {
        $dl_users .= "\n<a href=\"".$site_sess->url("search.php?user_downloads=".$row['user_id'])."\">".$row['user_name']."</a> &nbsp; ";
      } else {
        $dl_users .= "\n<a href=\"".$site_sess->url("member.php?action=showprofile&amp;user_id=".$row['user_id'])."\">".$row['user_name']."</a> &nbsp; ";
      }
    }
  }
}
// STOP list users who download this image

8
I took an other look ad the missing items and I am still convinced it has to be

Code: [Select]
// $count = ($words > $phrases) ? $words : $phrases;
$count = $words + $phrases;


the calculation of the page are wrong otherwise
$count = ($words > $phrases) ? $words : $phrases;


found 32 words and 6 phrases
these or clamed to be shown on 7 pages

5 items on every page - - > 7 pages  that is only 35 items total 
I wil be missing 3 items

$count = $words + $phrases;


found 32 words and 6 phrases
these or shown on 8 pages

5 items on every page - - > 8 pages  that is 40 items total 
last page only contains 3 items (there isn’t any more to show)

can someone else test this and let us know what the result is?


9

Yes it is possible
I use  this to see who downloaded in the detail page

Backup al files
(I have not tested this instructions on a new 4image install so better save than sorry)
 
change file
details.php
lang/<your language>/main.php
templates/<your template>/details.html

In details.php look for
Code: [Select]
show_image($image_row, $mode, 0, 1);

add before  ( look 2X for “// change ADMIN   USER  GUEST” in code snipped to set user permission)
Code: [Select]
// START list users who download this image
$dl_users = "";
// change ADMIN   USER  GUEST   to set user Permission
if ($user_info['user_level'] >=  USER) {

  $img_id = $image_row['image_id'];

  $sql = "SELECT `user_id` , `username`
          FROM ".USERS_TABLE."
          WHERE `downloaded_image_ids` LIKE '$img_id'
          OR `downloaded_image_ids` LIKE '$img_id %'
          OR `downloaded_image_ids` LIKE '% $img_id'
          OR `downloaded_image_ids` LIKE '% $img_id %'";

  $result = $site_db->query($sql);
  if ($result) {
    while ($row = $site_db->fetch_array($result)) {
      // change ADMIN   USER  GUEST   to set Permission   link to other download same user  - - > link to user profile
      if ($user_info['user_level'] >= ADMIN) {
        $dl_users .= "\n<a href=\"".$site_sess->url("search.php?user_downloads=".$row['user_id'])."\">".$row['username']."</a> &nbsp; ";
      } else {
        $dl_users .= "\n<a href=\"".$site_sess->url("member.php?action=showprofile&amp;user_id=".$row['user_id'])."\">".$row['username']."</a> &nbsp; ";
      }
    }
  }
}
// STOP list users who download this image

look for
Code: [Select]
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  "msg" => $msg,
  "clickstream" => $clickstream,

add after
Code: [Select]
"dl_users" => $dl_users,
"lang_users_downloads" => $lang['users_downloads'],

you can use
{lang_users_downloads}
{dl_users}
in your details.html

personal I added this just after the table row that contains the {image_downloads}
Code: [Select]

{if dl_users}
                                      <tr>
                                        <td valign="top" class="row1"><b>{lang_users_downloads}</b></td>
                                        <td valign="top" class="row1">{dl_users}</td>
                                      </tr>
{endif dl_users}

in your language file main.php
look for
Code: [Select]
$lang['downloads'] = "Downloads:";

add after
Code: [Select]
$lang['users_downloads'] = "Download by:";

I only allow admin to see and then it look like this
http://buggyteambelgie.dnsalias.com/img/10.jpg

10
i have trouble with this code
// $count = ($words > $phrases) ? $words : $phrases;
$count = $words + $phrases; 

problem with paging > comes error 404

Strange it works for me I to had missing items in the list

as you wrote
problem with browser

image one 2007-07-01_201736.gif > database keyword in search_stats table is okay
image two 2007-07-01_202141.gif > this view in opera
image three 2007-07-01_202234.gif > this view in firefox

i have with all browser the same problems.

I think you misunderstood my PM

By the way
2007-07-01_1.gif  the item has a count of 14

in your img 2007-07-01_201736.gif you point out items that have a cont of 1 and 4 (it’s the wrong item)



in your 2007-07-01_1.gif the status bar points out the correct search phrase

when I take my Dutch browser the status bar gifs me the wrong  search phrase



my German reading is bad  as for I can understand mawenzi post its something of English search bots   so a language thing

11
missing items in list

In search_stats.php look for
Code: [Select]
$count = ($words > $phrases) ? $words : $phrases;

change to
Code: [Select]
// $count = ($words > $phrases) ? $words : $phrases;
$count = $words + $phrases; 

12
It is like the notice says
undefined constant

the constant is defined in
Step 2.
Open /includes/constants.php
At the end of the file, just before closing ?> add this:
Code: [Select]
define('SEARCH_STATS_TABLE', $table_prefix.'search_stats');
if this is OK and you still got the notice remove the MOD  (reinstall the backup files) and start over.

13
I tried out the change posted by Buggy Driver to show only authenticated keywords,
in my case there is the word "geschenk" which is only a keyword in a category for registered users only, but after the change guests still get the keyword in the ajax-keyword-list.

where is the problem?
or did i missunderstand the function of this change?

greetings
bluE

if you choose that word do you get an images as a result?

The change just uses the existing   get_auth_cat_sql("auth_viewcat") function
The result of that function is a list of all categories that the current visitor has access to

14
I had some time to spare today so I installed some extra mods on my gallery including this one

So for 4images 1.7.4 it works like this.

Changed files:

- includes/functions.php
- includes/constants.php
- templates/your Template/details.html
- lang/your language/main.php

New files:

- mms.php
- getmms.php
- templates/your Template/mms.html
- templates/your Template/images/mms.gif

Installation

Important: Backup all files

1.)
Open includes/functions.php find:

Code: [Select]
else {
    $user_name = format_text($lang['userlevel_guest'], 2);
    $user_name_link = $user_name;
  }

add after:
Code: [Select]
$mms = '<a href="javascript:mms(\''.$site_sess->url(ROOT_PATH."mms.php?id=".$image_row['image_id']."").'\')"><img border="0" src="'.get_gallery_image("mms.gif").'"></a>';

look for
Code: [Select]
"thumbnail_file_name" => $image_row['image_thumb_file']
  ));

change to
Code: [Select]
"thumbnail_file_name" => $image_row['image_thumb_file'],
"mms" => $mms,
  ));

2.)
open includes/constants.php

find:
Code: [Select]
// If 4images has problems to find out the right URL, define it here.
// define('SCRIPT_URL', 'http://www.yourdomain.com/4images'); //no trailing slash

replace with:
Code: [Select]
// If 4images has problems to find out the right URL, define it here.
define('SCRIPT_URL', 'http://www.yourdomain.com/4images'); //no trailing slash

Don't foget 2 edit the line. Your must set your domain!!!

3.)
open templates/your Template/details.html

find:
Code: [Select]
{header}

add after
Code: [Select]
<script language="javascript">
      function mms(url) {
        var winWidth = 700;
        var winHeight = 450;
        var w = (screen.width - winWidth)/2;
        var h = (screen.height - winHeight)/2 - 60;
        var name = 'MMS';
        var features = 'scrollbars=no,width='+winWidth+',height='+winHeight+',top='+h+',left='+w;
        window.open(url,name,features);
      }
</script>

3B.)
You can use the {mms} tag in your details template in order to let users recieve mms.

Example
Look for
Code: [Select]
{download_button}&nbsp;&nbsp;

change to
Code: [Select]
{download_button}&nbsp;&nbsp;{mms}&nbsp;&nbsp;


4.)
open lang/your language/main.php

add :
Code: [Select]
//-----------------------------------------------------
//--- Send MMS ----------------------------------------
//-----------------------------------------------------
$lang['mmsheadline'] = "Recieve image over mms";
$lang['imagewidth'] = "Width:";
$lang['imageheight'] = "Height:";
$lang['download'] = "Downlaod";
$lang['id'] = "ID: ";
$lang['mmstext'] = "<b>This picture on your mobile</b><br>
<ul>
<li> Choose in the Services-menu 'Go to address'
<li> Put the following in the gap:<br> <B>{url_mms_id}</B>
<li> Then you see this:<BR> ID: <b>{mms_id}</b><br><b>Download</b>
<li> Choose 'download'
<li> The picture will be loaded. Please be patient.
<li> After the download you see the following:<br> <b>File recieved</b><br>Options - back
<li> Choose <br> <b>Options > Save</b>
<li> Rename the picture and choose a folder.
<li> <b>Now is the picture on your mobile :-)</b>
</ul>To speed things up in the future. Bookmark<br><b> {SCRIPT_URL}/getmms.php </b>on your mobile<br>there you can enter the ID shown above and hit GO";


5.)
create mms.php add the following code:

Code: [Select]
<?php 

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

$sql "SELECT image_id, cat_id, image_thumb_file, image_media_file FROM ".IMAGES_TABLE.
             WHERE image_id = "
.$id.""
$image_row $site_db->query_firstrow($sql); 

$file_size "n/a"
if (
$file_size = @filesize("data/thumbnails/".$image_row['cat_id']."/".$image_row['image_media_file'])) { 
   
$file_size format_file_size($file_size); 
   } 

$size = @getimagesize("data/thumbnails/".$image_row['cat_id']."/".$image_row['image_thumb_file'].""); 
//----------------------------------------------------- 
//--- Print Out --------------------------------------- 
//----------------------------------------------------- 

$mms_text preg_replace("/".$site_template->start."url_mms_id".$site_template->end."/siU"SCRIPT_URL."/getmms.php?id=".$id.""$lang['mmstext']);

$mms_text preg_replace("/".$site_template->start."mms_id".$site_template->end."/siU"$id$mms_text);
$mms_text preg_replace("/".$site_template->start."SCRIPT_URL".$site_template->end."/siU"SCRIPT_URL$mms_text);


$site_template->register_vars(array( 
  
"thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $mode$show_link), 
  
"file_size" => $lang['file_size']." ".$file_size
  
"width" => $lang['imagewidth']." ".$size[0]." ".$lang['px'], 
  
"height" => $lang['imageheight']." ".$size[1]." ".$lang['px'], 
  
"mmsheadline" => $lang['mmsheadline'],
"image_id" => $lang['id']."<b>$id</b>",
  
"text" => $mms_text,
)); 
$site_template->print_template($site_template->parse_template($main_template)); 
include(
ROOT_PATH.'includes/page_footer.php'); 

?>



6.)
create getmms.php add the following code:

Code: [Select]
<?php 

define
('ROOT_PATH''./'); 
include(
ROOT_PATH.'global.php');

if (!
$id) { 
echo "Enter image ID";

echo "<form action=\"".SCRIPT_URL."/getmms.php\" method=\"GET\"><input type=\"text\" name=\"id\" size=\"10\"><input type=\"submit\" value=\"GO\" name=\"B1\"></form>";

$site_db->close();
$site_sess->freeze();

exit; 


$sql "SELECT image_id, cat_id, image_thumb_file, image_media_file FROM ".IMAGES_TABLE.
             WHERE image_id = "
.$id.""
$image_row $site_db->query_firstrow($sql); 
echo 
$lang['id']." ".$id
echo 

<br> 
<a href=\""
.SCRIPT_URL."/data/thumbnails/".$image_row['cat_id']."/".$image_row['image_thumb_file']."\">".$lang['download']."</a>";
$site_db->close();
$site_sess->freeze();
exit;

?>



7.)
create templates/your Template/mms.html

you can use the following tags:

- {mmsheadline}  to show the headline
- {text}  to show the helptext
- {thumbnail}  to show the image
- {width}  to show the width
- {height}  to show the height
- {file_size}  to show the file size
- {image_id} the ID when using the bookmark version

Possible example of the template:

Code: [Select]
<html>
<head>
<title>{site_name}</title>
<link rel="stylesheet" href="{template_url}/style.css">
</head>
  <body>
    <table width="100%" border="0" cellpadding="3" cellspacing="3">
      <tr>
        <td class="head1" height="19" colspan="2">{mmsheadline}</td>
      </tr>
      <tr>
        <td class="row2" colspan="2">{image_id}</td>
      </tr>
      <tr>
       <td class="row2" >{text}</td>
       <td class="row2" align="center">{thumbnail}<p>{file_size}<p>{width}<p>{height}</td>
      </tr>
    </table>
    <br>{copyright}
  </body>
</html>


create a new button templates/your Template/images/mms.gif

Done!
Some information about the mod:

The thumbnails must be max. 128x128 px and the file size shouldn't be heigher than von 18 kb..


15
I installed this mod today.

Works like a charmed
Being my bad self I just needed to  change a few tings

Based on BlueScorpion post
http://www.4homepages.de/forum/index.php?topic=3850.msg93826#msg93826

look for
Code: [Select]
$org_search_keywords .= trim(" ".$search_keyword_list);
$search_keywords = $org_search_keywords;

change to  (solution 3:)
Code: [Select]
$org_search_keywords .= " ".$search_keyword_list;
$search_keywords = trim($org_search_keywords);

based on airphoto post
http://www.4homepages.de/forum/index.php?topic=3850.msg15953#msg15953

in functions.php  (4images 1.7.4)
look for
Code: [Select]
$sql = "SELECT `image_keywords` FROM ".IMAGES_TABLE." WHERE 1 order by `image_keywords` DESC";

change in to
Code: [Select]
$sql = "SELECT `image_keywords` FROM ".IMAGES_TABLE." WHERE 1 AND cat_id IN (".get_auth_cat_sql("auth_viewcat").") order by `image_keywords` DESC";

now the list show only keywords from the catagories that members/guests are allowed to view

Pages: [1] 2