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)
-   -   vB3 Member Album 2.0 (https://vborg.vbsupport.ru/showthread.php?t=63733)

Christine 04-13-2004 12:50 AM

What if the images are smaller than the 175x175 thumbnail I am setting -- would that cause it to cough?

Here is a sample of the first images:
137x191
175x173
134x165
175x170
168x154
172x175

Most are within these dimensions as I had them all sized for an html gallery that we had been using.

Velocd 04-13-2004 01:23 AM

That is odd, if it worked the first time through with 100x100.

Try 200x200, maybe that works (just for testing). Are the images up to #7 actually being resized properly? There might be something up with those #7-#11 images, like you mentioned.

I'll look into why it might be doing this.

Pseudomizer 04-13-2004 01:31 AM

Hello,

i need a little bit of help please. I just installed this hack on vb3.0.0 and did all the modifications, uploads and database queries. All without any errors.

In the AdminCP i have now the options and i can set them BUT:

- where is the link to this new gallery ? Is this not in the modifications ? Do i have to manually edit my navbar to add the link to album.php ?
- when i go to my control panel ( normal user ) and i try to upload a file larger then 100x100 it rejects it. How do i set the size for the pictures ? I searched through all admin settings, but i did not find it.

Please help me.

Thanks in advance.

Cheers,

Pseudomiizer

Boofo 04-13-2004 02:16 AM

What is a good size to allow for profile pics?

Christine 04-13-2004 02:50 AM

Bob,

I have all of mine set to the approx. dimensions above for displaying in rows of 3 for 800x600 resolution.

Velocd,

I will try 200x200.

Tonight, I took a datadump of the customprofilepic table and uploaded it to my test server, deleted the thumbnaildata field all together, and then readded the field under profilepicdata.

I then reset thumbnails to 175 and attempted to resize, and it locked up here:

albumcp.php?do=rebuildthumbs&startat=21&perpage=20

With the thumbnaildata field cleared, it ran through the first 20 pics just fine, but then kept cycling back through startat=21&perpage=20.

I opened another browser program and set the URL for startat=41&perpage=20 to see if I could maybe skip over any problem pics, but it wouldn't take that -- it just refreshed itself to 21 & 20 and kept cycling though those over and over again.

All of the photos are .jpg format, and all original sizes are as mentioned.

If I add a new photo with the 175 limit, it also works fine - it is just trying to change them once they have been added and the limit is changed after that time.

This has me baffled.

Christine 04-13-2004 02:58 AM

Quote:

Originally Posted by Pseudomizer
- where is the link to this new gallery ? Is this not in the modifications ? Do i have to manually edit my navbar to add the link to album.php ?

Yes, so that you can customize it to your forums. Here is the code I used -- but I am restricting the album to members only. If you don't want to restrict that, take out the conditional.
PHP Code:

Add phrase
   
   Global
   
album
   Album
   
   In Navbar
find:
   
 <
td class="vbmenu_control"><a href="memberlist.php?$session[sessionurl]">$vbphrase[members_list]</a></td>
   
   
Below it add:
   
   <if 
condition="$show['member']">
     <
td class="vbmenu_control"><a href="album.php?$session[sessionurl]">$vbphrase[album]</a></td>
   </if> 

Quote:

- when i go to my control panel ( normal user ) and i try to upload a file larger then 100x100 it rejects it. How do i set the size for the pictures ? I searched through all admin settings, but i did not find it.
This is tied into the Attachment thumbnail setting.

That is in Options > Message Attachment Options > Thumbnail Size

:)

Christine 04-13-2004 03:00 AM

Speaking of permissions, if anyone is interested in tying the permissions on the album to the memberlist security field, just add this to album.php:
PHP Code:

Find:

$perpage $vboptions['album_perpage'];
$pertr   $vboptions['album_pertr'];

Under itadd:

// permissions check
if (!($permissions['forumpermissions'] & CANVIEW) OR !($permissions['genericpermissions'] & CANVIEWMEMBERS))
{
    
print_no_permission();


:)

Boofo 04-13-2004 03:29 AM

Quote:

Originally Posted by Christine
Bob,

I have all of mine set to the approx. dimensions above for displaying in rows of 3 for 800x600 resolution.

I have my thumbnails set at 150 width right now. But what is a good size to allow the propfilepic so it isn't too small but not too large for the profile itself? There it will show full size.

calvinnguyen 04-13-2004 04:56 AM

Quote:

Originally Posted by Velocd
vB3 Member Photo -> Options is what I meant.

Is the images per page value set?

Try editing your album.php, and under where it says:

PHP Code:

$perpage $vboptions['album_perpage']; 

Place:

PHP Code:

echo $perpage

And see if there is any output.

Still the same problem
Warning: Division by zero in /home/vietmyen/public_html/album.php on line 151

Warning: Division by zero in /home/vietmyen/public_html/includes/functions.php on line 1707



There seems to have been a slight problem with the Vietmyen Net database.
Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.

Database error in vBulletin 3.0.0:

Invalid SQL:
SELECT user.userid, dateline,
comment, user.username, user.usertitle,
user.joindate, user.usergroupid
FROM customprofilepic
LEFT JOIN user USING (userid)
WHERE visible=1

ORDER BY posts desc
LIMIT 0,

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 9

mysql error number: 1064

Date: Monday 12th of April 2004 10:55:27 PM

Pseudomizer 04-13-2004 07:51 AM

Hello Christine,

thanks for all your answers. Point 1: This is fine. Now i will add a link to my menu, but after reading your second answer with the permissions how about addind this to the memberlist as a pop-up like the search button ? This would make more sense if you already are tying it to memberlist.

Point2: I tried to set it to 200 and rebuild the attachment update counters and i tried to set it to 500 and updated the attachment counters. It is STILL 100x100. Something is going wrong here. Any idea why ?

Cheers,

Pseudomizer

Christine 04-13-2004 10:46 AM

Hi Pseudomizer,

I have it tied to the permissions, but set as a seperate link for navigation. Sure, you can change that, and with all the links I have going on up there now, I may look at that myself!

As far as the rebuild -- you need to run the rebuild function in the vB3 Member Album > Approve Images section as the attachment rebuild is for the attachment table.

Pseudomizer 04-13-2004 11:36 AM

Hi Christine,

i fully understood what you mean but it does not work. After installing all the modifications, templates and uploads my "Approve Images" section is completly empty. Only if i upload one image which is less than 100x100 pixel in my control panel, i get the options in the "Approve Images" section to rebuild the profile picture thumbnails. I could live with that but here is the problem now:

Member attachment options -> Thumbnailsize -> 500
Maintenance -> Update Counters -> Message Thumbnails > Rebuild done
vB3 Member Album -> Approve Images -> Rebuild profile picture thumbnails done

Now if i try to upload any image i still have the damn restriction of 100x100 pixel. Why ? Where is the error ?

Cheers,

Pseudomizer

Velocd 04-13-2004 03:10 PM

Pseudo, you have the thumbnail sizes confused with the actual profile picture size.

As I mentioned on the first page of this thread to Vivi Ornitier, to change the profile image dimensions, you have to edit usergroups. Each usergroup has its own defined size.

https://vborg.vbsupport.ru/showpost....4&postcount=14

Pseudomizer 04-13-2004 03:33 PM

Perfect. Thank you so much. Sorry for being unable to find that error in previous messages. A small hint in the instructions would save you a lot of time answering these kind of requests. :-)

But good work, nice hack. I will try to convert my existing pictures from your old member photo gallery hack into this new hack because all old database entries are still there.

Cheers,

Pseudomizer

Velocd 04-13-2004 04:29 PM

Quote:

Still the same problem
Warning: Division by zero in /home/vietmyen/public_html/album.php on line 151

Warning: Division by zero in /home/vietmyen/public_html/includes/functions.php on line 1707
Calvin, what I asked before was if placing echo $perpage; below $perpage = $vboptions['album_perpage'] outputted anything to the screen? My answer wasn't a direct solution.

Quote:

I took a datadump of the customprofilepic table and uploaded it to my test server, deleted the thumbnaildata field all together, and then readded the field under profilepicdata.

I then reset thumbnails to 175 and attempted to resize, and it locked up here:

albumcp.php?do=rebuildthumbs&startat=21&perpage=20

With the thumbnaildata field cleared, it ran through the first 20 pics just fine, but then kept cycling back through startat=21&perpage=20.

I opened another browser program and set the URL for startat=41&perpage=20 to see if I could maybe skip over any problem pics, but it wouldn't take that -- it just refreshed itself to 21 & 20 and kept cycling though those over and over again.

All of the photos are .jpg format, and all original sizes are as mentioned.

If I add a new photo with the 175 limit, it also works fine - it is just trying to change them once they have been added and the limit is changed after that time.

This has me baffled.
This likely has to do with the $perpage value in albumcp.php, and some weird bug.

I don't have a lot of time to debug it now, but one troubleshooting solution I can provide is to erase the $perpage chunk of code, and re-generate all thumbnails in one process.

I've attached a customized albumcp.php that does just this. Be sure to rename it albumcp.php to use it. If it still doesn't work, and locks up, then there might be a problem with the actual GD-image handling functions. (although I sort of doubt it)

calvinnguyen 04-13-2004 09:47 PM

Quote:

Originally Posted by Velocd
Calvin, what I asked before was if placing echo $perpage; below $perpage = $vboptions['album_perpage'] outputted anything to the screen? My answer wasn't a direct solution.

There is nothing to the screen, whatever the screen it.

when I type: http://mydomain.com/album.php

I got error like as I report here.

Velocd 04-13-2004 09:57 PM

No errors occured when running the install.html queries? The value of $vboptions['album_perpage'] must be blank if nothing is outputting, which means the setting must not exist in the table.

Run this query from PhpMyAdmin, and show me the results.

[sql]SELECT * FROM setting WHERE varname='album_perpage'[/sql]

calvinnguyen 04-14-2004 12:42 AM

Here is the result that I attachment when I run
SELECT * FROM setting WHERE varname='album_perpage'

When I run album.php from my website I got number 18. That's it. I did't see anything else.

gmarik 04-14-2004 05:27 PM

2-3 pics would be even betterm why not?

Velocd 04-14-2004 09:23 PM

Review the thread, I've already explained. I have a very tight schedule with college, my job, and other coding projects, therefore don't have time to spend for "add-ons" to my hacks released at vBulletin.org.

Christine 04-15-2004 12:51 AM

Thanks, Velocd -- the albumcp_debug.php worked great!

Pseudomizer 04-15-2004 01:17 AM

Quote:

Originally Posted by Velocd
Calvin, what I asked before was if placing echo $perpage; below $perpage = $vboptions['album_perpage'] outputted anything to the screen? My answer wasn't a direct solution.



This likely has to do with the $perpage value in albumcp.php, and some weird bug.

I don't have a lot of time to debug it now, but one troubleshooting solution I can provide is to erase the $perpage chunk of code, and re-generate all thumbnails in one process.

I've attached a customized albumcp.php that does just this. Be sure to rename it albumcp.php to use it. If it still doesn't work, and locks up, then there might be a problem with the actual GD-image handling functions. (although I sort of doubt it)

This is strange. I installed the hack on a windows 2000 Server running Apache and MySQL and all went fine. Now installed it on SuSe Linux and Apache and MySQL and i got the same error message after a fresh install.

Then i went straight to my ACP clicked on the member photo options and saved them once. After this my division by zero error in album.php and functions.php was gone.

I thought that could be interesting for all of you.

Cheers,

Pseudomizer

d3nnis 04-15-2004 04:36 AM

Velocd can you enhanced this mod to make it into a personals page? I also like the idea of using profile (for members own pic)

Boofo 04-15-2004 02:05 PM

Mike. I'm getting this for all the signatures:

Quote:

Last modified:
Dec 31st, 1969, 6:00 pm
Can this be fixed?

Christine 04-15-2004 06:15 PM

Hi Bob,

That field is only captured when there is a change made and it is saved - the default is 0.

You can default a date of your choice in there by running this script:

UPDATE usertextfield SET sigdateline = 'unixtimestamp'

Good thing you have that tool, aye? :p

Boofo 04-15-2004 06:46 PM

Quote:

Originally Posted by Christine
Hi Bob,

That field is only captured when there is a change made and it is saved - the default is 0.

You can default a date of your choice in there by running this script:

UPDATE usertextfield SET sigdateline = 'unixtimestamp'

Good thing you have that tool, aye? :p

That tool is nice. ;) Are you still going to make a vb page out of it? ;)

Is there a way to not have it show a last update time until it actually is updated? That would be better I think. ;)

Velocd 04-16-2004 05:36 AM

Yep, and that actually makes more sense. Will update the install.html.

In the template album_sig_list, find:

HTML Code:

<br /><br />Last modified:<br />$user[sigdate], <font class="time">$user[sigtime]</font>
Replace it with:

HTML Code:

<if condition="$user[sigdateline]"><br /><br />Last modified:<br />$user[sigdate], <font class="time">$user[sigtime]</font></if>
Quote:

Velocd can you enhanced this mod to make it into a personals page?
I'm not quite sure what you mean. :\

d3nnis 04-16-2004 05:56 AM

Quote:

Originally Posted by Velocd

I'm not quite sure what you mean. :\


Something like this :

http://www.chillicrap.com/Personals/

Velocd 04-16-2004 01:37 PM

Review the thread. I've mentioned many a times I don't plan to build add-ons for this hack.

No multiple images, no commenting system, yadda yadda.

You are free to do so yourself.

Pseudomizer 04-16-2004 02:24 PM

Hello,

i would like to know if there is anyone interested in an upgrade path from this hack for version 2.3.x to version 3.0.0 ? I have created a script to migrate all the pictures from the old hack into the new hack.

The only disadvantage will be that all comments will be cut off after 40 characters because the new entry field in the user options is limited to 40 characters which was 255 characters before.

If people are interested to migrate please respond in here. I am more then happy to help out because Velocd has done a great job with these 2 hacks.

If you are not sure which hack i am talking about here is the link to the old vb2.3.x hack: https://vborg.vbsupport.ru/showthrea...hlight=gallery

Cheers,

d3nnis 04-16-2004 02:58 PM

Quote:

Originally Posted by Velocd
Review the thread. I've mentioned many a times I don't plan to build add-ons for this hack.

No multiple images, no commenting system, yadda yadda.

You are free to do so yourself.


hehe u can do the personals... i would be glad to purchase it from you (u can make it commercial! I haven seen any personals yet... to integrate into vb3)

Boofo 04-16-2004 03:00 PM

Quote:

Originally Posted by Velocd
Yep, and that actually makes more sense. Will update the install.html.

In the template album_sig_list, find:

HTML Code:

<br /><br />Last modified:<br />$user[sigdate], <font class="time">$user[sigtime]</font>
Replace it with:

HTML Code:

<if condition="$user[sigdateline]"><br /><br />Last modified:<br />$user[sigdate], <font class="time">$user[sigtime]</font></if>

Thank you, sir. That actually looks much better. ;)

Velocd 04-17-2004 04:21 AM

Quote:

The only disadvantage will be that all comments will be cut off after 40 characters because the new entry field in the user options is limited to 40 characters which was 255 characters before.
Well, the HTML input field "maxlength" attribute does little to actually restrict the data that can be passed.

The comment field in the table customprofilepic is varchar(255), meaning it can hold up to 255 characters. I only set the INPUT maxlength value to 40, as I thought that was suitable for this hack.

Both can be changed.

Pseudomizer 04-17-2004 09:24 AM

Quote:

Originally Posted by Velocd
Well, the HTML input field "maxlength" attribute does little to actually restrict the data that can be passed.

The comment field in the table customprofilepic is varchar(255), meaning it can hold up to 255 characters. I only set the INPUT maxlength value to 40, as I thought that was suitable for this hack.

Both can be changed.

Correct. My script just cuts off every character after the 40th one. So if someone needs to go beyond the 40 characters he can just uncomment this cut function and he will have all 255 characters available assuming that he changes the input field from 40 to 255.

But no one is interested in this script so far. I am fine with the 40 characters.

Cheers,

Velocd 04-17-2004 02:37 PM

If you want, I can place the script as an attachment in the first post, so people will see it more easily.

Defiantly a good incentive for people to upgrade if they currently have the old member gallery. ;)

Pseudomizer 04-20-2004 11:03 PM

Quote:

Originally Posted by Velocd
If you want, I can place the script as an attachment in the first post, so people will see it more easily.

Defiantly a good incentive for people to upgrade if they currently have the old member gallery. ;)

Hello Velocd,

sorry for the delay but i implemented some small bugfixes into this script and made it more userfriendly with screen outputs.

I have added an installation instruction into the ZIP file how to install it and how to run it. Please note that i highly recommend all users who want to use this script to backup their existing database BEFORE they run this script.

Enjoy this script.

Cheers,

Pseudomizer 04-20-2004 11:17 PM

Hello Velocd,


PLEASE DO NOT USE THE CODE BELOW!!! This code was quick and dirty and a better version with only 1 query can be found here:
https://vborg.vbsupport.ru/showpost....0&postcount=82


i just have created another add-on for your hack. What it does ? It implements a random picture on your portal ( tested with vbindex 3.0.0 Build 5 ).

What do you have to do ? It's very simple. Here are the instructions:


Open your vbindex.php from your webroot directory and do the following:

vbindex.php:

Find:

PHP Code:

// #############################################################################
// unset vB's default template vars, do this at the end so any standard error
// or redirect calls still have the vars for use in the templates.
unset($header$footer$navbar$headinclude); 

Above add:

PHP Code:

// ############## PROCESS RANDOM PIC #######################################

$profilepic 0;

       while (
$profilepic == )
    {
       
srand ((double)microtime()*10000);
       
$randval rand(1,1000);

       
$images $DB_site->query("
        SELECT user.userid, user.username, customprofilepic.profilepicdata
        FROM "
.TABLE_PREFIX."customprofilepic
        LEFT JOIN "
.TABLE_PREFIX."user USING (userid)
        WHERE visible=1 and user.userid = 
$randval
       "
);

        
$rows $DB_site->num_rows($images);

        if (!
$rows)
        {
            
// do nothing because i assume that you have at least 1 picture in your database
        
}
        else
        {
            
$image $DB_site->fetch_array($images);
            
$output_pic "<A HREF=\"./forum/member.php?u=$randval\">$image[username]<BR><BR>";
            
$profilepic 1;
            
$output_pic .= "<img src=\"./forum/image.php?u=$randval&type=pthumb\" border=\"0\" width=\"150\" 

height=\"150\"/></A>"
;
        }
    } 

Templates:

Open vbindex_customblock_3:

Find:

PHP Code:

Block $box Content 

Replace this with:

PHP Code:

$output_pic 

Now enable your custombox_3 in your vboptions in your ACP and all set all done. Have fun !!!


P.S.: If you are using another portal software then you could adopt this script for your use. You just have to find the correct template from your portal software and insert the variable for the output.

Cheers,

FleaBag 04-22-2004 03:32 AM

Eventually got it going after having a fiddle with my database. It really is quite difficult to deal with! Thanks for this hack - keep uo the excellent work.

Boofo 04-22-2004 03:58 AM

Quote:

Originally Posted by Pseudomizer
Hello Velocd,

i just have created another add-on for your hack. What it does ? It implements a random picture on your portal ( tested with vbindex 3.0.0 Build 5 ).

What do you have to do ? It's very simple. Here are the instructions:


Open your vbindex.php from your webroot directory and do the following:

vbindex.php:

Find:

PHP Code:

// #############################################################################
// unset vB's default template vars, do this at the end so any standard error
// or redirect calls still have the vars for use in the templates.
unset($header$footer$navbar$headinclude); 

Above add:

PHP Code:

// ############## PROCESS RANDOM PIC #######################################

$profilepic 0;

       while (
$profilepic == )
    {
       
srand ((double)microtime()*10000);
       
$randval rand(1,1000);

       
$images $DB_site->query("
        SELECT user.userid, user.username, customprofilepic.profilepicdata
        FROM "
.TABLE_PREFIX."customprofilepic
        LEFT JOIN "
.TABLE_PREFIX."user USING (userid)
        WHERE visible=1 and user.userid = 
$randval
       "
);

        
$rows $DB_site->num_rows($images);

        if (!
$rows)
        {
            
// do nothing because i assume that you have at least 1 picture in your database
        
}
        else
        {
            
$image $DB_site->fetch_array($images);
            
$output_pic "<A HREF=\"./forum/member.php?u=$randval\">$image[username]<BR><BR>";
            
$profilepic 1;
            
$output_pic .= "<img src=\"./forum/image.php?u=$randval&type=pthumb\" border=\"0\" width=\"150\" 

height=\"150\"/></A>"
;
        }
    } 

Templates:

Open vbindex_customblock_3:

Find:

PHP Code:

Block $box Content 

Replace this with:

PHP Code:

$output_pic 

Now enable your custombox_3 in your vboptions in your ACP and all set all done. Have fun !!!


P.S.: If you are using another portal software then you could adopt this script for your use. You just have to find the correct template from your portal software and insert the variable for the output.

Cheers,

I tried this on vBadvanced and although it worked great the query count went through the roof on the homepage. ;)

Pseudomizer 04-22-2004 07:51 AM

Quote:

Originally Posted by Boofo
I tried this on vBadvanced and although it worked great the query count went through the roof on the homepage. ;)


Oh oh. Thanks for this hint. This was a quick and dirty implementation for a request. I did not thought about performance because i tested in on my test forum. :disappointed:

But you are right. I will change the PHP code and i will have a look into this how i could reduce it to 1 or 0 queries. :nervous:

Thanks for this hint.

Cheers,


All times are GMT. The time now is 08:31 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.02123 seconds
  • Memory Usage 1,933KB
  • 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
  • (4)bbcode_html_printable
  • (12)bbcode_php_printable
  • (19)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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