Quantcast
Viewing all articles
Browse latest Browse all 16

Move all Members Without Profile Avatar to a new No photo Member Group

First and foremost I would like to thank our “Super Jedi Master Member” Radioact for creating the new function.

This tutorial is the result of a team effort by:
radioact and seeme101

this tutorial has 3 parts

Part I (completed) for vld Version 2.5.3
Move all Members Without Profile Avatar to a new No photo Member Group

Part II (work in progress)
How to send newsletters
Send the new No photo group a reminder message asking them to upload a photo, Using the built in newsletter feature.

Part III (work in progress)
How do I move members that have uploaded a photo to the regular member Group



*****Note: this is kind-of advanced and you should know a little about editing PHP and HTML****

This tutorial will show you how to create a new Member Group called “No Photo” and create a new function called “No Photo Move” in the control panel to automatically move all members without a Profile avatar to a new “No Photo Group”.

Step 1 - Create your New Group
In your control panel
[Settings]---» under the “Quick jump” menu --- » [Member Groups]
under “Options” [Add group]
Name---» name of your new Group (example: No Photo)
Duplicate group ---» select the group to duplicate (example: Regular members)

[Submit]


Step 2 - Get the new Group ID number
[Member Groups] you will see all your Groups and ID numbers
the ID number for MY new No photo group is 7 (remember this number you will need it later)

Note: your new Group ID number may be different if you added more Groups than the default 6 groups


Step 3 – Add new function switch
Open your 'cp.members.php' located in your 'includes/cp' folder.
Look for this comment:

//------------------------------------------------
// Select either one of the functions
//------------------------------------------------

Insert your new switch below the show_members switch:

        case "nophoto":

        no_photo_move($page);
        break;

Note: if your 'cp.members.php file is unchanged, your new switch  will be on line 86

***Special note***
Ensure your new switch is WITHIN the closing bracket “}”


Step 4 -  Add move member link in control panel
Look for this function comment:

//------------------------------------------------
// Show members
//------------------------------------------------

Note: if your 'cp.members.php is unchanged, you will find this function around line 1503

Now that you've located the show members function, Insert your new move members link:
below the add member link and above the filters link
insert:

array ( 'optimg' => "export.gif", 'optlink' => "<a class=\"opt\" href=\"#\" onclick=\"javascript:confirmLink('Move members without photo to No photo group?', '" . VIR_CP_PATH . "index.php?m=members&p=nophoto&page=$page')\">No photo move</a>"),

Note: if your 'cp.members.php is unchanged, your new link will be on line 1536


Step 5 – add the new function code to your
download the new function here
open your 'cp.members.php' located in your 'includes/cp' folder.
Insert the downloaded code snippet to the bottom of your 'cp.members.php'file:

***Special Note***
1 - when selecting members to move the new function WILL NOT include members already in no photo group, canceled members, pending members AND Admin group (1) supposing that admins group has default ID 1
2 - The above code download IS NOT a replacement for your current 'cp.members.php' file
but an addition to your current 'cp.members.php' file
3 - Ensure you insert the new function code WITHIN the closing php sytax “?>”


Step 6 - insert your new Group ID number to your new function
remember your “No Photo” group ID number from step 2? (my ID number is 7)
insert your new “No Photo” group ID number to the new function downloaded code:
where as:
$no_photo_group_id = 3

change the value 3 to --->  7

now my line in the code is:

$no_photo_group_id = 7

Step 7 - Add function completed message 
Open your 'lang.cp.members.php' located in your 'includes/languages/your_language' folder.
Insert:

"no_photo_members_moved" =>
"%1% members with no photo moved.",

Step 8  - Test your new function
in the Control Panel
[Members] ---»  under the "Options" menu ---»  [no photo move]
Move members without photo to no photo group?
[OK]

completed message:
23 members with no photo moved

We are done

Now you can automatically move all members that have not uploaded a Profile Avatar photo to a new
“No Photo Group”. 



One last thing
As a rule.
Always, always, always, download and save a good (current up-to-date) working copy of your live site on your local drive. This way you always have a good working copy to revert to if something goes wrong with any mods and/ or changes you make.


*****Note: this is kind-of advanced and you should know a little about editing PHP and HTML****

***Please post any questions about this tutorial in the Design and Customization Forum***


Viewing all articles
Browse latest Browse all 16

Trending Articles