Author Topic: [MOD] Neueste Bilder in WORDPRESS / Newest pics in WORDPRESS  (Read 10031 times)

0 Members and 1 Guest are viewing this topic.

Offline darvid

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
    • KNOWTEBOOK.COM - Community for webdeveloper
Hi,

ich habe die Integration von 4Images, PHPBB und Wordpress tatsächlich hinbekommen (How-To at: http://www.sebastianscheuer.de/aktuell/integration-von-wordpress-blog-phpbb-forum-und-4images-bildergallerie/)

Nun möchte ich natürlich Bilder auch in Wordpress anzeigen lassen.


[MOD] Neueste Bilder in WORDPRESS / Newest pics in WORDPRESS:


Vorrausetzung: 4Images und Wordpress sind in der selben Datenbank! / 4Images und Wordpress must be using the same database!!

Fügt in euren Wordpress-Theme Dateien folgenden Code hinein (abgewandelt von Nicky) / Put this code into your Wordpress-Theme, whereever u want:



 // BEGIN letzte Bilder anzeigen

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


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

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

// In following query CHANGE 4images table PREFIX if it doesn't match (Standard "4images_")!
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file
        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
        ORDER BY a.image_id DESC
        LIMIT $new_thumbs";
$result = $db->sql_query($sql);
$newpics = "\n<table><tr>\n";
if ($db->sql_numrows($result) > 0) {
  while ($row = $db->sql_fetchrow($result)) {
    $image_id = $row['image_id'];
    $cat_id = $row['cat_id'];
    $image_name = $row['image_name'];
    $thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
    $newpics .= "<td valign=\"bottom\">$image_name<br><a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"1\" alt=\"$image_name\"></a></td>\n";
  }
}
else {
  $newpics .= "<td class=\"mainmenu\" align=\"center\">nothing here</td>\n";
}
$newpics .= "</tr></table>\n";

echo "$newpics";




$new_thumbs = Anzahl der anzuzeigenden Bilder / Number of Pictures

ÄNDERE DEN PFAD ZU 4IMAGES / EDIT THE PATH TO 4IMAGES

Dort wo ihr die Bilder anzeigen wollt fügt folgenden Code hin / put this code in your WP-Theme where u want the pictures to show: <?php echo "$newpics"; ?>


VOILÀ!!
« Last Edit: June 17, 2007, 06:02:47 PM by c-bass »
/* KNOWTEBOOK - BoostYourself community for webdeveloper
/* http://www.knowtebook.com

Integration von Wordpress Blog, PHPBB Forum und 4Images Bildergalerie:
http://www.sebastianscheuer.de/aktuell/integration-von-wordpress-blog-phpbb-forum-und-4images-bildergallerie/
DEMO: http://www.pilotenbilder.de/

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD] Neueste Bilder in WORDPRESS / Newest pics in WORDPRESS
« Reply #1 on: June 18, 2007, 03:54:48 AM »
Hi nice mod. I would like to use wordpress in my gallery.. but i don't want integrate my 4images with phpbb  :| is it necessary?
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline darvid

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
    • KNOWTEBOOK.COM - Community for webdeveloper
Re: [MOD] Neueste Bilder in WORDPRESS / Newest pics in WORDPRESS
« Reply #2 on: June 18, 2007, 10:33:00 AM »
well, the idea behind that, is that all components use ONE database. in this type of integration wordpress and 4images use the databasetables of phpbb. to use 4images and wordpress together, there is right now no other solutions, i believe. however, u can try to integrate them and tell us how you did it  :lol:

an workaround could be to do the integration like I described it and to hide phpbb. in wordpress there are some other forum plugins u could use, but I think this post doesnt belong here.
/* KNOWTEBOOK - BoostYourself community for webdeveloper
/* http://www.knowtebook.com

Integration von Wordpress Blog, PHPBB Forum und 4Images Bildergalerie:
http://www.sebastianscheuer.de/aktuell/integration-von-wordpress-blog-phpbb-forum-und-4images-bildergallerie/
DEMO: http://www.pilotenbilder.de/

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD] Neueste Bilder in WORDPRESS / Newest pics in WORDPRESS
« Reply #3 on: July 18, 2007, 02:35:44 PM »
Hi! I created other gallery and integrated with wordpress. I tried this mod and works right. Thank you ^^
i will try most rated pics ;)
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline kai

  • Administrator
  • Addicted member
  • *****
  • Posts: 1.423
    • View Profile
    • 4images - Image Gallery Management System
Re: [MOD] Neueste Bilder in WORDPRESS / Newest pics in WORDPRESS
« Reply #4 on: July 18, 2007, 03:14:47 PM »
Gute Arbeit!
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD] Neueste Bilder in WORDPRESS / Newest pics in WORDPRESS
« Reply #5 on: July 18, 2007, 05:05:20 PM »
Hi! I did some modifications. Now I can see the last images from the author blog. In example, www.miblog.es/ndex.php?author=2 i will see blog from author 2 and last images from author 2. If i have the next url: http://www.miblog.es/index.php i will see the last images in the gallery from all authors. I did the next:

search:
Code: [Select]
// In following query CHANGE 4images table PREFIX if it doesn't match (Standard "4images_")!
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file
        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
        ORDER BY a.image_id DESC
        LIMIT $new_thumbs";
$result = $db->sql_query($sql);

replace to:
Code: [Select]
$autor=$_GET["author"];
if(!$autor){
// In following query CHANGE 4images table PREFIX if it doesn't match (Standard "4images_")!
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file
        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
        ORDER BY a.image_id DESC
        LIMIT $new_thumbs";
$result = $db->sql_query($sql);
}else{
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file
        FROM 4images_images a, 4images_categories b
        WHERE a.image_active=1 AND a.user_id=$autor
        AND a.cat_id = b.cat_id
        AND b.auth_viewcat=0
        AND b.auth_viewimage=0
        ORDER BY a.image_id DESC
        LIMIT $new_thumbs";
$result = $db->sql_query($sql);

}
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline *handsome*

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: [MOD] Neueste Bilder in WORDPRESS / Newest pics in WORDPRESS
« Reply #6 on: December 25, 2008, 08:27:53 AM »
i want to use this mod but the problem is that my wordpress and 4images useing different Database :-s let me know how can i use it?

Offline fast

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
Re: [MOD] Neueste Bilder in WORDPRESS / Newest pics in WORDPRESS
« Reply #7 on: June 16, 2009, 05:30:39 PM »
ich bin auf der Suche nach einem HTML Code, der via Plugin auf einer externen Wordpress-Site eingespielt werden soll. Dargestellt werden sollen die letzten 5 hinzugefügten Bilder. Kann jmd. helfen?