+ Reply to Thread (include dating software, release, and patch number!)
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Show profiles of a special membership in "featured" box on index page ?

  1. #1
    Kleetus
    Guest

    Default Show profiles of a special membership in "featured" box on index page ?

    ... moved from an older threat to give it the right title !

    Are there big changes necessary to show profiles (profile pics) from a special membership (let's name it "premium") next to the other featured profiles in the "featured" box on the index page ?
    I need all premium members to be randomly shown on index page, but i will still be able to set special profiles manually to "featured", which are also shown on index page.

    Any ideas ? Thanks for every reply !

  2. #2
    Kleetus
    Guest

    Default

    No ideas ? Am i wrong if i think it would be a nice mod for many others ?

  3. #3
    Kleetus
    Guest

    Default

    I'm still learning the first steps of php, so i'm not very good at this but if i look into the tmpl_dfl/scripts/index.php i have the idea to make a second db query in "function PageCompFeatured" and return 4 featured members and 4 premium ( my special membership ) members.

    Please, can anybody help me ?

  4. #4
    Kleetus
    Guest

    Default

    @Smoge: perhaps you know a way to do this ?
    Thanks !

  5. #5
    Prometheus
    Guest

    Default

    This is how you do this in ae just change it for dolphin.



    Code:
    In your index.php find
    
    $_page_cont[$_ni]['featured_members'] = PageCompFeatured($featured_vertical);
    
    Add below
    
    $_page_cont[$_ni]['featured_members2'] = PageCompFeatured2($featured_vertical);
    
    
    find and COPY this ENTIRE function
    
    
    
    /**
     * Featured members block #1 original
     */
    function PageCompFeatured($featured_vertical)
    {
    	global $site;
    	global $ID_PIC_DIR;
    	global $ID_PIC_URL;
    	global $tmpl;
    ____________________________ to the end...
    
    
    below this paste your copied function
    
    rename
    
    function PageCompFeatured($featured_vertical)
    
    to
    
    function PageCompFeatured2($featured_vertical)
    
    
    
    change this query 
    
    
    
    $featured_res = db_res( "SELECT `Profiles`.`ID`, `Pic_0_addon`, `NickName`, `LastLoggedIn`, `Headline` FROM `Profiles` WHERE `Status` = 'Active' AND `Featured` = '1' ORDER BY RAND() LIMIT $featured_page" );
    
    
    to get the criteria you are looking for.  
    
    
    In your page 1 add __featured_members2__
    
    where you want the pics to display.
    See example here.


    http://CageMe.com/index1.php

  6. #6
    Kleetus
    Guest

    Default

    Hello Prometheus, thanks for your help !
    I'm not a pro but i have tried a little bit more and got a solution that works, cause i want the "featured" and the "premium" profiles to be shown in the same box. The visitor should not see any difference !

    - I have created a new admin field
    PHP Code:
    $premium_num     getParam('premium_num');

    INSERT INTO `GlParamsVALUES ('premium_num','4',0,'Number of premium members displayed on front page','digit','return $arg0 >= 0;','must be equal to or greater than zero.',NULL); 
    (Also some changes in global_settings.php)


    - Changed the database querys like this
    PHP Code:
    if ( $feature_num || $premium_num )
        {
            
    $featured_res db_res"SELECT `Profiles`.`ID`, 
                                            `Pic_0_addon`, 
                                            `ProfileType`, 
                                            `NickName`, 
                                            `Headline`, 
                                            `Sex`, 
                                            `Sex2`, 
                                            `Country`, 
                                            `DateOfBirth`, 
                                            `DateOfBirth2` 
                                    FROM `Profiles` 
                                    WHERE `Status` = 'Active' 
                                    AND `Featured` = '1' 
                                    ORDER BY RAND() LIMIT $feature_num" 
    );
                                    
            
    $premium_res db_res"SELECT    `ProfileMemLevels`.`IDMember`, 
                                            `ProfileMemLevels`.`IDLevel`, 
                                            `Profiles`.`ID`, 
                                            `Profiles`.`NickName`, 
                                            `Profiles`.`DateOfBirth`, 
                                            `Profiles`.`ProfileType`, 
                                            `Profiles`.`Headline`,
                                            `Profiles`.`DateOfBirth`, 
                                            `Profiles`.`DateOfBirth2`, 
                                            `Profiles`.`Sex`, 
                                            `Profiles`.`Sex2`, 
                                            `Profiles`.`Country`,
                                            `Profiles`.`Pic_0_addon`
                                    FROM `ProfileMemLevels` 
                                    LEFT JOIN `Profiles` ON Profiles.ID = IDMember
                                    WHERE `Status` = 'Active' 
                                    AND `IDLevel` = '4' 
                                    ORDER BY RAND() LIMIT $premium_num"
    ); 
    (I hope this is the right way, perhaps somebody can confirm it ?)


    - And the changes for display on index page
    PHP Code:
            $ret "";
            
    $sum_featured_res mysql_num_rows$featured_res );
            
    $sum_premium_res mysql_num_rows$premium_res );
            if(( 
    $sum_featured_res $sum_premium_res ) > )
            {
            
                
    $j=1;
    ###############################################################################
                
    while( $premium_arr mysql_fetch_assoc$premium_res ) )
                {
                    if ( 
    $p_arr['ProfileType'] == "couple")
                    {
                        
    $age1_str _t("_y/o"age$premium_arr['DateOfBirth'] ));
                        
    $age2_str _t("_y/o"age$premium_arr['DateOfBirth2'] ));
                        
    $y_o_sex $age1_str ._t('_'.$premium_arr['Sex']) .'; '$age2_str ._t('_'.$premium_arr['Sex2']);
                        
    $y_o_2 $age1_str  .'/ '$age2_str ;
                        
    $sex2 _t('_'.$premium_arr['Sex']) .'/ '._t('_'.$premium_arr['Sex2']);
                    }
                    else
                    {
                        
    $age_str _t("_y/o"age$premium_arr['DateOfBirth'] ));
                        
    $y_o_sex $age_str ' ' _t("_".$premium_arr['Sex']);
                        
    $y_o_2 $age_str ;
                        
    $sex2 _t("_".$premium_arr['Sex']);
                    }    
                    
                    
    $featured_coutry _t("__".$prof['countries'][$premium_arr['Country']]);
                    
                    
                    if( 
    $j%== '0' )
                    {
                        
    $style_add 'style="border:none; left:14px; width:140px;"';
                    }
                    else
                    {
                        
    $style_add '';
                    }
                    
    $ret .= '<div class="featured_block" ' $style_add '>';
                        
    $ret .= get_member_thumbnail$premium_arr['ID'], left );
                        
                    
    $ret .= '</div>';
                    
                    
    $j++;
                }

    ###############################################################################
                
    while( $featured_arr mysql_fetch_assoc$featured_res ) )
                {
                                    if ( 
    $p_arr['ProfileType'] == "couple")
                    {
                        
    $age1_str _t("_y/o"age$featured_arr['DateOfBirth'] ));
                        
    $age2_str _t("_y/o"age$featured_arr['DateOfBirth2'] ));
                        
    $y_o_sex $age1_str ._t('_'.$featured_arr['Sex']) .'; '$age2_str ._t('_'.$featured_arr['Sex2']);
                        
    $y_o_2 $age1_str  .'/ '$age2_str ;
                        
    $sex2 _t('_'.$featured_arr['Sex']) .'/ '._t('_'.$featured_arr['Sex2']);
                    }
                    else
                    {
                        
    $age_str _t("_y/o"age$featured_arr['DateOfBirth'] ));
                        
    $y_o_sex $age_str '&nbsp;' _t("_".$featured_arr['Sex']);
                        
    $y_o_2 $age_str ;
                        
    $sex2 _t("_".$featured_arr['Sex']);
                    }    
                    
                    
    $featured_coutry _t("__".$prof['countries'][$featured_arr['Country']]);
                    
                    
                    if( 
    $j%== '0' )
                    {
                        
    $style_add 'style="border:none; left:14px; width:140px;"';
                    }
                    else
                    {
                        
    $style_add '';
                    }
                    
    $ret .= '<div class="featured_block" ' $style_add '>';
                        
    $ret .= get_member_thumbnail$featured_arr['ID'], left );
                        
                    
    $ret .= '</div>';
                    
                    
    $j++;
                }
    ###############################################################################
            
    }
            else
            {
                
    $ret .= '<div class="no_result">';
                    
    $ret .= '<div>';
                        
    $ret .= _t("_No results found");
                    
    $ret .= '</div>';
                
    $ret .= '</div>';
            }
        }
        
        return 
    DesignBoxContent_t("_featured members"), $ret$oTemplConfig -> PageCompFeatured_db_num );

    Or does anybody has got a better idea ?
    Last edited by Kleetus; 04-09-2007 at 03:49 PM.

  7. #7
    mirepup
    Guest

    Default

    I see everyone's suggestions below. Why not just set the FEATURED flag on the profile when they upgrade and remove it when they downgrade?

    Sorry - new at this, so I have no code examples.

    Quote Originally Posted by Kleetus
    ... moved from an older threat to give it the right title !

    Are there big changes necessary to show profiles (profile pics) from a special membership (let's name it "premium") next to the other featured profiles in the "featured" box on the index page ?
    I need all premium members to be randomly shown on index page, but i will still be able to set special profiles manually to "featured", which are also shown on index page.

    Any ideas ? Thanks for every reply !

  8. #8
    Kleetus
    Guest

    Default

    Quote Originally Posted by mirepup
    I see everyone's suggestions below. Why not just set the FEATURED flag on the profile when they upgrade and remove it when they downgrade?

    You mean doing it manually every time a profile level changes ?
    No way !!!!!!! That will be too much work and the possibility to make a mistake or forgot someone is to big for me.
    This way its done automatically every time a profile level changes and i'm still able to set the featured function for some.

  9. #9
    mirepup
    Guest

    Default

    Nope. I mean editing the SQL where ever it is to include updating the flag when their membership changes.

    Quote Originally Posted by Kleetus

    You mean doing it manually every time a profile level changes ?
    No way !!!!!!! That will be too much work and the possibility to make a mistake or forgot someone is to big for me.
    This way its done automatically every time a profile level changes and i'm still able to set the featured function for some.

  10. #10
    Prometheus
    Guest

    Default

    Quote Originally Posted by Kleetus

    You mean doing it manually every time a profile level changes ?
    No way !!!!!!! That will be too much work and the possibility to make a mistake or forgot someone is to big for me.
    This way its done automatically every time a profile level changes and i'm still able to set the featured function for some.

    If I knew then (when you posted) that you wanted, when the membership for a user changes, to not be listed as premium or featured and not be listed or still be listed as the case may be, I would have told you a totally different way to do what you want.

    You were only asking for one thing.....really and now you are saying you want 2 things to happen.
    List the premium with the featured and NOT have to manually get rid of them.
    If noone is going to notice the difference because they will still be "featured"
    an "no one is supposed to know they are different"



    Then do this suggestion
    Quote Originally Posted by mirepup
    I see everyone's suggestions below. Why not just set the FEATURED flag on the profile when they upgrade and remove it when they downgrade?

    Sorry - new at this, so I have no code examples.
    So then I say to you edit your query for the featured members output to include/grab your "premium" members to be selected at random and displayed with your featured members.

    Why re-invent the wheel? You have everything you need already done for you.
    Just modify the your query in your index.php

+ Reply to Thread (include dating software, release, and patch number!)
Page 1 of 2 1 2 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. How to change the number of "Members" on index page
    By rounder in forum Boonex Dolphin 7
    Replies: 2
    Last Post: 05-05-2010, 08:48 AM
  2. Replace "Quick Search" with "Browse Profiles" ????
    By Spexmex in forum Dolphin General Discussion v6.00 and above
    Replies: 0
    Last Post: 02-02-2008, 02:18 PM
  3. Replies: 0
    Last Post: 07-14-2007, 03:04 PM
  4. "Featured" link with a membership
    By Kleetus in forum General Issues, Comments, Questions
    Replies: 4
    Last Post: 03-22-2007, 06:31 AM
  5. "My profile" page will not show!
    By webbuddy in forum Bugs Dolphin v.5.5.0
    Replies: 0
    Last Post: 03-12-2007, 11:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts