Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
4images Gallery 1.7 Details »»
4images Gallery 1.7
Version: 1.00, by Matrixgl Matrixgl is offline
Developer Last Online: May 2006 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 02-28-2004 Last Update: Never Installs: 32
 
No support by the author.

A lot of people, both here and at 4homepages.de have been requesting for a mod/hack that would integrate vBulletin 3 RCX with 4images 1.7 lately. The solutions are scattered around the forums, but nobody has it all in one page.

So I've decided put them all togather, and release it, so it will be easier for people to do the intigration successfully.

Please note that all the codes in this hack/mod are property of Jan and mtha.
http://www.4homepages.de/forum/viewtopic.php?t=1659
http://www.4homepages.de/forum/viewt...tart=165#32514

I have tested this on vBulletin 3.0.0 RC3 and it worked successfully.

Features:
  • Uses your existing vBulletin powered forum's login account for authentication.
  • Uses your existing vBulletin powered forum's whos online feature
  • Can be modified to display any information from your existing vBulletin database, perticularly from the "user" table, which means you can display any information about the logged in user.
  • Since it is integrated with the database, you can display any gallery information such as latest picture, how many pictures a member have submitted etc... on your vBulletin powered forum.
  • Extra modifications can be found here
Screenshot:
Attached

Demo:
http://www.randomforum.com/forums/gallery *NEW
(Please note the gallery sports a custom style, not the default)
http://www.vb-es.com/galeria/ (Non-English)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #192  
Old 06-14-2004, 02:33 AM
mtha's Avatar
mtha mtha is offline
 
Join Date: Jul 2002
Location: US
Posts: 775
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
damn, I can't find the instructions... only for login/logout ^^
<edit file>
admin/admin_global.php
</edit file>

Search for
PHP Code:
if ($user_info['user_level'] != ADMIN) {
  show_admin_header();
?>
<br /><br /><br />
<table cellpadding="1" cellspacing="0" border="0" align="center" width="500"><tr><td class="tableborder">
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr class="tablerow"><td align="center" nowrap><p><?php echo $lang['no_admin']; ?></p>
<form action="<?php echo ROOT_PATH?>admin/index.php" method="post">
<input type="hidden" name="action" value="login">
<input type="hidden" name="redirect" value="<?php echo $site_sess->url(ROOT_PATH."admin/".$self_url); ?>">
<table cellpadding="0" cellspacing="1" border="0">
<tr>
  <td><input type="text" name="loginusername" size="<?php echo $textinput_size2?>"></td>
  <td><input type="password" name="loginpassword" size="<?php echo $textinput_size2?>"></td>
  <td><input type="submit" value="   <?php echo $lang['admin_login']; ?>   "></td>
</tr>
<tr>
  <td><font size="1" class="smalltext"><?php echo $lang['field_username']; ?></font></td>
  <td colspan="2"><font size="1" class="smalltext"><?php echo $lang['field_password']; ?></font></td>
</tr>
</table>
</form>
</td></tr></table>
</td></tr></table>
<p align="center">4images Administration Control Panel</p>
<?php
  show_admin_footer
();
  exit;
}
Replace with
PHP Code:
 //HN -Intergration with vB3 - BEGIN 
if ($user_info['user_level'] != ADMIN) {
  show_admin_header();
?>
<br /><br /><br />
<table cellpadding="1" cellspacing="0" border="0" align="center" width="500"><tr><td class="tableborder">
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr class="tablerow">
 <td align="center" nowrap>
  <p><?php echo $lang['no_admin']; ?></p>
  <form action="/~forums/login.php" method="post" onsubmit="md5hash(vb_login_password,vb_login_md5password)">
  <script type="text/javascript" src="/forums/clientscript/vbulletin_md5.js"></script>
  <input type="hidden" name="vb_login_md5password" />
  <input type="hidden" name="s" value="$session[sessionhash]" />
  <input type="hidden" name="do" value="login" />
  <input type="hidden" name="forceredirect" value="1" />
  <input type="hidden" name="redirect" value="<?php echo $site_sess->url(ROOT_PATH."admin/".$self_url); ?>">
  <table cellpadding="0" cellspacing="1" border="0">
   <tr>
    <td>
     <input type="text" name="vb_login_username" size="<?php echo $textinput_size2?>">
    </td>
    <td>
     <input type="password" name="vb_login_password" size="<?php echo $textinput_size2?>">
    </td>
    <td>
     <input type="submit" value="   <?php echo $lang['admin_login']; ?>   ">
    </td>
   </tr>
   <tr>
    <td>
     <font size="1" class="smalltext"><?php echo $lang['field_username']; ?></font>
    </td>
    <td colspan="2">
     <font size="1" class="smalltext"><?php echo $lang['field_password']; ?></font>
    </td>
   </tr>
  </table>
  </form>
 </td>
</tr>
</table>
</td></tr></table>
<p align="center">4images Administration Control Panel</p>
<?php
  show_admin_footer
();
  exit;
}
//HN -Intergration with vB3 - END


Quote:
Originally Posted by vBFreak
hm, I've set now the follwoing:

includes/constants.php
PHP Code:
define('COMMENTS_TABLE'$table_prefix.'comments'); 
includes/sessions.php

PHP Code:
"user_comments" => "user_comments"
I've also tried there "comments" and "4images_comments" (4images is the table prefix)

It seems that nothing is broken, but it also doesn't work and shows the number of user's comments... can anyone help?
You did it WRONG.
In sessions.php:
$user_table_fields = array( ... "user_comments" => "user_comments"

This field is for a column in user table showing the number of comments that some user has, not the same with the one in constants.php

I would suggest you to do this:
Add one field in your FORUM' user table, name it "user_album_comments"
and make this one be

"user_comments" => "user_album_comments"

It may work, I didnt test.
Reply With Quote
  #193  
Old 06-14-2004, 09:00 AM
vBFreak's Avatar
vBFreak vBFreak is offline
 
Join Date: Nov 2001
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can you say me the command which I have to enter with phpMyAdmin to alter the table with this field? Then I'll try it out... ^^

To the integration: nice work... It's very nice that you have done that things that Matrixgl had to do for us, it works great... The only minor problem is that all users are logged out if they are 900 seconds not on a page of the forum, then the cookietime of the vB-loggedincookie expires...
Reply With Quote
  #194  
Old 06-14-2004, 09:02 AM
insanctus's Avatar
insanctus insanctus is offline
 
Join Date: Feb 2003
Location: Michigan
Posts: 582
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by vBFreak
can you say me the command which I have to enter with phpMyAdmin to alter the table with this field? Then I'll try it out... ^^
Code:
ALTER TABLE user ADD `user_album_comments` VARCHAR( 100) NOT NULL
Reply With Quote
  #195  
Old 06-14-2004, 09:05 AM
vBFreak's Avatar
vBFreak vBFreak is offline
 
Join Date: Nov 2001
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hey, that was a fast reply... thanks

I'll now try this out and then I'll say you if it works...
Reply With Quote
  #196  
Old 06-14-2004, 09:06 AM
insanctus's Avatar
insanctus insanctus is offline
 
Join Date: Feb 2003
Location: Michigan
Posts: 582
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Most welcome Just surfin about drinkin coffee before bed.
Reply With Quote
  #197  
Old 06-14-2004, 09:14 AM
vBFreak's Avatar
vBFreak vBFreak is offline
 
Join Date: Nov 2001
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great work mtha, it works perfect... now it shows the nuber of the comments... thanx

The only problem is that everyone has to make a comment now to update it... can I use any sql-query to update it from all users? And what about new registered users, there should be a 0 then

Can you try to fix the same with the email field? it looks so empty

I've set this in includes/sessions.php, but the field is empty =(

PHP Code:
"user_email" => "email"
Reply With Quote
  #198  
Old 06-14-2004, 02:11 PM
skinvb skinvb is offline
 
Join Date: Feb 2004
Location: HCM
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I integrated in successfully but members send new images.It require admin Validate images .How can i turn off this option?
Reply With Quote
  #199  
Old 06-14-2004, 05:26 PM
KTBleeding's Avatar
KTBleeding KTBleeding is offline
 
Join Date: Feb 2004
Location: Tooele, UT
Posts: 756
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by skinvb
I integrated in successfully but members send new images.It require admin Validate images .How can i turn off this option?
4images settings.
Reply With Quote
  #200  
Old 06-14-2004, 07:50 PM
mtha's Avatar
mtha mtha is offline
 
Join Date: Jul 2002
Location: US
Posts: 775
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by insanctus
Code:
ALTER TABLE user ADD `user_album_comments` VARCHAR( 100) NOT NULL
actually, it should be

Code:
 
ALTER TABLE user ADD `user_album_comments` SMALLINT( 9 ) DEFAULT '0' NOT NULL;
it should be number, with default = 0 => new registered members will have this number = 0

Quote:
The only problem is that everyone has to make a comment now to update it... can I use any sql-query to update it from all users?
Idea is, you have to export a list of members (array of members ID), says $user[userid]

and for each member, do a querry to count # of comments, assign the value for $comments

SELECT COUNT( * ) AS comments FROM 4images_comments WHERE user_id =$user[userid]

then update the value of this counter

UPDATE user SET user_album_comments=$comments WHERE userid = $userid"

that's only the idea, you should modify and put it in proper form

You should check the "Update counter" or userpost from vB ACP part.

line 191, misc.php

PHP Code:
 $users $DB_site->query("SELECT userid FROM " TABLE_PREFIX "user WHERE userid >= $startat AND userid < $finishat ORDER BY userid DESC");
 while (
$user $DB_site->fetch_array($users))
 {
  
$totalposts $DB_site->query_first("
   SELECT COUNT(*) AS posts FROM " 
TABLE_PREFIX "post AS post
   INNER JOIN " 
TABLE_PREFIX "thread AS thread USING (threadid)
   LEFT JOIN " 
TABLE_PREFIX "deletionlog AS deletionlog_t ON (deletionlog_t.primaryid = thread.threadid AND deletionlog_t.type = 'thread')
   LEFT JOIN " 
TABLE_PREFIX "deletionlog AS deletionlog_p ON (deletionlog_p.primaryid = post.postid AND deletionlog_p.type = 'post')
   WHERE post.userid = 
$user[userid] AND
    thread.forumid IN (0
$gotforums) AND
    deletionlog_t.primaryid IS NULL AND
    deletionlog_p.primaryid IS NULL
  "
);
  
$DB_site->query("UPDATE " TABLE_PREFIX "user SET posts=$totalposts[posts] WHERE userid = $user[userid]");
  echo 
construct_phrase($vbphrase['processing_x'], $user['userid']) . "<br />\n";
  
flush();
 } 

MAYBE something like

PHP Code:
 $users $DB_site->query("SELECT userid FROM " TABLE_PREFIX "user ORDER BY userid");
 while (
$user $DB_site->fetch_array($users))
 {
  
$totalcomments $DB_site->query_first("
   SELECT COUNT(*) AS comments FROM 4images_comments 
   WHERE user_id = 
$user[userid]  ");
  
$DB_site->query("UPDATE " TABLE_PREFIX "user SET user_album_comments=$totalcomments[comments] WHERE userid = $user[userid]");
  echo 
construct_phrase($vbphrase['processing_x'], $user['userid']) . "<br />\n";
  
flush();
 } 
Reply With Quote
  #201  
Old 06-14-2004, 09:06 PM
vBFreak's Avatar
vBFreak vBFreak is offline
 
Join Date: Nov 2001
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmmm yes, worked without any problems

hmmm couldn't the problem with the email-field be, that the user is hiding his mailadress?

I wanted to test this, but it seems that in vB3 the mailaddress is hidden by default, I couldn't find an option in my profile settings like it was in vB 2 for this...

To the admincp-fix: the login works, but I'm still always redirected to the forum's home after it :/

PHP Code:
//HN -Intergration with vB3 - BEGIN 
if ($user_info['user_level'] != ADMIN) {
  show_admin_header();
?>
<br /><br /><br />
<table cellpadding="1" cellspacing="0" border="0" align="center" width="500"><tr><td class="tableborder">
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr class="tablerow">
<td align="center" nowrap>
  <p><?php echo $lang['no_admin']; ?></p>
  <form action="/login.php" method="post" onsubmit="md5hash(vb_login_password,vb_login_md5password)">
  <script type="text/javascript" src="/clientscript/vbulletin_md5.js"></script>
  <input type="hidden" name="vb_login_md5password" />
  <input type="hidden" name="s" value="$session[sessionhash]" />
  <input type="hidden" name="do" value="login" />
  <input type="hidden" name="forceredirect" value="1" />
  <input type="hidden" name="redirect" value="<?php echo $site_sess->url(ROOT_PATH."admin/".$self_url); ?>">
  <table cellpadding="0" cellspacing="1" border="0">
   <tr>
    <td>
     <input type="text" name="vb_login_username" size="<?php echo $textinput_size2?>">
    </td>
    <td>
     <input type="password" name="vb_login_password" size="<?php echo $textinput_size2?>">
    </td>
    <td>
     <input type="submit" value="   <?php echo $lang['admin_login']; ?>   ">
    </td>
   </tr>
   <tr>
    <td>
         <font size="1" class="smalltext"><?php echo $lang['field_username']; ?></font>
    </td>
    <td colspan="2">
     <font size="1" class="smalltext"><?php echo $lang['field_password']; ?></font>
    </td>
   </tr>
  </table>
  </form>
</td>
</tr>
</table>
</td></tr></table>
<p align="center">4images Administration Control Panel</p>
<?php
  show_admin_footer
();
  exit;
}
//HN -Intergration with vB3 - END
That's my code now, I had to change the paths a bit, because my forums are in /, is there an error now?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:12 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07893 seconds
  • Memory Usage 2,371KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (8)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete