• [mod] Integration with phpbb3 Enjoy 4 0 5 1
Currently:  

Poll

this mod is

superb
2 (22.2%)
great
1 (11.1%)
ok
1 (11.1%)
hm..
3 (33.3%)
not good
2 (22.2%)

Total Members Voted: 9

Author Topic: [mod] Integration with phpbb3 Enjoy  (Read 36863 times)

0 Members and 1 Guest are viewing this topic.

Offline helium

  • Newbie
  • *
  • Posts: 19
    • View Profile
    • Live Anime
[mod] Integration with phpbb3 Enjoy
« on: March 03, 2008, 05:06:07 AM »
This mod integrates the users from phpbb3 forum software (http://www.phpbb.com) so that they can be used across 4images. You dont actualy have to modify any phpbb files only files within the 4images system.

This is just a quick mod i put together, it probably has a few bugs butt here is what the mod can and cant do.

Can
  • Uses the phpbb user system and sessions.
  • Users can post comments on images.
  • Upload Images
  • Create/Delete/Use Lightboxes
Can't
  • Does Not merge the users all users that are registered on the gallery will be lost (well not lost but not accessed in any way. I would sujest sending a mass email from the 4images admin pannel to inform users to re-register) or someone may make a tool to convert the users. (not me).
  • Probably wont work with some mods for 4images particularly the SEO mods and anything that touches sessions.php. Most addon mods and mods that spruce stuff up (eg. ajax rating etc) should work. Will provide small amount of support, may make an SEO mod that is compatible too.
  • Information about the user that uploaded an image will not work unless it was an admin acount that did it, will default to uploaded by guest.


demo: http://liveanime.org/gallery/ / http://liveanime.org/forums/

Download the zip


[size=150]Installation Instructions[/size][/b]

First extract the zip folder somewhere and copy the session.php and constants.php files from there to "/4images_directory/includes/" and replace the session.php and constants.php files in there.

Find in "includes/functions.php":
Code: (php) [Select]
    $user_profile_link = (!empty($url_show_profile)) ? str_replace("{user_id}", $image_row['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&".URL_USER_ID."=".$image_row['user_id'];
 
Replace with
Code: (php) [Select]
 $user_profile_link = (!empty($url_show_profile)) ? str_replace("{user_id}", $image_row['user_id'], $url_show_profile) : FORUM_ROOT_PATH."memberlist.php?mode=viewprofile&u=".$image_row['user_id'];
 
Find:
Code: (php) [Select]
  if (SHOW_RANDOM_CAT_IMAGE) {
    $sql = "SELECT DISTINCT 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, 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.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id
            ORDER BY RAND()";
 
Replace With:
Code: (php) [Select]
  if (SHOW_RANDOM_CAT_IMAGE) {
    $sql = "SELECT DISTINCT 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, c.cat_name, u.username_clean AS user_name
            FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
            LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
            WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id
            ORDER BY RAND()";
 
Find:
Code: (php) [Select]
    $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, 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.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id
            LIMIT $number, 1";
    $random_image_cache[0] = $site_db->query_firstrow($sql);
 
Replace With:
Code: (php) [Select]
    $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, c.cat_name, u.username_clean AS user_name
            FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
            LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
            WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id
            LIMIT $number, 1";
    $random_image_cache[0] = $site_db->query_firstrow($sql);
 

Find in "includes/page_header.php"
Code: (php) [Select]
"url_register" => (!empty($url_register)) ? $site_sess->url($url_register) : $site_sess->url(ROOT_PATH."register.php"),
 
Replace With
Code: (php) [Select]
  "url_register" => (!empty($url_register)) ? $site_sess->url($url_register) : $site_sess->url(FORUM_ROOT_PATH."ucp.php?mode=register"),
 
Find
Code: (php) [Select]
"url_control_panel" => (!empty($url_control_panel)) ? $site_sess->url($url_control_panel) : $site_sess->url(ROOT_PATH."member.php?action=editprofile"),
 
Replace With
Code: (php) [Select]
"url_control_panel" => (!empty($url_control_panel)) ? $site_sess->url($url_control_panel) : $site_sess->url(FORUM_ROOT_PATH."ucp.php"),
 
Find
Code: (php) [Select]
"url_logout" => (!empty($url_logout)) ? $site_sess->url($url_logout) : $site_sess->url(ROOT_PATH."logout.php"),
 
Replace
Code: (php) [Select]
 "url_logout" => (!empty($url_logout)) ? $site_sess->url($url_logout) : $site_sess->url(FORUM_ROOT_PATH."ucp.php?mode=logout&sid=".$user->data['session_id']),
 

OPEN "templates/your_template_dir/user_loginform.html" and replace it all with
Code: [Select]
<form action="<?php echo FORUM_ROOT_PATH?>ucp.php" method="post">
<input type="hidden" name="mode" value="login" />
User Name:<input type="text"  name="username" />
Password:<input type="password" name="password" />
Hidden:<input type="checkbox" class="radio" name="viewonline" />
<input type="hidden" name="autologin" value="1" />
<input type="submit" value="Submit" name="login" />
</form>

Find in top.php
Code: (php) [Select]
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, 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.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_rating DESC, i.image_name ASC
        LIMIT 10";
 
Replace With
Code: (php) [Select]
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name, u.username_clean AS user_name
        FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
        LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_rating DESC, i.image_name ASC
        LIMIT 10";
 

Find:
Code: (php) [Select]
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, 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.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_votes DESC, i.image_name ASC
        LIMIT 10";
 
Replace With
Code: (php) [Select]
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_rating, i.image_votes, c.cat_name, u.username_clean AS user_name
        FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
        LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_votes DESC, i.image_name ASC
        LIMIT 10";
 

Find:
Code: (php) [Select]
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_hits, 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.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_hits DESC, i.image_name ASC
        LIMIT 10";
 
Replace With
Code: (php) [Select]
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_hits, c.cat_name, u.username_clean AS user_name
        FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
        LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_hits DESC, i.image_name ASC
        LIMIT 10";
 

Find:
Code: (php) [Select]
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_downloads, 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.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_downloads DESC, i.image_name ASC
        LIMIT 10";

 
Replace With
Code: (php) [Select]
$sql = "SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_downloads, c.cat_name, u.username_clean AS user_name
        FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
        LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND i.cat_id = c.cat_id
        $cat_match_sql
        ORDER BY i.image_downloads DESC, i.image_name ASC
        LIMIT 10";
 

Find in "search.php"
Code: (php) [Select]
  $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
          $sql_where_query
          AND c.cat_id = i.cat_id $cat_id_sql
          ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort']."
          LIMIT $offset, $perpage";
 
Replace With
Code: (php) [Select]
  $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, u.username_clean AS user_name
          FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
          LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
          WHERE i.image_active = 1
          $sql_where_query
          AND c.cat_id = i.cat_id $cat_id_sql
          ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort']."
          LIMIT $offset, $perpage";
 


Find in "categories.php"
Code: (php) [Select]
$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.cat_id = $cat_id AND c.cat_id = i.cat_id
        ORDER BY ".$config['image_order']." ".$config['image_sort'].", i.image_id ".$config['image_sort']."
        LIMIT $offset, $perpage";
 
Replace With:
Code: (php) [Select]
$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, u.username_clean AS user_name
        FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_active = 1 AND i.cat_id = $cat_id AND c.cat_id = i.cat_id
        ORDER BY ".$config['image_order']." ".$config['image_sort'].", i.image_id ".$config['image_sort']."
        LIMIT $offset, $perpage";
 

Find in lightbox.php
Code: (php) [Select]
  $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";
 
Replace with:
Code: (php) [Select]
  $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, u.username_clean AS user_name
          FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
          LEFT JOIN ".pUSERS_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";
 

Find in "includes/constants.php" and Replace the "phpbb_" with whatever your phpbb3 table prefix is. AND change the "../forums/" to wherever your forums are RELATIVLY from your gallery folder.
Code: (php) [Select]
$table_prefix = "phpbb_";
define('FORUM_ROOT_PATH', '../forums/');
 


Find in "includes/db_mysql.php"
Code: (php) [Select]
} // end of class
?>
ADD BEFORE
Code: (php) [Select]
  /////////////////////////////////////////////////////////
  ///                                                    ///
  ///            phpbb3 Integration Mod                    ///
  ///            Created by helium                        ///
  ///            http://www.liveanime.org                ///
  ///                                                    ///
  /////////////////////////////////////////////////////////
  
  
  
  
   function _sql_validate_value($var)
    {
        if (is_null($var))
        {
            return 'NULL';
        }
        else if (is_string($var))
        {
            return "'" . $this->sql_escape($var) . "'";
        }
        else
        {
            return (is_bool($var)) ? intval($var) : $var;
        }
    }
  
  
  function sql_build_array($query, $assoc_ary = false)
    {
        if (!is_array($assoc_ary))
        {
            return false;
        }

        $fields = $values = array();

        if ($query == 'INSERT' || $query == 'INSERT_SELECT')
        {
            foreach ($assoc_ary as $key => $var)
            {
                $fields[] = $key;

                if (is_array($var) && is_string($var[0]))
                {
                    // This is used for INSERT_SELECT(s)
                    $values[] = $var[0];
                }
                else
                {
                    $values[] = $this->_sql_validate_value($var);
                }
            }

            $query = ($query == 'INSERT') ? ' (' . implode(', ', $fields) . ') VALUES (' . implode(', ', $values) . ')' : ' (' . implode(', ', $fields) . ') SELECT ' . implode(', ', $values) . ' ';
        }
        else if ($query == 'MULTI_INSERT')
        {
            $ary = array();
            foreach ($assoc_ary as $id => $sql_ary)
            {
                // If by accident the sql array is only one-dimensional we build a normal insert statement
                if (!is_array($sql_ary))
                {
                    return $this->sql_build_array('INSERT', $assoc_ary);
                }

                $values = array();
                foreach ($sql_ary as $key => $var)
                {
                    $values[] = $this->_sql_validate_value($var);
                }
                $ary[] = '(' . implode(', ', $values) . ')';
            }

            $query = ' (' . implode(', ', array_keys($assoc_ary[0])) . ') VALUES ' . implode(', ', $ary);
        }
        else if ($query == 'UPDATE' || $query == 'SELECT')
        {
            $values = array();
            foreach ($assoc_ary as $key => $var)
            {
                $values[] = "$key = " . $this->_sql_validate_value($var);
            }
            $query = implode(($query == 'UPDATE') ? ', ' : ' AND ', $values);
        }

        return $query;
    }
  
  
  function sql_escape($msg)
    {
        if (!$this->db_connect_id)
        {
            return @mysql_real_escape_string($msg);
        }

        return @mysql_real_escape_string($msg, $this->db_connect_id);
    }
 

In "details.php" Find:
Code: (php) [Select]
$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").get_user_table_field(", u.", "user_email")."
        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_id = $image_id AND i.image_active = 1 AND c.cat_id = i.cat_id";
 
Replace With:
Code: (php) [Select]
$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, u.username_clean AS user_name ".get_user_table_field(", u.", "user_email")."
        FROM (".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
        WHERE i.image_id = $image_id AND i.image_active = 1 AND c.cat_id = i.cat_id";
 

Find
Code: (php) [Select]
    $user_name_field = get_user_table_field("", "user_name");
    if (!empty($user_name_field)) {
      if ($site_db->not_empty("SELECT $user_name_field FROM ".USERS_TABLE." WHERE $user_name_field = '".strtolower($user_name)."' AND ".get_user_table_field("", "user_id")." <> '".$user_info['user_id']."'")) {
        $msg .= (($msg != "") ? "<br />" : "").$lang['username_exists'];
        $error = 1;
      }
    }
 
Replace With
Code: (php) [Select]
    $user_name_field = 'username_clean';
    if (!empty($user_name_field)) {
      if ($site_db->not_empty("SELECT $user_name_field FROM ".pUSERS_TABLE." WHERE $user_name_field = '".strtolower($user_name)."' AND ".get_user_table_field("", "user_id")." <> '".$user_info['user_id']."'")) {
        $msg .= (($msg != "") ? "<br />" : "").$lang['username_exists'];
        $error = 1;
      }
    }
 

Find:
Code: (php) [Select]
  $sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq")."
          FROM ".COMMENTS_TABLE." c
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
          WHERE c.image_id = $image_id
          ORDER BY c.comment_date ASC";
 
Replace With:
Code: (php) [Select]
  $sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date, u.group_id AS user_level, u.username_clean AS user_name, u.user_email AS user_email, u.user_allow_viewemail AS user_showemail, u.user_allow_viewonline AS user_invisible, u.user_regdate AS user_joindate, u.user_lastvisit AS user_lastaction, u.user_posts AS user_comments, u.user_website AS user_homepage, u.user_icq
          FROM ".COMMENTS_TABLE." c
          LEFT JOIN ".pUSERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
          WHERE c.image_id = $image_id
          ORDER BY c.comment_date ASC";
 

Find:
Code: (php) [Select]
        $comment_user_profile_link = !empty($url_show_profile) ? $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_show_profile)) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$comment_user_id);
 
Replace:
Code: (php) [Select]
$comment_user_profile_link = !empty($url_show_profile) ? $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_show_profile)) : $site_sess->url(FORUM_ROOT_PATH."memberlist.php?mode=viewprofile&u=".$comment_user_id);
 

Find:
Code: (php) [Select]
if (!empty($comment_row[$i][$user_table_fields['user_email']]) && (!isset($comment_row[$i][$user_table_fields['user_showemail']]) || (isset($comment_row[$i][$user_table_fields['user_showemail']]) && $comment_row[$i][$user_table_fields['user_showemail']] == 1))) {
          $comment_user_email = format_text($comment_row[$i][$user_table_fields['user_email']]);
          $comment_user_email_save = format_text(str_replace("@", " at ", $comment_row[$i][$user_table_fields['user_email']]));
          if (!empty($url_mailform)) {
            $comment_user_mailform_link = $site_sess->url(preg_replace("/{user_id}/", $comment_user_id, $url_mailform));
          }
          else {
            $comment_user_mailform_link = $site_sess->url(ROOT_PATH."member.php?action=mailform&amp;".URL_USER_ID."=".$comment_user_id);
          }
          $comment_user_email_button = "<a href=\"".$comment_user_mailform_link."\"><img src=\"".get_gallery_image("email.gif")."\" border=\"0\" alt=\"".$comment_user_email_save."\" /></a>";
        }
 

and delete it.

Run this sql Statement
NOTE: change the "4images_" to whatever your table prefic for 4images is.
NOTE2: change the "user_id = 2" part to the userid of whatever user you want to have credit for uploading the images. Id 2 is the default admin user id for phpbb3.
Code: [Select]
UPDATE `4images_images` SET `user_id` = '2';

Offline maineyak

  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: [mod] Integration with phpbb3 Enjoy
« Reply #1 on: March 03, 2008, 01:58:35 PM »
This is just what I was looking for, too bad I already have the SEO mod installed.  :cry:

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [mod] Integration with phpbb3 Enjoy
« Reply #2 on: March 03, 2008, 02:26:42 PM »
... I moved it to Mods & Plugins (Releases & Support) ...
... but I have don't tested it ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline asshero

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [mod] Integration with phpbb3 Enjoy
« Reply #3 on: March 03, 2008, 10:00:57 PM »
I'm sure there's a way to include the functions necessary for phpBB to reference user_id's in the database, whether anyone knows off the top of their head is another question. :p

Offline matteo260

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: [mod] Integration with phpbb3 Enjoy
« Reply #4 on: March 06, 2008, 11:30:20 AM »
Hi,

the integration works fine, with one big problem for me.

I lock in via my forum board. When I go to the 4images gallery, I appear locked in with my name.

But there is no "control-Panel" indication and I can`t lock in as an administrator. I only can look over the gallery like a guest can do.

If I try to open the ../admin/index.php a message appears in German that I`m not an administrator and that I have not locked in.

Any suggestions.

What about the "user levels" definitions in the constants.php? As there isn`t any part named "user_level" in the phpbb3_users any more, it doesn`t make sense.
If I change the guests user level in the constants.php to 9 (= my former admin level in phpbb2) I can lock in to the admin board. But now everybody can lock in as well as I tested it.

Regrets

Matthias Schäfer
« Last Edit: March 06, 2008, 11:12:04 PM by matteo260 »

Offline matteo260

  • Pre-Newbie
  • Posts: 6
    • View Profile
Re: [mod] Integration with phpbb3 Enjoy
« Reply #5 on: March 11, 2008, 03:14:59 PM »
Problem solved,

you have to check the group-ID in the database an put this in as user level.

Grüße

Matthias

Offline spanky

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: [mod] Integration with phpbb3 Enjoy
« Reply #6 on: April 13, 2008, 07:34:42 PM »
I have set everything correct. I am stuck on the last part.
Code: [Select]
Run this sql Statement
NOTE: change the "4images_" to whatever your table prefic for 4images is.
NOTE2: change the "user_id = 2" part to the userid of whatever user you want to have credit for uploading the images. Id 2 is the default admin user id for phpbb3.
Code:

UPDATE `4images_images` SET `user_id` = '2';

Can someone help?


Eddie


Offline spanky

  • Newbie
  • *
  • Posts: 18
    • View Profile
Help with phpbb3 Integration
« Reply #7 on: April 21, 2008, 07:14:01 AM »
I am trying to get 4Images current version integrated with phpbb 3.0.1. I am stuck. I don't know what this means.

Run this sql Statement
NOTE: change the "4images_" to whatever your table prefic for 4images is.
NOTE2: change the "user_id = 2" part to the userid of whatever user you want to have credit for uploading the images. Id 2 is the default admin user id for phpbb3.


Can someone help me with this?

Eddie

Offline asd.m

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: Help with phpbb3 Integration
« Reply #8 on: April 21, 2008, 09:41:37 AM »
I'm not shore about what u should do

but

show me the page that u read this in and I can help u 
If u need any help
add me and I'll help u if I can :)

My email

4images@f7up.com

الى اية مساعده
اضفني على المسنجر

Offline spanky

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Help with phpbb3 Integration
« Reply #9 on: April 21, 2008, 09:43:29 PM »

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: Help with phpbb3 Integration
« Reply #10 on: April 21, 2008, 09:54:10 PM »
... and why you don't post in the related thread ... ?
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline spanky

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: [mod] Integration with phpbb3 Enjoy
« Reply #11 on: April 21, 2008, 10:26:16 PM »
I am trying to get 4Images current version integrated with phpbb 3.0.1. I am stuck. I don't know what this means.

Run this sql Statement
NOTE: change the "4images_" to whatever your table prefic for 4images is.
NOTE2: change the "user_id = 2" part to the userid of whatever user you want to have credit for uploading the images. Id 2 is the default admin user id for phpbb3.

Can someone help me with this?

Eddie

Offline asd.m

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: Help with phpbb3 Integration
« Reply #12 on: April 22, 2008, 12:52:17 AM »
hello :)

if u didn't do any change in " $table_prefix "
that it's in config.php file in 4images
don't change any thing and do this sql
Code: [Select]
UPDATE `4images_images` SET `user_id` = '2';
If u need any help
add me and I'll help u if I can :)

My email

4images@f7up.com

الى اية مساعده
اضفني على المسنجر

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [mod] Integration with phpbb3 Enjoy
« Reply #13 on: April 22, 2008, 10:44:50 AM »
hello :)

if u didn't do any change in " $table_prefix "
that it's in config.php file in 4images
don't change any thing and do this sql
Code: [Select]
UPDATE `4images_images` SET `user_id` = '2';


Code: [Select]
UPDATE 4images_images SET user_id  = '2' where user_id = '1';
guest with -1 should be not updated..
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline spanky

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: [mod] Integration with phpbb3 Enjoy
« Reply #14 on: April 23, 2008, 07:14:43 AM »
I got that part worked put. When I loged out of the gallery I get a page not found error. I looked in the url and I see a FORUM_ROOT_PATH as part of the url.
I noticed that there is several edits in this script that has that. Do I cahnge all of them to my path or is there a certain file that I change the path?

Eddie

 

Post your comments here