vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   4images Gallery 1.7 (https://vborg.vbsupport.ru/showthread.php?t=62020)

mtha 06-14-2004 02:33 AM

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.

vBFreak 06-14-2004 09:00 AM

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...

insanctus 06-14-2004 09:02 AM

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

vBFreak 06-14-2004 09:05 AM

hey, that was a fast reply... thanks :D

I'll now try this out and then I'll say you if it works...

insanctus 06-14-2004 09:06 AM

Most welcome :) Just surfin about drinkin coffee before bed.

vBFreak 06-14-2004 09:14 AM

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"


skinvb 06-14-2004 02:11 PM

I integrated in successfully but members send new images.It require admin Validate images .How can i turn off this option?

KTBleeding 06-14-2004 05:26 PM

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.

mtha 06-14-2004 07:50 PM

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 :D

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();
 } 


vBFreak 06-14-2004 09:06 PM

hmmm yes, worked without any problems :D

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?


All times are GMT. The time now is 03:11 AM.

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.02656 seconds
  • Memory Usage 1,823KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (8)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete