-
Author
-
February 21, 2015 at 16:30 #46978adamdale1Participant
Sweetdate, Excellent theme & well documented! Spent the last three months working on coding. Been on a steep learning curve, never touched PHP till now. I have three (3) questions.
May have been asked before in the forum, but can’t find any reference to it!
I’ve created another gender “Couple”, with new .png, searched for, modified and created new code.The whole site is working well, except for the Home page(front page)
Total members =3, consisting of Woman = 1, Man =1 & Couple =1, but in the display you see it displays Couples online 3. see attachment
I modified bp-functions with the following code:$sex_type = array(__(‘Man’, ‘kleo_framework’), __(‘Woman’, ‘kleo_framework’), __(‘Couple’, ‘kleo_framework’));
case ‘couples_online’:
$image = ($image == ”)? get_template_directory_uri().’/assets/images/icons/steps/status_05.png’ : $image;
$number = bp_get_total_member_count(“Couple”);
break;1st Question? Is the above code correct to work? From what I’ve picked up it is or have I’ve missed something?
if ($type == ‘Man’) {
$image = ($image == ”)? get_template_directory_uri().’/assets/images/icons/steps/status_04.png’ : $image;
} elseif($type == ‘Woman’) {
$image = ($image == ”)? get_template_directory_uri().’/assets/images/icons/steps/status_03.png’ : $image;
} else {
$image = ($image == ”)? get_template_directory_uri().’/assets/images/icons/steps/status_05.png’ : $image;
}
2nd Question follwing ?? Correct? Or does else require else($type == ‘Couple’)
above?I added the following function.
if (!function_exists(‘kleo_couples_online’)) {
function kleo_couples_online( $atts, $content = null ) {
$field = ”;
extract(shortcode_atts(array(
‘field’ => ‘Couple’,
), $atts));
return bp_get_online_users($field);
}
add_shortcode(‘kleo_couples_online’, ‘kleo_couples_online’);
}3rd, I’ve been through all the code and found one item where I added a section, but now can’t find it again, all I remember was that it set the display to zero for couples online with >0<, any help to get front page up and going would be greatly appreciated, for then the site will be completed. I can’t continue until this is rectified! And I’m sure that there are many others that your response could help too.
February 22, 2015 at 00:15 #47035adamdale1ParticipantThank you, for the replies, look like I just needed that break from looking at the code, when I came back to it, I found the problem, fixed it & tested it, it all works, now I know I can add as many genders(sexes) as I want and have it working!
February 22, 2015 at 06:20 #47072LauraModeratorGlad you solved it!
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
March 2, 2015 at 09:20 #48328DarkarcherParticipantWas wondering if you could share how you resolved your issue? Would be greatly appreciated.
March 21, 2015 at 04:16 #51021subwolfParticipanthi i would like to know as well created another gender “Couple”, with new .png how ??on homepage
Attachments:
You must be logged in to view attached files.March 21, 2015 at 14:19 #51033adamdale1ParticipantIn reply to darkarcher & subwolf, be careful how you use “Couple” is the gender and “couple” used in code!
Added the “Couple” to the ‘’Iam a’ under the wp-admin, Users, Profile Fields!
Created a new icon ‘status_05.png’ and stored it in /assets/images/icons/steps/status_05.png,
In line 210
$sex_type = array(__(‘Man’, ‘kleo_framework’), __(‘Woman’, ‘kleo_framework’));
changed to
$sex_type = array(__(‘Man’, ‘kleo_framework’), __(‘Woman’, ‘kleo_framework’), __(‘Couple’, ‘kleo_framework’));then again in line 238
learnt about the if/else/else php command and searched for “Woman”in bp-function
At line 1340 addedcase ‘couples_online’:
$image = ($image == ”)? get_template_directory_uri().’/assets/images/icons/steps/status_05.png’ : $image;
$number = bp_get_online_users(“Couple”);
break;@ 1343 added function
if (!function_exists(‘kleo_couples_online’)) {
function kleo_couples_online( $atts, $content = null ) {
$field = ”;
extract(shortcode_atts(array(
‘field’ => ‘Couple’,
), $atts));
return bp_get_online_users($field);
}
add_shortcode(‘kleo_couples_online’, ‘kleo_couples_online’);
}@ 1344 added the following to tie it into sweetdate
default:
if ($type == ‘Man’) {
$image = ($image == ”)? get_template_directory_uri().’/assets/images/icons/steps/status_04.png’ : $image;
} elseif($type == ‘Woman’) {
$image = ($image == ”)? get_template_directory_uri().’/assets/images/icons/steps/status_03.png’ : $image;
} else {
$image = ($image == ”)? get_template_directory_uri().’/assets/images/icons/steps/status_05.png’ : $image;
}
$number = bp_get_online_users($type);
break;the final @ 1344 assumes that if it not a man or woman then it must be a couple
that’s it!
By the way am posting a question about user avatars, have worked out a solution to gender specific avatars but don’t understand the coding in sweetdate so can’t implement it till I do! -
AuthorPosts
The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.