Hi guys, working with Dolphin 6.1.6 and would like to conquer an issue. After members log in we'd like to set it to call a specific template based upon what their seeking. For example, if seeking a male then show x template, if seeking a female show y template, if seeking couple show z template.
Now, we know that java switches have been done to allow end users to select the template they want and those are good, however we're looking for a non-java solution where it's pulled from the DB instead of a java switch.
So, after the if logged (hoping to use the header.inc.php file for this) check we'd like to run the template check so it applies from there to all pages. Of course we know we'll need an else if logged = Not logged post the generic template. After this, we're lost and would love some help. Thinking this is something a lot of us might be able to use too.
Thanks in advance for all your help.
|
|
Interesting concept, I like it.!
(For example, if seeking a male then show x template, if seeking a female show y template, if seeking couple show z template.)
You possess an intuitive intelligence so powerful it can help you heal, and relieve stress. |
Yes, you got the idea. Now if we can just get it to happen.
We could use the Advanced Settings in Admin to help out with this, since we have the template selection there, just a few more lines and a DB call, just can't figure it out for sure.
|
I think this would be a great addition to add to Dolphin. Dolphin can be the first of it's kind to do this as far as I have seen online, but make sure its able to use on all Dolphins..hmmm Boonex this could be very worth looking into. You possess an intuitive intelligence so powerful it can help you heal, and relieve stress. |
It's simple
You can modify both join.php file and member.php file
As soon as the member join your site or is logged in you can call the male-female variable and use the header location php function to send the user on the right skin, such as member.php?skin=yourtemplate
If you want this as a custom modification,it is something very simple.
I should know the name of the templates you would like to switch.
Instead if you want this as an option in your admin panel, it could be a little more difficult, but not impossible, but well I am not sure I can provide that for free =DD
Web Development, Multimedia Design and Social Media. |
member.php redirects after logon anyway.
So i think a better way would be to check those male/female values just before that and set the skin cookie. Then just let the redirect occure as normal. This way the skin is changed and does not have to appear as part of the URL.
https://www.deanbassett.com |
Yep
That could be another simple solution
Deano if you want we can work toghether on it and provide that for free here in the forum as a little modification.
I know there are so many adult Dolphin sites around, this would be useful for many people here.
Let me know
My Skype is YobiLab
Web Development, Multimedia Design and Social Media. |
Ah, it's all yours. I don't work with D6 anymore. And i currently quite busy with my own mods.
https://www.deanbassett.com |
FOR DOLPHIN 6?! Oh well, maybe I did not read the post very well.......
Anyway here is the solution for Dolphin 7.0.4
I am not sure how to do what Deanos adviced. Anyway I found another way and it seems to work fine. I hope it helps =DD
OPEN MEMBER.PHP FIND:
$sUrlRelocate = BX_DOL_URL_ROOT . 'member.php';
REPLACE WITH:
//YiB Relocated based on Looking For - Begin $id = getID($member['ID']); $sql_res=mysql_query("SELECT * FROM `Profiles` WHERE `ID` = '{$id}'"); while($row=mysql_fetch_array($sql_res)) { $YiBmf=$row['LookingFor']; } if($YiBmf == 'male'){ $sUrlRelocate = BX_DOL_URL_ROOT . 'member.php?skin=maletemplate'; }elseif($YiBmf == 'female') { $sUrlRelocate = BX_DOL_URL_ROOT . 'member.php?skin=femalemaletemplate'; }else{ $sUrlRelocate = BX_DOL_URL_ROOT . 'member.php'; } //YiB Relocated based on Looking For - End //$sUrlRelocate = BX_DOL_URL_ROOT . 'member.php';
REPLACE maletemplate and femaletemplate with the desired templates
This is enough, because if a member join will have to login, so it will work also on join. This will not work if you use the avatar module, in this case OPEN MODULES/BOONEX/AVATAR/CLASSES/BxAvaModule.php
FIND:
function serviceJoin ($iMemID, $sStatusText) { $sPwd = db_value("SELECT `Password` FROM `Profiles` WHERE `ID` = '".(int)$iMemID."' LIMIT 1"); if ($sPwd) {
bx_login ((int)$iMemID); // autologin here bx_import('BxDolPermalinks'); $o = new BxDolPermalinks();
header('Location: ' . BX_DOL_URL_ROOT . $o->permalink('modules/?r=avatar/') . '&join_text=' . $sStatusText); // redirect to upload avatar page
return 'EXIT'; } return false; }
REPLACE WITH:
function serviceJoin ($iMemID, $sStatusText) { $sPwd = db_value("SELECT `Password` FROM `Profiles` WHERE `ID` = '".(int)$iMemID."' LIMIT 1");
if ($sPwd) { //YiB Relocated based on Looking For - Begin $sql_res=mysql_query("SELECT * FROM `Profiles` WHERE `ID` = '".(int)$iMemID."'"); while($row=mysql_fetch_array($sql_res)) { $YiBmf=$row['LookingFor']; } if($YiBmf == 'male'){ $YiBmfsk = 'maleskinhere'; }elseif($YiBmf == 'female') { $YiBmfsk = 'femaleskinhere'; }else{ $YiBmfsk = 'UNI'; } //YiB Relocated based on Looking For - End bx_login ((int)$iMemID); // autologin here bx_import('BxDolPermalinks'); $o = new BxDolPermalinks();
header('Location: ' . BX_DOL_URL_ROOT . $o->permalink('modules/?r=avatar/') . '&join_text=' . $sStatusText . '&skin=' .$YiBmfsk); // redirect to upload avatar page
return 'EXIT'; } return false; }
REPLACE maleskinhere and femaleskinhere with the desired templates. If you are not using the UNI template as default, replace also UNI with your default template.
Web Development, Multimedia Design and Social Media. |
oh well and it does not work for couple too, if you want this to work with couple too here is the modded code =DD
OPEN MEMBER.PHP FIND:
$sUrlRelocate = BX_DOL_URL_ROOT . 'member.php';
REPLACE WITH:
//YiB Relocated based on Looking For - Begin $id = getID($member['ID']); $sql_res=mysql_query("SELECT * FROM `Profiles` WHERE `ID` = '{$id}'"); while($row=mysql_fetch_array($sql_res)) { $YiBmf=$row['LookingFor']; } if($YiBmf == 'male'){ $sUrlRelocate = BX_DOL_URL_ROOT . 'member.php?skin=maletemplate'; }elseif($YiBmf == 'female') { $sUrlRelocate = BX_DOL_URL_ROOT . 'member.php?skin=femaletemplate'; }elseif($YiBmf == 'male,female'){ $sUrlRelocate = BX_DOL_URL_ROOT . 'member.php?skin=coupletemplate'; }else{ $sUrlRelocate = BX_DOL_URL_ROOT . 'member.php'; } //YiB Relocated based on Looking For - End //$sUrlRelocate = BX_DOL_URL_ROOT . 'member.php';
REPLACE maletemplate and femaletemplate or coupletemplate with the desired templates
This is enough, because if a member join will have to login, so it will work also on join. This will not work if you use the avatar module, in this case OPEN MODULES/BOONEX/AVATAR/CLASSES/BxAvaModule.php
FIND:
function serviceJoin ($iMemID, $sStatusText) { $sPwd = db_value("SELECT `Password` FROM `Profiles` WHERE `ID` = '".(int)$iMemID."' LIMIT 1"); if ($sPwd) {
bx_login ((int)$iMemID); // autologin here bx_import('BxDolPermalinks'); $o = new BxDolPermalinks();
header('Location: ' . BX_DOL_URL_ROOT . $o->permalink('modules/?r=avatar/') . '&join_text=' . $sStatusText); // redirect to upload avatar page
return 'EXIT'; } return false; }
REPLACE WITH:
function serviceJoin ($iMemID, $sStatusText) { $sPwd = db_value("SELECT `Password` FROM `Profiles` WHERE `ID` = '".(int)$iMemID."' LIMIT 1");
if ($sPwd) { //YiB Relocated based on Looking For - Begin $sql_res=mysql_query("SELECT * FROM `Profiles` WHERE `ID` = '".(int)$iMemID."'"); while($row=mysql_fetch_array($sql_res)) { $YiBmf=$row['LookingFor']; } if($YiBmf == 'male'){ $YiBmfsk = 'maleskinhere'; }elseif($YiBmf == 'female') { $YiBmfsk = 'femaleskinhere'; }elseif($YiBmf == 'male,female') { $YiBmfsk = 'coupleskinhere'; }else{ $YiBmfsk = 'UNI'; } //YiB Relocated based on Looking For - End bx_login ((int)$iMemID); // autologin here bx_import('BxDolPermalinks'); $o = new BxDolPermalinks();
header('Location: ' . BX_DOL_URL_ROOT . $o->permalink('modules/?r=avatar/') . '&join_text=' . $sStatusText . '&skin=' .$YiBmfsk); // redirect to upload avatar page
return 'EXIT'; } return false; }
REPLACE maleskinhere and femaleskinhere or coupleskin with the desired templates. If you are not using the UNI template as default, replace also UNI with your default template.
Web Development, Multimedia Design and Social Media. |
This is very nice of you to do this for us. I will try this soon..thanks! You possess an intuitive intelligence so powerful it can help you heal, and relieve stress. |
THIS WILL WORK FOR DOLPHIN 6.1.6 TOO, PLEASE TEST IT, MAKE A BACKUP OF YOUR MEMBER.PHP FILE
OPEN MEMBER.PHP
FIND:
if( !$sUrlRelocate = $_REQUEST['relocate'] or basename( $_REQUEST['relocate'] ) == 'index.php' or basename( $_REQUEST['relocate'] ) == 'join.php' ) $sUrlRelocate = $_SERVER['PHP_SELF'];
REPLACE WITH:
//if( !$sUrlRelocate = $_REQUEST['relocate'] or basename( $_REQUEST['relocate'] ) == 'index.php' or basename( $_REQUEST['relocate'] ) == 'join.php' ) //YiB Relocated based on Looking For - Begin $id = $member['ID']; $sql_res=mysql_query("SELECT * FROM `Profiles` WHERE `ID` = '{$id}'"); while($row=mysql_fetch_array($sql_res)) { $YiBmf=$row['LookingFor']; } if($YiBmf == 'male'){ $sUrlRelocate = $site['url'] . 'member.php?skin=maletemplate'; }elseif($YiBmf == 'female') { $sUrlRelocate = $site['url'] . 'member.php?skin=femaletemplate'; }elseif($YiBmf == 'male,female'){ $sUrlRelocate = $site['url'] . 'member.php?skin=coupletemplate'; }else{ $sUrlRelocate = $site['url'] . 'member.php'; } //YiB Relocated based on Looking For - End //$sUrlRelocate = $_SERVER['PHP_SELF'];
REPLACE maletemplate and femaletemplate or coupletemplate with the desired templates
LET ME KNOW IF IT WORKS
Web Development, Multimedia Design and Social Media. |
We have a failure on this one Yobi. When creating a male or female profile we get no change in the template making the noted change to member.php
Let me know if you want to see this site, I can e-mail it over to you.
|
Just sent you an email.
Provide your URL and I will fix it.
I can't have a working Dolphin 6.1.6, so I can't test if it works or not.
As soon as I will make it work for you, I will share it here again.
Let me know
Web Development, Multimedia Design and Social Media. |
Just checked your file.
The modification works fine.
You have just not written the name of the templates in the right way.
Fix the name of the templates and the modification will work fine.
Regards
Web Development, Multimedia Design and Social Media. |
Yobilab is right, this modification does in fact work. Awesome job my man, love to work with you on more ideas. Finally, a trick for Dolphin that no other CMS has and doesn't require the end user to click something to pull it off. |