vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Styles (https://vborg.vbsupport.ru/forumdisplay.php?f=237)
-   -   Lightweight Style for VB3.8.7 iPhone/Mobile/Cell/PDA (https://vborg.vbsupport.ru/showthread.php?t=263822)

killerkraft 05-22-2011 11:07 AM

Ok, i will try it.

After put the results here.

benFF 05-23-2011 08:17 AM

Nice update - would be good to include a "Report this post" link in a future version :)

dartho 05-23-2011 09:34 AM

Will do as it's already coded, just no link ...

killerkraft 05-23-2011 11:10 AM

dartho,

I am sorry but no results with the litle mod in that line.

I will try to solve it by myself, see what i can do.

Regards

dartho 05-25-2011 03:51 AM

working on next iteration - inline moderation tools!

BirdOPrey5 05-26-2011 03:35 PM

If anyone is running AME 2.5 (automatic media embedder) I have figured out how to have embedded videos made smaller in the mobile style so they can still be watched inside posts.

In the file ame_bbcode.php that came with the AME mod (in your /includes directory)

find:
PHP Code:

    $dimensions         =  "_$ameinfo[zone]";
    
$ameinfo['width']     = $vbulletin->options['automediaembed_width' $dimensions];
    
$ameinfo['height']     = $vbulletin->options['automediaembed_height' $dimensions]; 

and below it Add:
PHP Code:

if ($vbulletin->userinfo['styleid'] == 38)
{
  
$ameinfo['height'] = round($ameinfo['height']/2.3);
  
$ameinfo['width']  = round($ameinfo['width']/2.3);


Change 38 to the styleid of your mobile style.

Yo can set absolute heights and widths if you prefer, I am calculating it as a fraction of my set values which words well for me. You can experiment with the exact numbers to find what works best for you.

Leongsam 05-30-2011 08:30 PM

Installed.

Paul M 06-01-2011 05:59 PM

Tagged to look at later in the month.

Stephan Whelan 06-11-2011 06:37 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2200239)
If anyone is running AME 2.5 (automatic media embedder) I have figured out how to have embedded videos made smaller in the mobile style so they can still be watched inside posts.

In the file ame_bbcode.php that came with the AME mod (in your /includes directory)

find:
PHP Code:

    $dimensions         =  "_$ameinfo[zone]";
    
$ameinfo['width']     = $vbulletin->options['automediaembed_width' $dimensions];
    
$ameinfo['height']     = $vbulletin->options['automediaembed_height' $dimensions]; 

and below it Add:
PHP Code:

if ($vbulletin->userinfo['styleid'] == 38)
{
  
$ameinfo['height'] = round($ameinfo['height']/2.3);
  
$ameinfo['width']  = round($ameinfo['width']/2.3);


Change 38 to the styleid of your mobile style.

Yo can set absolute heights and widths if you prefer, I am calculating it as a fraction of my set values which words well for me. You can experiment with the exact numbers to find what works best for you.

Thanks for this - however doesn't seem to work on our site. E.g. look at this thread via a browser - doesn't seem to make a difference:

http://forums.deeperblue.com/test-forum/91308-test.html

BirdOPrey5 06-11-2011 08:13 PM

Quote:

Originally Posted by Stephan Whelan (Post 2206346)
Thanks for this - however doesn't seem to work on our site. E.g. look at this thread via a browser - doesn't seem to make a difference:

http://forums.deeperblue.com/test-forum/91308-test.html

A couple of things... Make sure you make a video post AFTER making the file change. Otherwise it may take hours or days for the cache to update to show the smaller video.

Second, check the youtube definition you're using- if the height and width are hard coded numbers this won't work. Width and height must be set to $ameinfo[width] and $ameinfo[height].

Stephan Whelan 06-11-2011 09:06 PM

Joe,

Thanks for that - unfortunately still doesn't work. I've confirmed the /includes/ame_bbcode.php has the change you've suggested, as well as the youtube definition having $ameinfo[width] and $ameinfo[height].

Any further ideas?

BirdOPrey5 06-11-2011 09:21 PM

I joined your forum to take a look but I don't see the mobile style as an option- do you have it public? If so what is the styleid number?

You can see how it works on my forum:
Mobile Style: http://www.juot.net/forums/showthrea...000&styleid=38
Regular Style: http://www.juot.net/forums/showthrea...0000&styleid=1

Stephan Whelan 06-11-2011 09:46 PM

Indeed - we normally disable the style selector (it is set automatically based on browser accessing the site) but i've re-enabled it for now.

BirdOPrey5 06-11-2011 10:12 PM

1 Attachment(s)
It's working... I just posted a video, here is a screen shot:

The older videos will turn small once the cache expires for them. I think you can force the issue by editing the post and re-saving it.

But in time all the videos will be small on the mobile style, as will all new videos.

Stephan Whelan 06-12-2011 06:13 PM

Joe - it does work well indeed.

Another question to the group...I see that when I use the style assignment mod (https://vborg.vbsupport.ru/showthread.php?t=173239) the link at the top of the page (default style, etc...) won't allow visitors to switch styles to the full blown version. I know that is a default option on that Mod but any ideas on how it might work in conjunction with this style?

dartho 06-13-2011 02:05 AM

Try this on for size:

In AdminCP->Plugins & Products->Add New Plugin create a new plugin for product: vBulletin, hook location: style_fetch, Title: Mobile Detection, Execution Order: 5 Code:
PHP Code:

$mobile_style_advanced=10;  //iPhone?
$mobile_style=10//Any mobile phone/device
$default_style=6//Your default or preferred desktop style
$vbulletin->input->clean_array_gpc('c', array( 
    
COOKIE_PREFIX 'userstyleid'     => TYPE_UINT
    
COOKIE_PREFIX 'skipmobilestyle' => TYPE_BOOL
)); 

$my_skipmobile $vbulletin->GPC[COOKIE_PREFIX 'skipmobilestyle'];
$my_userstyleid $vbulletin->GPC[COOKIE_PREFIX 'userstyleid'];

// Test mobile browser 
$mobile_browser false
$mobile_browser_advanced false
//if ($vbulletin->options['mob_detect_enabled']) 
if (1==1)

    if (
stripos($_SERVER['HTTP_USER_AGENT'], 'windows') === false
    { 
        if ( 
            
preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|android)/i'strtolower($_SERVER['HTTP_USER_AGENT'])) 
            OR 
            
stripos($_SERVER['HTTP_ACCEPT'],'application/vnd.wap.xhtml+xml') !== false 
            
OR 
            ((isset(
$_SERVER['HTTP_X_WAP_PROFILE']) OR isset($_SERVER['HTTP_PROFILE']))) 
            OR 
            
stripos($_SERVER['ALL_HTTP'],'OperaMini') !== false 
        

        { 
            
$mobile_browser true
        } 
        
// This array is big and may be bigger later on. So we move it to a second if. 
        
elseif (in_array
                    
strtolower(substr($_SERVER['HTTP_USER_AGENT'], 04)), 
                    array( 
                    
'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac'
                    
'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno'
                    
'ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-'
                    
'maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-'
                    
'newt','noki','oper','palm','pana','pant','phil','play','port','prox'
                    
'qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar'
                    
'sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-'
                    
'tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp'
                    
'wapr','webc','winw','winw','xda ','xda-'
                ) 
            ) 
        { 
            
$mobile_browser true
        } 
    } 

    if ( 
        
$mobile_browser 
        
AND 
        
preg_match('/(ipad|ipod|iphone|blackberry|android|pre\/|palm os|palm|hiptop|avantgo|plucker|xiino|blazer|elaine)/i'strtolower($_SERVER['HTTP_USER_AGENT'])) 
    ) 
    { 
        
$mobile_browser_advanced true
    } 

$vbulletin->input->clean_array_gpc('r', array( 
    
'styleid' => TYPE_INT
    
'langid'  => TYPE_INT
)); 

// Set up user's chosen style 
if ($vbulletin->GPC['styleid'])

    
$styleid $vbulletin->GPC['styleid']; 
    
vbsetcookie('userstyleid'$styleid); 
    if (
$styleid == $default_style
    { 
        
vbsetcookie('skipmobilestyle'1); 
        
$vbulletin->GPC[COOKIE_PREFIX 'skipmobilestyle'] = 1
        
$my_skipmobile=1;
    } 
    elseif (
$styleid == $mobile_style
    { 
        
vbsetcookie('skipmobilestyle'0); 
        
$vbulletin->GPC[COOKIE_PREFIX 'skipmobilestyle'] = 0
        
$my_skipmobile 1;
    } 

elseif (
$mobile_browser_advanced && !$my_skipmobile

    
$styleid $mobile_style_advanced

elseif (
$mobile_browser &&!$my_skipmobile

    
$styleid $mobile_style

elseif (
$my_userstyleid

    
$styleid $my_userstyleid

else 

    
$styleid = -1


edit the first 3 lines of the plugin code to suit your purposes (should be self explanatory) and see how you go. Make sure you disable any mobile detect type scripts/plugins you may have running such as the one you linked to in your last post whilst testing this. Also be aware that you should probably do testing under a standard user account as administrator accounts have different permissions when it comes to style selections.

Please feedback how it goes.

Stephan Whelan 06-13-2011 05:24 AM

Worked a treat Dartho!

dartho 06-13-2011 10:39 AM

Good to hear.

plazzman 06-13-2011 06:26 PM

Quote:

Originally Posted by dartho (Post 2197152)
[s]If you link me up with an example, I could look. via PM is OK.[/s]
Worked it out. Not highlight is 'hot' new threads (thread_hot_new). I'll fix that up.

To fix, edit the CSS, search for
Code:

.new, ._new, .forumnew
replace with
Code:

.new, ._new, .forumnew, ._hot_new, ._dot_hot_new
search for
Code:

.thread_dot, .thread_hot, .thread_dot_hot, .thread_, .thread_lock,.thread, .thread_moved, .thread_new
replace with
Code:

.thread_dot, .thread_hot, .thread_dot_hot, .thread_, .thread_lock,.thread, .thread_moved, .thread_new, .thread_hot_new, .thread_dot_hot_new
Thanks for the code for default style link, I'll put that in.

First off, absolutely love this template. Real smooth, last one I had was so convoluted.

Bit of a noob here though. Can you please explain to me where I can actually find those CSS changes?

Also, is it possible to just change the colours of the theme to make it fit my forum a bit better? Full credit/royalty would still apply obviously

Thanks alot

dartho 06-13-2011 10:03 PM

Those changes have been implemeneted in the last release - just make sure you uploaded the lightweight.css.php file to your forum root from the last zip.

It is also this file where you can make changes to the color scheme - open it up with your favorite text editor (I use notepad++) and read the comments at the top, it tells you what to do.

plazzman 06-14-2011 01:57 AM

Oh lol. My bad, I must have DL'd 0.0 instead of 0.1

Thanks a lot mate!

bestmilan 06-16-2011 02:51 AM

1 Attachment(s)
Btw, if you have enabled "Prefixes" on your forum homepage (to display specific icons for each forum) the "lightweight theme" images (status icons) will not show up on the lightweight skin's homepage.

I had to cut this piece of code from the lightweight skin templates (the specific templates are listed below) ...


Code:

$forum[imageprefix]
... to be able to display default lightweight theme images (status icons) on the homepage.

forumhome_forumbit_level1_post
forumhome_forumbit_level2_nopost
forumhome_forumbit_level2_post

snakes1100 06-16-2011 03:19 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2197116)
This is great that you have updated this for 3.8.7 and are not leaving the 3.x series behind! Downloading now!

ditto!

MagicThemeParks 06-16-2011 12:39 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2197116)
This is great that you have updated this for 3.8.7 and are not leaving the 3.x series behind!

I agree. 3.x rules! :D

I'm curious, does this have the auto-detect built-in or do I have to install the other mod?

BirdOPrey5 06-16-2011 12:43 PM

Quote:

Originally Posted by MagicThemeParks (Post 2208484)
I agree. 3.x rules! :D

I'm curious, does this have the auto-detect built-in or do I have to install the other mod?

It doesn't auto-detect.

dartho 06-16-2011 02:16 PM

Check this post: https://vborg.vbsupport.ru/showpost....7&postcount=56 for an updated autodetect based on vb's detect code in 4.x (ie. it allows over-riding)

Max Taxable 06-16-2011 03:53 PM

Installed. Most excellent. Thank you for this good work!

MagicThemeParks 06-17-2011 12:29 AM

Dartho, [S]I'll be sending[/S] I've sent a donation [S]in a moment[/S] for the brand-free option and to support your great work! :up:

I have a question to ask though.

I have my default style (Sofia's Impact: http://www.unitedstateshistoryforum.com/) and I use the forums arranged in columns for the 'States' forums. When you switch to the mobile style (http://www.unitedstateshistoryforum.com/?styleid=3) it shows different icons than the ones being used on the other forums. How can I fix that? [s]I noticed that post #62 has a possible fix, but is that the way to do it?[/s] Fix on that post didn't work for me.

I also just noticed a line through one of the threads: check here .... the only different thing about that thread is that it was an auto-thread from the social groups mod here. Any thoughts on what may be causing that?

dartho 06-17-2011 02:07 AM

Thanks for the Donation, it's appreciated.

Easy one first - the line through the thread is because it's closed. Probably not the best way to denote a closed thread, but ... You can change this to what you want by editing the lightweight.css.php file and searching for :
Code:

.thread_lock  a,.lock  a,.thread_lock ,._lock , ._hot_lock, ._dot_lock, ._dot_hot_lock, ._lock_new
{
        text-decoration: line-through;
}

and changing to what you prefer or just remove that block to have closed threads treated the same as normal threads.

How do you arrange them in columns - is that a default vBulletin feature or an addon? Also, if you could turn on template names in HTML comments, that would help me track it down greatly.

Thanks

dartho 06-17-2011 03:03 AM

@MagicThemeParks - it looks like you're using this addon https://vborg.vbsupport.ru/showthread.php?t=99829

If you want the forums to display like standard forums in the lightweight style, you can edit the forumhome_forumbit_columncell template in the lightweight style and replace it's contents with the contents of the forumhome_forumbit_level2_post template (I think...)

MagicThemeParks 06-17-2011 03:24 AM

Thanks for the 'closed' suggestion. I'll see what I can think about using instead of the line-through.

Arrange in columns is a mod. I'll turn on the template names in HTML comments now to help you :up:

EDIT: Saw that you added a post while I hadn't refreshed. LOL....I'll try that suggestion for the columncell template now.

MagicThemeParks 06-17-2011 03:32 AM

Quote:

Originally Posted by dartho (Post 2208817)
If you want the forums to display like standard forums in the lightweight style, you can edit the forumhome_forumbit_columncell template in the lightweight style and replace it's contents with the contents of the forumhome_forumbit_level2_post template (I think...)

Made the changes you suggested and it was almost there. But, it was showing as if the icons were missing because I was using the prefix images. So, I used the suggestion from bradhaskins in post #62 and that worked :up:

Now, I just have to get the mobile style detect going and we'll be set! :D

Thanks for your help again Dartho :up:

Clutch 06-18-2011 02:54 AM

Thank you dartho! This is a fantastic style. I see the auto-detect script that you outlined here and that should work great.

My question: Is there any way I can make it so if you're NOT using a mobile device that you can NOT select this style? The reason is my site depends heavily on CPM advertising, and since this is a lightweight style (light ads to possibly no ads), I'd prefer it not be user-selectable unless you are on a mobile device.

Any thoughts?

Max Taxable 06-18-2011 10:54 AM

Quote:

Originally Posted by Clutch (Post 2209271)
Thank you dartho! This is a fantastic style. I see the auto-detect script that you outlined here and that should work great.

My question: Is there any way I can make it so if you're NOT using a mobile device that you can NOT select this style? The reason is my site depends heavily on CPM advertising, and since this is a lightweight style (light ads to possibly no ads), I'd prefer it not be user-selectable unless you are on a mobile device.

Any thoughts?

AdminCP>Styles and Templates>Style Manager. Then uncheck the box for this style and click "Save display Order."

This will keep the style from being selectable by users but the automatic detection script will still be able to use it.

plazzman 06-21-2011 01:33 AM

Is there a reason it won't show custom logo? I've entered my logo into the CSS supplied, and the path is correct, but it wont show image, just the text of site name

dartho 06-22-2011 04:34 AM

I think you'll need to edit the header template and change:

<div class="header" align="left"><strong>$vboptions[bbtitle]</strong></div>

to something like

<div class="header" align="left"><img src="mylogo.png" /></div>

and play with it from there ...

plazzman 06-22-2011 10:11 PM

Awesome, worked like a charm. Thanks alot

radiofranky 06-28-2011 09:37 PM

can you create one for 4.14? I like simple and clean style..

It's nice!

dartho 06-28-2011 10:07 PM

I already have https://vborg.vbsupport.ru/showthread.php?t=249277

benFF 07-08-2011 03:38 PM

Just missing attachment uploads and my users will all be happy :D

Would also be nice if the CSS was made using the build in editor, rather than manually editing a file. Easier to hook into my CDN then as well.


All times are GMT. The time now is 12:00 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01586 seconds
  • Memory Usage 1,904KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (5)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete