4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Nicky on September 01, 2002, 10:06:28 PM

Title: [Mod] Random Pic in phpBB
Post by: Nicky on September 01, 2002, 10:06:28 PM
used / benutzt wurde 4images 1.7 & phpBB 2.0.2

E:
NOTE: this mod will work ONLY if your 4images mysql tables are in SAME DATABASE like phpBB.
D:
ACHTUNG: dieser mod funktioniert NUR wenn 4images mysql tabellen in GLEICHER DATENBANK sind wie die von phpBB.

1.
open / öffne
includes/page_header.php

search / suche
Code: [Select]
$template->assign_vars(array(
add before / vor dem füge dies
http://www.nicky.net/4images/random_for_phpBB.txt
in mod self change if necessery / im mod selbst ändere wenn notwendig

// Set here the URL to your 4images Gallery. WITH trailing slash!
// Set here your THUMBNAIL directory. Normally no need to change. WITHOUT trailing slash!
// In following queries CHANGE 4images table PREFIX if it doesn't match (Standard "4images_")!

search again for (same file) / such nochmals nach (gleiche datei)
Code: [Select]
$template->assign_vars(array(

add after / nachdem füge dies
Code: [Select]

    'R_RANDOM_PIC' => $randompic,


now you can use {R_RANDOM_PIC} in every phpBB template
jetzt kannst du {R_RANDOM_PIC} in jedem phpBB template benützen


2.
if you want to have the random pic only on your phpBB main page, then put the code into index.php & template index_body.tpl. (don't use it in includes/page_header.php!)

wennst willst das zufallsbild nur auf der phpBB startseite erscheint, dann füge den code nur in der index.php &  template index_body.tpl. (benutze es dann nicht in der includes/page_header.php!)

that's it.... have fun
das ist alles.... viel spass
Title: [Mod] Random Pic in phpBB
Post by: Warhead on September 04, 2002, 08:50:50 AM
Bei mir klappt es irgendwie nicht!
könnt ihr bitte mal nachschauen?

DIe Adresse hab ich angegeben, aber irgendwie steht da kein Bild-ID zum Schluss, somit auch kein richtiger Link!!! :roll:  :roll:
Title: [Mod] Random Pic in phpBB
Post by: Nicky on September 04, 2002, 07:34:30 PM
hast du auch richtiges PREFIX in den queries berücksichtigt ?
Title: [Mod] Random Pic in phpBB
Post by: Warhead on September 04, 2002, 07:57:38 PM
Jep, ich hab die Standardprefixe benutzt!!!

phpbb_ bzw. 4images_

aber vielleicht sollte ich noch dazu sagen, dass die Benutzerdaten in das Forum mit intergriiert sind!!!
Title: [Mod] Random Pic in phpBB
Post by: Nicky on September 04, 2002, 08:41:10 PM
okay,

wo kann ich dies sehen ?
Title: [Mod] Random Pic in phpBB
Post by: Warhead on September 04, 2002, 09:38:54 PM
www.vahid.de/phpbb2

bzw.

www.vahid.de/images
Title: [Mod] Random Pic in phpBB
Post by: Nicky on September 04, 2002, 10:18:56 PM
okay, der fehler liegt nicht bei mir *g*

kann nicht funktionieren wenn du keine ansicht der grossen bildern  zulassen tust, deshalb wird auch keine image_id übergeben..

ausserdem,
tust du gegen nutzungsbedingungen verstossen
richtiges code für footer.html
Code: [Select]

<p align="center">
  Powered by <b>4images</b> {script_version}
  <br />
  Copyright &copy; 2002 <a href="http://www.4homepages.de" target="_blank">4homepages.de</a>
</p>


und da du auch die VIERSTRA templates benutzten tust, sollte auch sein link drinnen sein..
bitte wieder ändern..
danke..
Title: [Mod] Random Pic in phpBB
Post by: Warhead on September 05, 2002, 09:03:05 AM
sorry, j0 mach ich rein, aber ICH persönlich hab es nicht raus genommen, wir sind 3 Admins, werd es den anderen auch sagen, dass sie das drin lassen sollen.

Wie kann ich den die Zulassung ändern, damit die Vergrößerung angezeigt wird?

und vielen Dank
Title: [Mod] Random Pic in phpBB
Post by: Nicky on September 06, 2002, 01:38:18 AM
wie ich sehe, wird das bild jetzt dargestellt...

nur, meine bitte wurde nicht erfüllt ;)
Title: New images on phpbb
Post by: giffy007 on September 10, 2002, 09:27:37 AM
Hi just wanted to know if its possible

On the Index page of phpbb i want the last 3 or 4 new image thumbnails to be shown ,how do i do this  :?:

giffy
Title: [Mod] Random Pic in phpBB
Post by: Nicky on September 13, 2002, 06:35:44 PM
hi giffy,

i just did it ...
you can see it at http://www.modellspielzeug.at/forum/
are the last 4 added images
is that what you want..?
Title: [Mod] Random Pic in phpBB
Post by: giffy007 on September 14, 2002, 07:21:26 AM
Yes thats great how can i do that !
thanks

giffy
Title: [Mod] Random Pic in phpBB
Post by: Nicky on September 14, 2002, 08:47:18 AM
hi giffy,

same instruction like the random pics for phpBB
http://www.nicky.net/4images/new_pics_for_phpBB.txt

instead of:

Code: [Select]

    'R_RANDOM_PIC' => $randompic,

use
Code: [Select]

    'N_NEW_PIC' => $newpics,

use {N_NEW_PIC} in template

and look for:
// Set thumbnails to show
$new_thumbs = 4;
Title: [Mod] Random Pic in phpBB
Post by: giffy007 on September 22, 2002, 05:42:55 PM
Ok done what you said but no thumbs appear ,

I cannot find this ( and look for: // Set thumbnails to show $new_thumbs = 4;

Where is this ?

giffy
Title: [Mod] Random Pic in phpBB
Post by: Nicky on September 22, 2002, 05:53:24 PM
hi giffy

hmm are you using this ?
http://www.nicky.net/4images/new_pics_for_phpBB.txt
or the code from my first post
Title: [Mod] Random Pic in phpBB
Post by: giffy007 on September 22, 2002, 05:56:43 PM
Hmm lol no , where did that come from   :oops:

giffy :wink:
Title: [Mod] Random Pic in phpBB
Post by: Nicky on September 22, 2002, 06:08:40 PM
http://www.4homepages.de/forum/viewtopic.php?p=7894#7894
;)
Title: [Mod] Random Pic in phpBB
Post by: giffy007 on September 22, 2002, 06:17:30 PM
Yes i tried that , still didnt work   :cry:

Just getting ( nothing here )

I try a few things and get back to you

Ok still doesnt work , just getting the words ( nothing here )
What can i do now ? ive tried other templates and still the same ?
Ive corrected the url and prefixes no joy !!!

giffy
Title: [Mod] Random Pic in phpBB
Post by: Nicky on September 22, 2002, 06:39:31 PM
where can i see it ?
and where is 4images install ?
Title: [Mod] Random Pic in phpBB
Post by: Nicky on September 22, 2002, 08:00:26 PM
Quote from: giffy007

Ok still doesnt work , just getting the words ( nothing here )
What can i do now ? ive tried other templates and still the same ?
Ive corrected the url and prefixes no joy !!!

giffy



this two things in query must match
Code: [Select]

        AND b.auth_viewcat=0
        AND b.auth_viewimage=0


if you have a secret gallery, query will return "nothing here"
because the two "0" are for all pics where user/guest can access a category a can click on a thumb to view the large pic..
Title: [Mod] Random Pic in phpBB
Post by: giffy007 on September 23, 2002, 04:08:33 PM
Ok found it , yes i have it set up to have only reg members to view so i changed this
AND b.auth_viewcat=0
AND b.auth_viewimage=2

and it works , they can only see the main image if logged in.
Question can i point them to a page if they are not logged in ??? in this mod !!!

A question
How can i format these thumbs ?
I want it so the thumbs appear in 2 colums and 4 rows .
Can i get to open a new window when they click on the thumbs ?
Once thanks for your help Nicky :wink:

Giffy
Title: Oh ! great
Post by: molokoloco on September 23, 2002, 09:33:27 PM
Just to say you thank you !!! for this mod (^_^)

I'm your fan ;)
Title: 4images category list in phpbb
Post by: coolice on February 19, 2003, 06:01:14 PM
Great mod but how can add 4images category list along with new images in phpbb?

regards
Title: [Mod] Random Pic in phpBB
Post by: Aho on March 07, 2003, 02:03:33 AM
ich weiß zwar nicht wieso, aber der will den thumbnail immer in folgender url suchen:

http://www.myhomepage.com/phpbb/4images/thumbs/1/picture.jpg

das kann ja nicht sein, im overall header habe ich immernoch
Code: [Select]
define('THUMB_DIR', 'data/thumbnails');stehen.

weiß einer wieso der das falsch verlinkt ?
Title: [Mod] Random Pic in phpBB
Post by: Aho on March 13, 2003, 04:19:11 AM
wie man hier (http://surotho.com/phpBB2plus/portal.php) schön sehen kann ist mein random pic irgendwie falsch verlinkt. hat da einer ne idee, wie ich das ändern muß, damit der den link auch richtig erstellt ?


-------

what do i have to change, that the link of the random-pic is generated correctly ? look here (http://surotho.com/phpBB2plus/portal.php), its linking to a false directory !
Title: Random Pic in phpBB, where to mod the template file?
Post by: FAF on March 16, 2003, 05:26:54 PM
hi, I'm new!

Thx for a great mod!

I have followed the description about how to ad the mod http://www.nicky.net/4images/new_pics_for_phpBB.txt into the includes/page_header.php in phpBB directory.

I saved the file, uploaded it, and everything should be fine, if I understand the procedure correctly, then I have to mod the selected template as well, cause no picture shows up as it is. The gallery and the forum are using the same database, the links and table PREFIX are ok too.

The question is, which template file should I edit to get the same result as in: http://www.modellspielzeug.at/forum/ ?

Does anyone know a good wysiwyg editor for templates like to 4images and phpBB? I will get into editing and designing from code, but it could help to see how's a program is changing the files, then I will get into the understanding on how it works quicker.

thx for your time.
Title: [Mod] Random Pic in phpBB
Post by: Aho on April 08, 2003, 07:51:52 PM
wirklich keiner ne idee, warum bei mir das random pic falsch generiert wird ? nur das bild wird falsch generiert, name und kommentare werden ja angezeigt.
Title: [Mod] Random Pic in phpBB
Post by: ai-gu on April 12, 2003, 09:46:41 PM
Hi friends,
I am testing the this mod, everything seems to be OK except that the thumbnails did not appear.

My thumb Dir is "html/album/data/thumbnails"
and I kept the Thum_Dir in the code unchanged (data/thumbnails)

When I right click  at the thumbnail position of the radom image at phpBB page I got this:

... album/thumbs/x/XXX.jpg

What I have to do to point the thumnail Dir to the right place??
Thank you for your early reply!
Title: [Mod] Random Pic in phpBB
Post by: ai-gu on April 13, 2003, 04:23:14 AM
Quote from: Aho
wie man hier (http://surotho.com/phpBB2plus/portal.php) schön sehen kann ist mein random pic irgendwie falsch verlinkt. hat da einer ne idee, wie ich das ändern muß, damit der den link auch richtig erstellt ?


-------

what do i have to change, that the link of the random-pic is generated correctly ? look here (http://surotho.com/phpBB2plus/portal.php), its linking to a false directory !


My problem is exactly the same to THIS, can anyone provide us some help??
Thankx in advance!!
Title: [Mod] Random Pic in phpBB
Post by: V@no on April 13, 2003, 04:41:39 AM
did u change?
Quote
define('THUMB_DIR', 'data/thumbnails');
Title: [Mod] Random Pic in phpBB
Post by: ai-gu on April 13, 2003, 08:02:49 AM
V@no,

I tested two options:

1- I kept it unchanged ('data/thumbnails')
2- I changed it to ('home/krvn/html/album/data/thumbnails')

But none of them work. The album folder is the Root folder for 4images.
My phpBB and 4images are in the same database.

whatever the
define('THUMB_DIR', 'data/thumbnails'); is changed to, I got the random image thumnails like this:

http://www.krvn-online.net/album/thumbs/xx/xxx.jpg

(right mouse click on the thumb image, then select "property" I got that link)

I guess the problem must be somethings else.

I would appreciate your quick help!

here is the code

Quote
// START RANDOM PIC MOD
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: none                                                 *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *             MOD for 4images 1.7 & phpBB 2.0.2                          *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    4images ist KEINE Freeware. Bitte lesen Sie die Lizenz-             *
 *    bedingungen (http://www.4homepages.de/4images/lizenz.php) für       *
 *    weitere Informationen.                                              *
 *    ---------------------------------------------------------------     *
 *    4images is NOT freeware! Please read the Copyright Notice           *
 *    (http://www.4homepages.de/4images/lizenz_e.php) for further         *
 *    information.                                                        *
 *                                                                        *
 *************************************************************************/

// Set here the URL to your 4images Gallery. WITH trailing slash!
define('SCRIPT_URL', 'http://www.krvn-online.net/album/');

// Set here your THUMBNAIL directory. Normally no need to change. WITHOUT trailing slash!
define('THUMB_DIR', 'home/krvn/html/album/data/thumbnails');

function is_remote($file_name) {
  return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}

// In following queries CHANGE 4images table PREFIX if it doesn't match (Standard "4images_")!
$sql = "SELECT COUNT(*) as total_images
        FROM 4images_images a, 4images_categories b
        WHERE a.image_active=1
        AND a.cat_id = b.cat_id
        AND b.auth_viewcat=0
        AND b.auth_viewimage=0
        ";
if ( !($result = $db->sql_query($sql)) )
{
return false;
}
$row = $db->sql_fetchrow($result);
$total_images = $row['total_images'];

mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;

$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
        FROM 4images_images a, 4images_categories b
        WHERE a.image_active=1
        AND a.cat_id = b.cat_id
        AND b.auth_viewcat=0
        AND b.auth_viewimage=0
        LIMIT $number, 1";
if ( !($result = $db->sql_query($sql)) )
{
return false;
}
$row = $db->sql_fetchrow($result);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];

$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

$randompic = "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br />Image Name: $image_name<br />Comments: $image_comments\n";
// HAVE FUN
// END RANDOM PIC MOD
Title: [Mod] Random Pic in phpBB
Post by: V@no on April 13, 2003, 08:44:13 AM
it doesnt sound right.
first, the THUMB_DIR is relative to SOURCE_DIR, that means, that the link created by combiing those two variables.
so, u can not use absolute path to THUMB_DIR.
if u dont have any thumbnails that are located on remote server (not phisicaly uploaded to your server, but just used link to it), then u can just delete the remote "detector":
Replace:
Quote
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

with:
Quote
$thumb_src = SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];


P.S. define('THUMB_DIR', 'data/thumbnails'); is correct dont change it, leave it as it is.
Title: [Mod] Random Pic in phpBB
Post by: ai-gu on April 13, 2003, 09:28:24 AM
Thanks for your effort V@no,
But still did not work, the thumbnails is still not showing and the same as before:

http://www.krvn-online.net/album/thumbs/xx/xxx.jpg


while the correct path is:

http://krvn-online.net/album/data/thumbnails/xx/xx.jpg

Could you pliz look for any other solution,
thanks once again, and have anice weekend!!
Title: [Mod] Random Pic in phpBB
Post by: ai-gu on April 13, 2003, 12:35:13 PM
define('THUMB_DIR', 'data/thumbnails');

$thumb_src = SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

Quote
$randompic = "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br />Image Name: $image_name<br />Comments: $image_comments\n";


Do you think that the problem araised from the red-colored text??
Title: [Mod] Random Pic in phpBB
Post by: V@no on April 13, 2003, 12:48:33 PM
well...
and what path it shows when u change that define('THUMB_DIR', 'data/thumbnails'); ?
if it's trying pull images from the same path even that this was changed, then maybe your host use some caching? :? (just a stupid thought)
Title: [Mod] Random Pic in phpBB
Post by: ai-gu on April 13, 2003, 01:10:58 PM
hi v@no,

I got it worked!!!
Here is what I did.

First, I guessed that 'THUMB_DIR' may have been used and defined as ('THUMB_DIR', 'thumb') in other parts of page_header.php.

Second, I changed:

Quote
define('THUMB_DIR', 'data/thumbnails');


To

Quote
define('THUMB_DIRS', 'data/thumbnails');


And I changed


Quote
$thumb_src = SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];


To

Quote
$thumb_src = SCRIPT_URL.THUMB_DIRS."/".$cat_id."/".$row['image_thumb_file'];



And now, it works, you can check it out here: http://www.krvn-online.net

V@no, Thanks for your helps, I'll be back sometimes!
Title: [Mod] Random Pic in phpBB
Post by: Aho on April 14, 2003, 05:31:42 PM
hehe,very strange ?!?!? now it works on my page too !
Title: [Mod] Random Pic in phpBB
Post by: Galeon on April 21, 2003, 11:26:08 AM
same here, got it worked with "S"

by the way, can I specify a category/sub-category not show in random pic?
Title: [Mod] Random Pic in phpBB
Post by: frederic on May 27, 2003, 10:22:50 AM
where is "$template->assign_vars(array(" ?
I can't find it in 1.7.
Title: Re: [Mod] Random Pic in phpBB
Post by: RamEEz on August 08, 2006, 05:28:11 PM
^^If i am not wrong you have to find this line in PHPBB includes folder.
Title: Re: [Mod] Random Pic in phpBB
Post by: Gibsy on March 15, 2007, 09:03:19 AM
Hallo,

ich habe das Problem, das die thumbnails im phpbb Portal bei mir nicht angezeigt werden  :(

(http://www.gibsy.com/dim/gibsy_files/Bild1.gif)

und hier mein code bei page_header.php
Code: [Select]
// START RANDOM PIC MOD
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: none                                                 *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *             MOD for 4images 1.7 & phpBB 2.0.2                          *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    4images ist KEINE Freeware. Bitte lesen Sie die Lizenz-             *
 *    bedingungen (http://www.4homepages.de/4images/lizenz.php) für       *
 *    weitere Informationen.                                              *
 *    ---------------------------------------------------------------     *
 *    4images is NOT freeware! Please read the Copyright Notice           *
 *    (http://www.4homepages.de/4images/lizenz_e.php) for further         *
 *    information.                                                        *
 *                                                                        *
 *************************************************************************/

// Set here the URL to your 4images Gallery. WITH trailing slash!
define('SCRIPT_URL', 'http://www.gibsy.com/dim/4images');

// Set here your THUMBNAIL directory. Normally no need to change. WITHOUT trailing slash!
define('THUMB_DIR', 'http://www.gibsy.com/dim/4images/data/thumbnails');

function is_remote($file_name) {
  return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}

// In following queries CHANGE 4images table PREFIX if it doesn't match (Standard "4images_")!
$sql = "SELECT COUNT(*) as total_images
        FROM 4images_images a, 4images_categories b
        WHERE a.image_active=1
        AND a.cat_id = b.cat_id
        AND b.auth_viewcat=0
        AND b.auth_viewimage=0
        ";
if ( !($result = $db->sql_query($sql)) )
{
return false;
}
$row = $db->sql_fetchrow($result);
$total_images = $row['total_images'];

mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;

$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
        FROM 4images_images a, 4images_categories b
        WHERE a.image_active=1
        AND a.cat_id = b.cat_id
        AND b.auth_viewcat=0
        AND b.auth_viewimage=0
        LIMIT $number, 1";
if ( !($result = $db->sql_query($sql)) )
{
return false;
}
$row = $db->sql_fetchrow($result);
$image_id = $row['image_id'];
$cat_id = $row['cat_id'];
$image_name = $row['image_name'];
$image_comments = $row['image_comments'];

$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

$randompic = "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br />Bild Name: $image_name<br />Kommentare: $image_comments\n";
// HAVE FUN
// END RANDOM PIC MOD

alle Kategorien sind auf Registrierung gestellt bis auf eins und nur dieser zeigt an aber auch nur als Link, es müsste doch alle Kategorien Ordner anzeigen mit thumbnails da bei mir 4images mit phpbb integriert wurde!

Aber zuerst das Problem das die thumbnails nicht anzeigen, siehe Bild oben.

Ich wäre über Eure hilfe und vorschläge sehr dankbar.

by Gibsy
Title: Re: [Mod] Random Pic in phpBB
Post by: KurtW on March 15, 2007, 04:06:28 PM
Hallo,

Code in der page_header.php? Ist das richtig ??

Schau mal hier:
http://www.4homepages.de/forum/index.php?topic=1020.0 (http://www.4homepages.de/forum/index.php?topic=1020.0)   :wink:


cu
Kurt
Title: Re: [Mod] Random Pic in phpBB
Post by: Gibsy on March 16, 2007, 10:19:54 AM
Code in der page_header.php? Ist das richtig ??

Ja, so hat Nicky in seinem ersten Beitrag geschrieben  :wink:
Title: Re: [Mod] Random Pic in phpBB
Post by: olgaart on October 17, 2008, 01:56:26 PM
Hallo Nicky,
would it be possible to make a link to member´s fotos in phpbb-member profile, like url_show_user_images in 4images member profile? Many thanks.