vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   vBulletin 3 Request - Looking for Image Upload for Users (https://vborg.vbsupport.ru/showthread.php?t=326521)

DCD.RB 06-29-2018 10:15 PM

vBulletin 3 Request - Looking for Image Upload for Users
 
Hi,
I'm looking for a way for users to upload images to the server, and they're private to their accounts.

Example, if they were to upload 1-5 images (limit would set based on usergroup), it would upload to: /forum root/images/useruploads/USERID/Pics####.jpg/png/gif

Whether the images display somewhere; profile, usercp, etc
Is not important, but would be nice.

Does something like this already exist?

I tried this one:
https://vborg.vbsupport.ru/showthrea...rofile+Gallery

But it's not working properly.

Max Taxable 06-29-2018 10:46 PM

<a href="https://vborg.vbsupport.ru/showthread.php?t=307803" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=307803</a>

DCD.RB 06-29-2018 10:50 PM

I don't think that's what I'm looking for. That seems to upload images for posts.

I'm looking for something like Profile Pictures, but allowing more than 1.

--------------- Added [DATE]1530326939[/DATE] at [TIME]1530326939[/TIME] ---------------

Quote:

Originally Posted by DCD.RB (Post 2595334)

I got this one to work by adding this line to the input code:
Code:

<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
But the images show on the profile, I believe using this hook:
Code:

        <plugin active="1">
                        <title>Profile Gallery</title>
                        <hookname>member_complete</hookname>
                        <phpcode><![CDATA[$vbulletin->input->clean_array_gpc('g', array(
        'page' => TYPE_UINT,
        'pp' => TYPE_UINT
));

$profilegallery_filecount = $db->query_first("
        SELECT COUNT(*) AS cnt
        FROM " . TABLE_PREFIX . "pg_profile_gallery
        WHERE userid = " . intval($userinfo['userid']) . "
");

$profilegallery_total_rows = intval($profilegallery_filecount['cnt']);

$db->free_result($profilegallery_filecount);

$profilegallery_cntbits = 0;
$profilegallery_picbits = '';
$profilegallery_piclist = '';

if ($profilegallery_total_rows > 0)
{
        $profilegallery_page_num = $vbulletin->GPC['page'];
        $profilegallery_per_page = $vbulletin->GPC['pp'];
        $profilegallery_tdwidth = intval(100 / 5);

        sanitize_pageresults($profilegallery_total_rows, $profilegallery_page_num, $profilegallery_per_page, 10, 10);
        $profilegallery_lower_limit = max(0, ($profilegallery_page_num - 1) * $profilegallery_per_page);
        $profilegallery_sort_url = 'member.php?' . $vbulletin->session->vars['sessionurl'] . 'u=' . $userinfo['userid'] . '&amp;pp=' . $profilegallery_per_page;
        $profilegallery_pagenav = construct_page_nav($profilegallery_page_num, $profilegallery_per_page, $profilegallery_total_rows, $profilegallery_sort_url, '');
        $profilegallery_show['pagenav'] = ($profilegallery_total_rows > $profilegallery_max_page) ? 1 : 0;

        require_once(DIR . '/includes/adminfunctions.php');

        $profilegallery_canadmin = 0;
        if (can_administer('canadminusers'))
        {
                $profilegallery_canadmin = 1;
        }

        $profilegallery_fileinfos = $db->query_read("
                SELECT fileid, filename
                FROM " . TABLE_PREFIX . "pg_profile_gallery
                WHERE userid = " . intval($userinfo['userid']) . "
                ORDER BY dateline DESC
                LIMIT $profilegallery_lower_limit, $profilegallery_per_page
        ");

        while ($profilegallery_fileinfo = $db->fetch_array($profilegallery_fileinfos))
        {
                $profilegallery_cntbits ++;

                $profilegallery_filelocation = './images/profilegallery/' . $userinfo['userid'] . '/' . $profilegallery_fileinfo['filename'];
                $profilegallery_filespecs = getimagesize($profilegallery_filelocation);
                $profilegallery_thumbwidth = ($profilegallery_filespecs[0] > 100) ? 100 : $profilegallery_filespecs[0];

                $profilegallery_fileinfo['filename'] = urlencode($profilegallery_fileinfo['filename']);

                eval('$profilegallery_picbits .= "' . fetch_template('profilegallery_picbit') . '";');

                if ($profilegallery_cntbits % 5 == 0)
                {
                        $profilegallery_picbits .= '</tr><tr>';
                }
        }

        $db->free_result($profilegallery_fileinfos);

        $profilegallery_picbits = eregi_replace(preg_quote('</tr><tr>') . '$', '', $profilegallery_picbits);

        while ($profilegallery_cntbits % 5 != 0)
        {
                $profilegallery_picbits.= '<td class="alt2" align="center" width="' . $profilegallery_tdwidth . '%">&nbsp;</td>';
                $profilegallery_cntbits ++;
        }

        $vbulletin->templatecache['MEMBERINFO'] = str_replace(
                '$navbar',
                '$navbar
                $profilegallery_piclist',
                $vbulletin->templatecache['MEMBERINFO']
        );

        eval('$profilegallery_piclist = "' . fetch_template('profilegallery_piclist') . '";');
}]]></phpcode>

I'd like it moved somewhere in User CP, specifically the Profile Picture part, if not though I'm up for anywhere in User CP.

blind-eddie 07-22-2018 04:43 PM

Enhance what is built in.
https://vborg.vbsupport.ru/showthrea...ght=all+albums


All times are GMT. The time now is 11:58 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.01039 seconds
  • Memory Usage 1,731KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete