1

Topic: Hard Cover Release: Random profile (2.2.1)

Hello!

If you can install regular extensions there won't be a problem to install this.

1. Download
2. Extract and place .php file into ext folder and .tpl into template folder.
3. Try to use it. Modify .tpl file to suite your design needs.
4. Use it. Most of parameters are standard (open .php file). One of them - region (region="Canada") you can use for displaying definite country.

Enjoy using it!

Last edited by radioact (2007-11-26 09:37:24)

www.vldMagic.com - first choice customizations help desk
www.vldCrowd.com/radioact - my profile at vldCrowd

2

Re: Hard Cover Release: Random profile (2.2.1)

Hello Radioact,
Can you please show me how to use this extension? I uploaded .php file and .tpl file to the server but nothing happen. Do I have to modify anything else to get it work on front page? I want to show random members on front page as well as member's page.

Thank.s

Life is short, try to do something good!
Gay Online - Black Singles

3

Re: Hard Cover Release: Random profile (2.2.1)

Hello tadisaus2
Try to put this tag on the header.tpl file where you want it to display  {random_profile:}

If you want to show it for guests and logged in members, be shure it is on the right place between those IF LOGGEDIN tags.

kalluu

4

Re: Hard Cover Release: Random profile (2.2.1)

Thanks Kalluu.
It worked.

Life is short, try to do something good!
Gay Online - Black Singles

5

Re: Hard Cover Release: Random profile (2.2.1)

Hi

Is there any way to increase the number of random pictures. I tried this:

{random_profile:4}

and this:

{random_profile:limit=4}

but neither worked. It still only displays one image.

thanks

6

Re: Hard Cover Release: Random profile (2.2.1)

Hello! I looked at the .php file and found that you should use 'members' instead.

{random_profile:members=4}

www.vldMagic.com - first choice customizations help desk
www.vldCrowd.com/radioact - my profile at vldCrowd

7

Re: Hard Cover Release: Random profile (2.2.1)

thank you

8

Re: Hard Cover Release: Random profile (2.2.1)

Hi is there a way to only view members that are online only in random profile?

9

Re: Hard Cover Release: Random profile (2.2.1)

Hello! Try new modification of ext using 'online=1' parameter.
Download ext2

www.vldMagic.com - first choice customizations help desk
www.vldCrowd.com/radioact - my profile at vldCrowd

10

Re: Hard Cover Release: Random profile (2.2.1)

Thats Great !

What if Iwanted to have on top of online picture  "icon + user is on line in Green"

How would I do that please ?

11

Re: Hard Cover Release: Random profile (2.2.1)

It only allows me to have 1 online member at a time -

{random_profile:online=1} I changed online =1 to online=4  however it still does not allow me to have 4 listed at a time when members r online -

Is there a way to enable 4 members at atimeor even 8 members who r online to be visible on my header.tpl  ?

12

Re: Hard Cover Release: Random profile (2.2.1)

online parameter is boolean (Yes or No - True or False - 1 or 0) that's why you can only set 1 or 0.
For quantity of members to select use 'members=4' parameter.

If you see the source code of php file you can see how it works and if you want the Icon near to screenname - modify .php and .tpl files to do it.

www.vldMagic.com - first choice customizations help desk
www.vldCrowd.com/radioact - my profile at vldCrowd

13

Re: Hard Cover Release: Random profile (2.2.1)

(online parameter is boolean (Yes or No - True or False - 1 or 0) that's why you can only set 1 or 0.
For quantity of members to select use 'members=4' parameter. )

Hello radioact,

R you saying I cannot have 4 or more members online showing, I can only have 1 showing at a time?
I have used 'members=4' parameter however it does not show members who are online -

14

Re: Hard Cover Release: Random profile (2.2.1)

newcastle wrote:

R you saying I cannot have 4 or more members online showing, I can only have 1 showing at a time?
I have used 'members=4' parameter however it does not show members who are online -

big_smile
use members=10, online=1
You'll see ten online members.

members could be what ever you want (1-100 and more) online could be '1'


Good luck.

www.vldMagic.com - first choice customizations help desk
www.vldCrowd.com/radioact - my profile at vldCrowd

15

Re: Hard Cover Release: Random profile (2.2.1)

Thanks for that radioact .

2 other questions !

1.  The above works however if a member who is online that has 3 pictures in there profile , those pictures will also be dissplayed as online instead of just 1 picture.

How would I correct that please ?

2.  When a member goes off line the system still says the member is still online for around 7 min later .
     Is there somewhere in the system I could alter the online time when member is logged off the system ?

Your help would be great .

16

Re: Hard Cover Release: Random profile (2.2.1)

1. Have you tried this? May be beautiful lady just have 3 high rated pictures since she is beautiful?!
2. You can set that value in Control panel. User inactivity period to treat him as offline. Also it could be of caching the results of extension for some time. And I think that 7 minute delay is not very important.

www.vldMagic.com - first choice customizations help desk
www.vldCrowd.com/radioact - my profile at vldCrowd

17

Re: Hard Cover Release: Random profile (2.2.1)

Hello Radioact,

You can set that value in Control panel. User inactivity period to treat him as offline. (Has worked thankyou)
High rated pictures. Is there any way of getting around this as I only want i picture per online member to be showing on my front page  ?

18

Re: Hard Cover Release: Random profile (2.2.1)

Have you looked at Top rated profiles extension? Though it selects top rated pictures regardless of their online status.

www.vldMagic.com - first choice customizations help desk
www.vldCrowd.com/radioact - my profile at vldCrowd

19

Re: Hard Cover Release: Random profile (2.2.1)

I am not sure where Top rated Profiles are in admin -

Please help

20

Re: Hard Cover Release: Random profile (2.2.1)

It's just a user contributed code.

Here

www.vldMagic.com - first choice customizations help desk
www.vldCrowd.com/radioact - my profile at vldCrowd

21

Re: Hard Cover Release: Random profile (2.2.1)

I have uploaded files and it works ,

Thankyou  smile and smile

22

Re: Hard Cover Release: Random profile (2.2.1)

Hello Radioact,

Below is in header template.
{random_profile:members=8,online=1}

Below is ext.random_profile.php file .

Is there a way to only have 1 pic per person online .
At the moment I am seeing 3 to 5 picture per person that comes online. ( That is if they have uploaded 3 to 5 picture to there account.



<?php

$data = array(
    'name' => 'Show random profile',
    'about' => 'This extension allows you to display radnom profiles on your website.',
    'author' => 'Radioact',
    'email' => 'ramil@zhunussov.com',
    'help' => 'NA',
    'website' => 'http://www.mahabbat.kz',
);

function vldext_random_profile ($params = array())
{
    global $DB, $SESSION, $CACHE, $PREFS,$TEMPLATE;

    $members = isset($params['members']) && $params['members'] ? intval($params['members']) : 1;
    $cachetime = isset($params['cachetime']) && $params['cachetime'] ? intval($params['cachetime']) : 1;
    $gender = isset($params['gender']) && $params['gender'] ? $params['gender'] : '';
    $adult = isset($params['adult']) && $params['adult'] ? intval($params['adult']) : 0;
    $online = isset($params['online']) && $params['online'] ? 1 : 0;
    $region = isset($params['region']) ? $params['region'] : '';
      $fields = isset($fields)? $fields:'';

    //------------------------------------------------
    // Get member
    //------------------------------------------------

    if ( ($fields = $CACHE->get("ext", "randomprofile". $gender .$members.$region.$adult)) === false ) {
    $result = $DB->query("SELECT p.member_id, p.filename, m.username, m.screenname, d.field_5, d.field_6
    FROM " . DB_PREFIX . "pictures as p, " . DB_PREFIX . "members_data as d, " . DB_PREFIX . "members as m
    WHERE d.data_id=p.member_id AND d.data_id=m.member_id
    AND p.active='1'
    AND p.adult='" . ($adult ? 1 : 0) . "' " . ($gender ? " AND d.field_1='" . mysql_real_escape_string($gender) . "'" : ""). ($region ? "
    AND d.field_4='" . mysql_real_escape_string($region) . "'" : "") . "
    " . ($online ? "AND m.lastvisit > " . ( time() - $PREFS->conf['user_timeout']*60 ) : "") . "
    ORDER BY RAND() LIMIT $members");


    //------------------------------------------------
    // Check if resultset contains any rows
    //------------------------------------------------
    if ($DB->num_rows($result))
    {
        //------------------------------------------------
        // Fetch resultset
        //------------------------------------------------
       $i = 0;
            while($obj = $DB->fetch_object($result)) {


        //------------------------------------------------
        // Display image tag
        //------------------------------------------------
        $fields[$i]['member_id']   = $obj->member_id;
        $fields[$i]['screenname']  = htmlentities2utf8($obj->screenname);
        $fields[$i]['city'] = $obj->field_5 ? $obj->field_5 : '';
        $fields[$i]['picture']     = $obj->filename ? $PREFS->conf['thumbnail_prefix'] . 'picture_' . $obj->filename : "";
        $fields[$i]['member_link'] = $PREFS->conf['fancy_urls'] ? ($PREFS->conf['fancy_homepages'] ? $obj->username : "member/".$obj->member_id."/index.html") : "index.php?m=member&p=profile&id=" . $obj->member_id;
        $fields[$i]['member_title'] = htmlentities2utf8($obj->field_6);
                $i++;
        }
     }

        $CACHE->put("ext", "randomprofile". $gender .$members.$region.$adult, $cachetime, $fields);
  }
        $TEMPLATE->assign("randomprofile", $fields);

    $TEMPLATE->output('ext.random_profile.tpl');

    //------------------------------------------------
    // Clean up
    //------------------------------------------------
    unset($result);
    unset($obj);

}

?>

Last edited by newcastle (2007-10-30 05:51:18)

23

Re: Hard Cover Release: Random profile (2.2.1)

I edited my post too. It's a good question, let me think a little.

Last edited by radioact (2007-10-30 06:05:28)

www.vldMagic.com - first choice customizations help desk
www.vldCrowd.com/radioact - my profile at vldCrowd

24

Re: Hard Cover Release: Random profile (2.2.1)

Well. Add after

AND p.active='1'

this:

AND p.main='1'

Ext will select only main pictures and it means that as result will be non-repeating profiles.

Don't forget about 1 minute caching checking results after editing your file.

www.vldMagic.com - first choice customizations help desk
www.vldCrowd.com/radioact - my profile at vldCrowd

25

Re: Hard Cover Release: Random profile (2.2.1)

Hello radioact,

Problem fixed thankyou for your help and have a nice day smile