Results 1 to 10 of 10

Thread: Different CMPS layout on different skins. How?

  1. #1
    Join Date
    Apr 2008
    Location
    England
    Posts
    18

    Default Different CMPS layout on different skins. How?

    My site is www.swapscene.com which is a heavily modified vbulletin 3.7 based and I have Vba v3.0.0 CMPS

    This is a popular adult (swingers) contacts community based inthe UK

    I have added a new skin on my site (inheriting properties from the current one) and I want to set a different (simplified) CMPS layout for this skin than on my current skin

    Then members could select between 'swapscene classic' and 'swapscene light'. I would then like to build a mobile skin based around the swapscene light version

    How would I go about that, having a different CMPS layout on each skin?

    I really need to have a (auto?) selectable mobile skin as so many of my members use smart phones now due to the nature of my site, and one big rival sites already has this option... so I feel it will hold my site back in future unless I fix it.

    Rich
    PS though I am only an amateur programmer I made so many custom mods for my site over the last few years that I am quite experienced with php and vbulletin hacking now!

  2. #2
    Join Date
    Apr 2008
    Location
    England
    Posts
    18

    Default

    Any help on this?

    Basically I want to have a mobile skin with different CMPS settings than my current site which is not really suited to mobile devices. Of course i want to keep the current layout for my members using their PC

    So one site - two layouts

    What's the best way of doing this?
    cheers

    Rich

    I've tried a few ways to do this

  3. #3
    Join Date
    Apr 2008
    Location
    England
    Posts
    18

    Default

    In the absence of any help or advice whatsoever (a bit disconcerting that TBH) I have managed to do this - but have no idea if I did it the right way as I am just a self taught hobbyist programmer.

    I want to have the current site retain it's 3 column layout with menu down the left side and make the mobile site with a single column (narrow) layout with navigation options across the top. So I still want the CMPS, but a different layout altogether

    Having spent a day on this, I now installed two copies of my Vbulletin 3.7.0 site on the same server

    One is in the root (htdocs) folder on my test server (with the forums in htdocs/forums)

    The second install is in htdocs/mobile (with the forums in htdocs/mobile/forums) - I point my .mobi domain at the htdocs/mobile folder

    Both use the same database

    I added a new skin (inherited from my current one) to the 'mobile' site

    By creating some new database tables for the vba_modules, pages and groups (I cloned on the four existing ones but renamed vbm_modules etc), then editing the SQL in some of the vba php files in the 'mobile' vbulletin install to use the new vbm_ tables (a couple of these pass the table name by reference in a function so beware!) I got a solution!

    I now have two instances of my site, sharing the same database but with different skins and I can control the VbA CMS individually on each instance.

    I just use the CMPS section in the ACP as normal in either site to alter the layout on that one site independant of the other

    I then hard coded the skin selection into global.php so each site automatically uses the correct skin.

    The attachments/albums/thumbs paths seem to be absoulte with reference to htdocs so I think that will be OK in both instances of vbulletin

    OK so all that works fine I think

    Now I just need to work on the single column narrow layout for the mobile site and hope i don't hit any other serious obtacles

    As I said, I have no idea if I am going about this the right way or what other hoops I may have to jump through.

    Some advice would have been nice really.

    Rich
    Last edited by dicky96; 01-25-2014 at 11:12 AM.

  4. #4
    Join Date
    Apr 2008
    Location
    England
    Posts
    18

    Default

    OK I've had another day working on this

    I got my three column main site and my one column mobile site working on my test server and mostly this is working as I expected. I also changed the colour scheme in the mobile ACP so it is obvious which site layout I am working on.

    The only issue I have found so far is this does not work properly on the home page for some reason

    The layout I set on the homepage in one ACP affect the other site. All the other pages like Forum Home, My Account and index.php?pageid=whatever have CMPS independant layouts

    I am trying to figure out why this is now, but any suggestions would be helpful.

    What is different in the code that generates the index (homepage) CMPS layout from the other pages?

    Rich

  5. #5
    Join Date
    Apr 2008
    Location
    England
    Posts
    18

    Default

    Sorted it

    For some reason (efficiency?) when displaying the home page the module layouts are read from the datastore file (in the database) where as for all other pages the module layout comes from the adv_modules file - or in the case of my modded mobile site the 'adm_modules' file

    I just edited the conditional out of this code in vba_cmps_iclude_top.php in the mobile site to force it to read the home page layout from adm_modules same as for any other page

    ##### Now grab the page
    if ($getpage == 'home')
    {
    $pages =& $vbulletin->adv_portal_home;
    }
    else
    {
    $pages = $db->query_first("
    SELECT * FROM " . TABLE_PREFIX . "adm_pages
    WHERE name = '" . $db->escape_string($getpage) . "'
    " . iif(!($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']), 'AND active = 1')
    );
    }

    Another hoop jumped through

    Guess I may as well stop posting these questions here though as approx 300 views and no one seems interested in this stuff

    Rich

  6. #6

    Default

    Hi Rich,

    I think I'm trying to do something similar here:
    http://www.vbadvanced.com/forum/show...ht=conditional

    Do you know the name of the vbAdvanced homepage? I tried using IFs and:
    <if condition="THIS_SCRIPT !== 'adv_portal_home'">

    ...did not work - so I'm guessing it's not adv_portal_home...

  7. #7
    Join Date
    Apr 2008
    Location
    England
    Posts
    18

    Default

    HI Sal
    Sorry for the delay - I have been very busy with this project (which is progressing well)

    Are you trying to detect which version (mobile or desktop) of your site your user is running in? If so I did it by parsing the 'REQUEST_URI' global to see if it contained the text 'mobile' which is the subfolder my mobile version of the site runs in, then set a global variable '$swappymobile'. I also use this method in forums/global.php on both my mobile and desktop sites to force the correct skin selection like this


    // Select skin according to folder location
    if (strpos($_SERVER['REQUEST_URI'],'mobile') !== false)
    {
    $styleid=10; //.mobi skin
    $swappymobile = TRUE;
    }
    else
    {
    $styleid=8; //.com skin
    $swappymobile = FALSE;
    }
    // END Select skin by domain

    Since posting here I have dropped the idea of using www.swapscene.mobi (though it was worth me owning that domain) and I am now using m.swapscene.com instead which is an alias pointing to the www.swapscene.com/mobile folder on my webserver. I hope the above code will still function, it seems OK on my test server. I will post back when I have tried this in a live environment

    Does that help at all?
    Rich

  8. #8

    Default

    Thank you, Rich. What I'm actually trying to do is keep an ad image off the vBadvanced page - but display everywhere else - in my navbar...

  9. #9
    Join Date
    Apr 2008
    Location
    England
    Posts
    18

    Default

    HI Sal
    If I understand you right you don't want the image in your navbar to appear on the home page (yourdomain.com/index.php) even for logged in members, but you would like it to appear on all other pages? Yes?

    Rich

  10. #10
    Join Date
    Apr 2008
    Location
    England
    Posts
    18

    Default

    Hi Sal
    Sorry for the delay in replying

    I use this conditional to display a css 'Home' button on all pages apart from the index (homepage)

    <if condition="$getpage != "home"">
    <td class="smbutton" width="100%">
    <a href="$vboptions[homeurl]"><<< SwapScene Home</a>
    </td>
    </if>

    That should do the trick for you. class "smbutton" is a css classs I created for buttons on my site. You can use the same conditional to display your graphic on all pages except home like this


    <if condition="$getpage != "home"">
    <td>
    IMAGE HTML GOES HERE
    </td>
    </if>


    Regards all the stuff I was posting above - I have now abandoned the idea of having two vbulletin installs on one database as it was far too cumbersome to implement

    What I have now is one vbulletin/vbA install with two adminCP folders. One of the admincp allows me to select the CMS layout on my main site, the other CMS controls the layout on my mobile site. I have two styles, one for classic and one for mobile site - this allows me to edit templates independantly for the two styles. All other functions of the adminCP affect both sites.

    Depending which skin (style) the user selects they get the appropriate CMS layout as well

    I should also be able to add a script to the index.php which auto selects the mobile layout if you login on a mobile device

    Rich

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. 2nd CMPS page, different layout.
    By britishf in forum "How Do I..." Questions
    Replies: 5
    Last Post: 05-05-2012, 12:25 PM
  2. is it possible to do this kind of layout w cmps?
    By iheartvb in forum "How Do I..." Questions
    Replies: 7
    Last Post: 08-26-2009, 03:07 AM
  3. Different skins on CMPS to forum
    By MastaBlaster in forum Troubleshooting & Problems
    Replies: 1
    Last Post: 01-22-2008, 12:40 PM
  4. New skins and CMPS
    By chet in forum Troubleshooting / "How do I..." Questions
    Replies: 5
    Last Post: 01-13-2005, 12:05 PM
  5. Skins that works with vBadvanced CMPS
    By partang2 in forum Troubleshooting / "How do I..." Questions
    Replies: 19
    Last Post: 07-14-2004, 04:20 AM

Posting Permissions

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