PDA

View Full Version : vBulletin 3 Request - Looking for Image Upload for Users


DCD.RB
06-29-2018, 10:15 PM
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/showthread.php?t=141174&highlight=Profile+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 1530326939 at 1530326939 ---------------


I tried this one:
https://vborg.vbsupport.ru/showthread.php?t=141174&highlight=Profile+Gallery


I got this one to work by adding this line to the input code:
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />

But the images show on the profile, I believe using this hook:
<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/showthread.php?t=172215&highlight=all+albums