quick suggestion for members, gallery inside profile view
« on: February 13, 2015, 06:46:25 PM »
to save on the amount of clicks why not move your gallery inside profile view

*

Pharg

  • *****
  • 2,065
  • osDate Version: osDate Evo v1.0
Re: quick suggestion for members, gallery inside profile view
« Reply #1 on: February 13, 2015, 09:28:48 PM »
to save on the amount of clicks why not move your gallery inside profile view
Hi mnarkyp77,

Have you already done this or is the a request to change it?
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

Re: quick suggestion for members, gallery inside profile view
« Reply #2 on: February 18, 2015, 08:01:15 PM »
already done but not working so i have changed back at present, do you know a way? i am having problems with it effecting the links within profile view thanks, and the gallery stopped working on mobile too.
« Last Edit: February 18, 2015, 10:06:51 PM by Pharg »

*

Pharg

  • *****
  • 2,065
  • osDate Version: osDate Evo v1.0
Re: quick suggestion for members, gallery inside profile view
« Reply #3 on: February 18, 2015, 09:30:16 PM »
already done but not working so i have changed back at present, do you know a way? i am having problems with it effecting the links within profile view thanks, and the gallery stopped sliding on mobile too.

Hi mnarkyp77,

Did you copy the code from the userpicgallery.php into the showprofile.php in order to make the gallery work?
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

Re: quick suggestion for members, gallery inside profile view
« Reply #4 on: February 18, 2015, 09:37:45 PM »
Hi Pharg yes, the below code..

Code: [Select]
    /** User Gallery Started **/



//echo 'Userid :-'.$userid.'--------- Username :-'.$_GET['username'];



$type='gallery';



$username = $_GET['username'];



if($userid != '' && $username != ''){



$search=' and  album_id > 0 ';



$useralbums = $osDB->getAll('select id, name, passwd from ! where username = ? ', array(USERALBUMS_TABLE, $username) );



if (count($useralbums) > 0) {



foreach ($useralbums as $k => $row) {

if ($row['passwd'] != '') {

$useralbums[$k]['password']='';

}

}



$useralbums = array_merge(array(array('id'=>'999','name'=>'Public')), $useralbums);



}



$t->assign('type',$type);



$album_passwd = isset($_REQUEST['album_passwd'])?$_REQUEST['album_passwd']:'';



if ($type == 'gallery') {

$album_id = isset($_REQUEST['album_id'])?$_REQUEST['album_id']:'999';

}



if (isset($album_id) && $album_id != '') {



/* First check if the user opted to allow membrs in the buddy list to view */



$buddy_view = $osDB->getOne('select choice_value from ! where userid=? and choice_name=?', array(USER_CHOICES_TABLE, $userid, 'allow_buddy_view_album') );



$hotlist_view = $osDB->getOne('select choice_value from ! where userid=? and choice_name=?', array(USER_CHOICES_TABLE, $userid, 'allow_hotlist_view_album') );



$in_buddy_list = $in_hot_list = 0;



if (!isset($buddy_view) || $buddy_view == '1' || $buddy_view == ''  ) {



$in_buddy_list = $osDB->getOne('select count(*) from ! where userid = ? and ref_userid = ? and act = ?', array(BUDDY_BAN_TABLE, $userid, $_SESSION['UserId'], 'F') );



}



if (!isset($hotlist_view) || $hotlist_view == '1' || $hotlist_view == '' ) {



$in_hot_list = $osDB->getOne('select count(*) from ! where userid = ? and ref_userid = ? and act = ?', array(BUDDY_BAN_TABLE, $userid, $_SESSION['UserId'], 'H') );



}



$albumpasswd=0;

if (count($useralbums) > 1) {

/*  There are private albums too..  */

$albums = array();

foreach ($useralbums as $row) {

if ($row['id'] == '999') {

$albums[] = $row;

} elseif ( ($in_buddy_list > 0 )||$userid == $_SESSION['UserId'] ) {

/*if ($row['passwd'] != '') $albumpasswd++;*/

$albums[] = $row;

}



}



$t->assign('useralbums', $albums);

unset($useralbums, $albums);

} else {

$t->assign('useralbums', $useralbums);

unset($useralbums);

}

$t->assign('albumpasswd', $albumpasswd);

}



if ($type == 'gallery') {

$t->assign('pics',$osDB->getAll('select picno, pic_descr from ! where userid = ? and album_id =?',array( USER_SNAP_TABLE, $userid, $album_id) ));

} else {

$t->assign('pics',$osDB->getAll('select picno, pic_descr from ! where userid = ? '.$search,array( USER_SNAP_TABLE, $userid)) );

}



$t->assign('username',$username);



$t->assign('userid',$userid);



if (isset($err) ) {

$t->assign('error_message', get_lang('errormsgs',$err));



$t->assign('err',$err);

}

if (isset($album_id)) $t->assign('album_id', $album_id);

}



/** User Gallery Ends **/
« Last Edit: February 18, 2015, 09:45:26 PM by Pharg »

*

Pharg

  • *****
  • 2,065
  • osDate Version: osDate Evo v1.0
Re: quick suggestion for members, gallery inside profile view
« Reply #5 on: February 18, 2015, 09:48:00 PM »
Hi

That doesn't seem to be enogh code, what I see is

Code: [Select]
$type='profilepics';

if (isset($_REQUEST['type']) && $_REQUEST['type'] == 'gallery') {
$type=$_REQUEST['type'];
}

$userid = isset($_REQUEST['id'])?$_REQUEST['id']:(isset($_SESSION['UserId'])?$_SESSION['UserId']:'');

$username = $osDB->getOne('select username from ! where id = ?',array( USER_TABLE, $userid) );

if ($type == 'profilepics') {
$search=' and (album_id is null or album_id = 0)';
} else {
$search=' and  album_id > 0 ';

$useralbums = $osDB->getAll('select id, name, passwd from ! where username = ? ', array(USERALBUMS_TABLE, $username) );

if (count($useralbums) > 0) {

foreach ($useralbums as $k => $row) {
if ($row['passwd'] != '') {
$useralbums[$k]['password']='';
}
}

$useralbums = array_merge(array(array('id'=>'999','name'=>'Public')), $useralbums);

}
}

$t->assign('type',$type);

$album_passwd = isset($_REQUEST['album_passwd'])?$_REQUEST['album_passwd']:'';

if ($type == 'gallery') {
$album_id = isset($_REQUEST['album_id'])?$_REQUEST['album_id']:'999';
}

if (isset($album_id) && $album_id != '') {

/* First check if the user opted to allow membrs in the buddy list to view */

$buddy_view = $osDB->getOne('select choice_value from ! where userid=? and choice_name=?', array(USER_CHOICES_TABLE, $userid, 'allow_buddy_view_album') );

$hotlist_view = $osDB->getOne('select choice_value from ! where userid=? and choice_name=?', array(USER_CHOICES_TABLE, $userid, 'allow_hotlist_view_album') );

$in_buddy_list = $in_hot_list = 0;

if (!isset($buddy_view) || $buddy_view == '1' || $buddy_view == ''  ) {

$in_buddy_list = $osDB->getOne('select count(*) from ! where userid = ? and ref_userid = ? and act = ?', array(BUDDY_BAN_TABLE, $userid, $_SESSION['UserId'], 'F') );

}

if (!isset($hotlist_view) || $hotlist_view == '1' || $hotlist_view == '' ) {

$in_hot_list = $osDB->getOne('select count(*) from ! where userid = ? and ref_userid = ? and act = ?', array(BUDDY_BAN_TABLE, $userid, $_SESSION['UserId'], 'H') );

}

$albumpasswd=0;
if (count($useralbums) > 1) {
/*  There are private albums too..  */
$albums = array();
foreach ($useralbums as $row) {
if ($row['id'] == '999') {
$albums[] = $row;
} elseif ( (isset($buddy_view) && $buddy_view == '1' && $in_buddy_list > 0 ) ||  (isset($hotlist_view) && $hotlist_view == '1' && $in_hot_list > 0 ) || $userid == $_SESSION['UserId'] ) {
if ($row['passwd'] != '') $albumpasswd++;
$albums[] = $row;
}
}

$t->assign('useralbums', $albums);
unset($useralbums, $albums);
} else {
$t->assign('useralbums', $useralbums);
unset($useralbums);
}
$t->assign('albumpasswd', $albumpasswd);
}

if ($type == 'gallery') {
$t->assign('pics',$osDB->getAll('select picno, pic_descr from ! where userid = ? and album_id =?',array( USER_SNAP_TABLE, $userid, $album_id) ));
} else {
$t->assign('pics',$osDB->getAll('select picno, pic_descr from ! where userid = ? '.$search,array( USER_SNAP_TABLE, $userid)) );
}

$t->assign('username',$username);

$t->assign('userid',$userid);

if (isset($err) ) {
$t->assign('error_message', get_lang('errormsgs',$err));

$t->assign('err',$err);
}
if (isset($album_id)) $t->assign('album_id', $album_id);

$t->assign('lang',$lang);

if ( $config['use_profilepopups'] == 'Y' ) {

$t->display( 'userpicgallery.tpl' );

How did you inculde the gallery into the profile page?

Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

Re: quick suggestion for members, gallery inside profile view
« Reply #6 on: February 18, 2015, 10:07:10 PM »
i have attached the showprofile pleae take a look,

*

Pharg

  • *****
  • 2,065
  • osDate Version: osDate Evo v1.0
Re: quick suggestion for members, gallery inside profile view
« Reply #7 on: February 18, 2015, 10:21:28 PM »
Hi mnarkyp77,

What did you add to the nickpage.tpl for the gallery to try and work?
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

Re: quick suggestion for members, gallery inside profile view
« Reply #8 on: February 18, 2015, 10:29:19 PM »
hi, i have attached a copy just quicker this way remove once downloaded thanks
« Last Edit: February 18, 2015, 10:31:37 PM by Pharg »

*

Pharg

  • *****
  • 2,065
  • osDate Version: osDate Evo v1.0
Re: quick suggestion for members, gallery inside profile view
« Reply #9 on: February 18, 2015, 10:46:28 PM »
Hi mnarkyp77,

This is what I get in the profile but I changed the showprofile.php

I just added the showprofile.php but haven't tested to much but seems ok to use.
I quickly tested it in my new osdate that I am testing currently using PHP 5.5.20  8)
« Last Edit: February 18, 2015, 11:04:11 PM by Pharg »
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

Re: quick suggestion for members, gallery inside profile view
« Reply #10 on: February 18, 2015, 11:08:42 PM »
on yours its showing profile pictures

*

Pharg

  • *****
  • 2,065
  • osDate Version: osDate Evo v1.0
Re: quick suggestion for members, gallery inside profile view
« Reply #11 on: February 18, 2015, 11:16:01 PM »
on yours its showing profile pictures

Yes it is, is yours not working?
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

Re: quick suggestion for members, gallery inside profile view
« Reply #12 on: February 18, 2015, 11:24:30 PM »
yeah but i want gallery showing not profile pics ;)

*

Pharg

  • *****
  • 2,065
  • osDate Version: osDate Evo v1.0
Re: quick suggestion for members, gallery inside profile view
« Reply #13 on: February 18, 2015, 11:35:46 PM »
Yes I know, I did say I quickly tested it lol I will have a better look later on when I have more time :)
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35

*

Pharg

  • *****
  • 2,065
  • osDate Version: osDate Evo v1.0
Re: quick suggestion for members, gallery inside profile view
« Reply #14 on: February 19, 2015, 12:49:42 AM »
yeah but i want gallery showing not profile pics ;)

Hi mnarkyp77,

As you can see in the photo attached that I have sorted it out for you :)

I have added the files needed to make this work.

Make Sure You Backup First as If you have other mods on these pages will be lost!!

Then Upload them all.

That's it all done.
Regards,
Pharg ( Phill )

REMEMBER: ALWAYS BACKUP BEFORE YOU MAKE ANY CHANGES!!

osDateEvo v1.0 | PHP: 5.3.42 & PHP: 5.6.18 | MySQL: 5.5.35