vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Styles (https://vborg.vbsupport.ru/forumdisplay.php?f=230)
-   -   Mobile, Cell, Phone, PDA, iPhone Style (https://vborg.vbsupport.ru/showthread.php?t=174375)

dartho 03-31-2009 09:53 PM

Quote:

Problem people who log in with FF through the internet are put in mobile style. Is their a fix to this?
This is just a style - its browser independant.

Greek76 04-03-2009 06:11 PM

Thanks for your response but one more question. Is there a way to make that users can't choose the mobile style as there default style on the forum while browsing from their computers? People are choosing it and then they can't choose a different style from the mobile theme..

dartho 04-03-2009 11:08 PM

This addon - https://vborg.vbsupport.ru/showthread.php?t=183185 - will allow you to "hide" a style from the style chooser...

Greek76 04-04-2009 10:34 AM

Thank you again but now I have some members complaining that they don't see the subforums while on mobile style. Any ideas?

dartho 04-04-2009 09:49 PM

I've not come across this as an issue before - what is your site, I'll look ...

Se?or Ramos 04-06-2009 07:41 PM

I couldn't find this posted anywhere, so I'll ask...

Where do I go to edit the color of the text, background, etc? I wanted to have white font with yellow links and a green background.

dartho 04-06-2009 09:18 PM

You'll need to edit the CSS file to make colour changes

por4x4 04-10-2009 03:17 AM

How can I post a small image at the top of the page? When I post an HTML image tag, it gets ignored? What about a javascript banner tag?

dartho 04-10-2009 09:35 AM

If you wish to use an IMG tag, try and swap the parameters.

rather than <img src="mypic.jpg" alt="My Pic" /> use <img alt="My Pic" src="mypic.jpg" />

this shouldn't get replaced with an anchor tag

por4x4 04-10-2009 04:50 PM

Quote:

Originally Posted by dartho (Post 1788098)
If you wish to use an IMG tag, try and swap the parameters.

rather than <img src="mypic.jpg" alt="My Pic" /> use <img alt="My Pic" src="mypic.jpg" />

this shouldn't get replaced with an anchor tag

Hmmm, this causes the alt text to show up, see attached screen shot. Is it possible to use javascript to show a banner? Last question, I've started reading through this monster thread, and I see that it is possible to show google ads but I'm not seeing where to enable that or put in the code?

Sorry for all the questions!

por4x4 04-10-2009 07:46 PM

Ok, I came across another issue. LOL I just realized that there is no "Post" link... It is possibly to reply to a thread, but not possible to make a new post. What am I missing?

Lynne 04-10-2009 07:50 PM

Quote:

Originally Posted by por4x4 (Post 1788331)
Hmmm, this causes the alt text to show up, see attached screen shot. Is it possible to use javascript to show a banner? Last question, I've started reading through this monster thread, and I see that it is possible to show google ads but I'm not seeing where to enable that or put in the code?

Sorry for all the questions!

If that causes the alt tag to show up, then you need to check your image path because it is wrong.

Quote:

Originally Posted by por4x4 (Post 1788426)
Ok, I came across another issue. LOL I just realized that there is no "Post" link... It is possibly to reply to a thread, but not possible to make a new post. What am I missing?

If you go into the forum, it should say "Threads: (New?)" near the top. Click on New? to start a new thread.

por4x4 04-11-2009 02:33 PM

Quote:

Originally Posted by Lynne (Post 1788433)
If that causes the alt tag to show up, then you need to check your image path because it is wrong.


If you go into the forum, it should say "Threads: (New?)" near the top. Click on New? to start a new thread.

Hi Lynne, yeah, I'm dumb, found the "Threads: (New?)".... However I'm positive my image path is correct, and only the alt shows up. Any advice is appreciated. I'll assume that javascript tags aren't possible since nobody has confirmed it is possible.

Lynne 04-11-2009 03:01 PM

Quote:

Originally Posted by por4x4 (Post 1788934)
Hi Lynne, yeah, I'm dumb, found the "Threads: (New?)".... However I'm positive my image path is correct, and only the alt shows up. Any advice is appreciated. I'll assume that javascript tags aren't possible since nobody has confirmed it is possible.

Check your page source and see what is going on there.

sportwiz628 05-02-2009 12:29 AM

It doesn't work for 3.8?

Biker_GA 05-02-2009 12:36 AM

Works perfectly with 3.8.2.

amish_irish 05-19-2009 07:55 PM

I am still getting a popup window that says Authentication Required every time. My forum is here. http://www.bluegoldnation.com/forums Just change the style to the correct one at the bottom to see what I am talking about.

I would appreciate any help. Is it a folder permission issue?

dartho 05-20-2009 02:52 AM

Code:

HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials.
Internet Information Services (IIS)

I would hazard a guess that the wireless.css file is either not in your forum root, or is for some reason password protected? GIven its running under IIS - could be security attributes?

jilly 05-21-2009 05:41 PM

Okay, I tested it on my board, and then I tried selecting it from my laptop, to see what it looked like, and I could see, very simple, but now how do I go back to the style that I used before, the 'default' style I have set for my forum? In the regular style, I have the select forum style drop down menu in the lower left corner of the screen, but it's gone from the mobile one, so I seem to be stuck in mobile! It there an easy way to put a lin or something down in that lower left corner that would say 'revert back to forum default' and it would take you back to the normal view?

Lynne 05-21-2009 06:31 PM

Quote:

Originally Posted by jilly (Post 1814762)
Okay, I tested it on my board, and then I tried selecting it from my laptop, to see what it looked like, and I could see, very simple, but now how do I go back to the style that I used before, the 'default' style I have set for my forum? In the regular style, I have the select forum style drop down menu in the lower left corner of the screen, but it's gone from the mobile one, so I seem to be stuck in mobile! It there an easy way to put a lin or something down in that lower left corner that would say 'revert back to forum default' and it would take you back to the normal view?

Either add "&styleid=x" onto the end of your url to get back to styleid x or install this - Extend and Customise Mobile Style and put the link to the default style on the bottom of the page.

amish_irish 05-23-2009 11:27 PM

Quote:

Originally Posted by dartho (Post 1813854)
Code:

HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials.
Internet Information Services (IIS)

I would hazard a guess that the wireless.css file is either not in your forum root, or is for some reason password protected? GIven its running under IIS - could be security attributes?

Nice guess. I tried to add the likely suspects manually to the security permissions on the .css file but with no luck so I just added the everyone permission and success!! Thanks!

BlueChipEarth 05-27-2009 02:55 PM

Does this not work with the Mobile Device Detection mod? It seems to not switch styles from a mobile phone... as though I tell it "hey switch styles" and then the MDD says "Oh no you don't!"

Any way around this?

Biker_GA 05-27-2009 03:03 PM

The Mobile Phone / iPhone / PDA Detection and Style Assignment modification forces the mobile style. There is no option to use anything else when using that mod.

rrudeboy 05-27-2009 03:53 PM

exactly what i was looking for... *w00t* :}

rrudeboy 05-27-2009 07:41 PM

dartho, awesome mobile interface.... BUT (there's always a but :} i want the blue to be gray/grey, checked the css but so far unable to find it. that will be all i want to alter.

dartho 05-28-2009 12:42 AM

edit the wireless.css file and I think its the titlebg, windowbg and windowbg2 classes that you need to modify. try this as your wireless.css for a few ideas

Code:

body
{
        background: #333333;
        color: #ffffff;
  font: 6pt verdana;
        margin: 0px;
        padding: 0px;
}

.header
{
        background-color: #222222;
        color: #ffffff;
        size:3;
}
.titlebg, .titlebg a, .titlebg a:link, .titlebg a:visited
{
        background-color: #444444;
        color: #000000;
        text-decoration: none;
        size:1;
}
.oldtitlebg, .oldtitlebg a, .oldtitlebg a:link, .oldtitlebg a:visited
{
        background-color: #333333;
        color: #000000;
        text-decoration: none;
        size:1;
}
.newtitlebg, .newtitlebg a, .newtitlebg a:link, .newtitlebg a:visited
{
        background-color: #222222;
        color: #C0C0C0;
        text-decoration: none;
        size:1;
}
.windowbg, .windowbg a, .windowbg a:link, .windowbg a:visited

{
        background-color: #333333;
        color: #FFFFFF;
        size:1;
}
.newwindowbg, .newwindowbg a, .newwindowbg a:link, .newwindowbg a:visited
{
        background-color: #333333;
        color: #FFFFFF;
        size:1;
}

.oldwindowbg, .oldwindowbg a, .oldwindowbg a:link, .oldwindowbg a:visited
{
        background-color: #333333;
        color: #FFFFFF;
        size:1;
}

.windowbg2, .thread, .windowbg2 a, .windowbg2 a:link, .windowbg2 a:visited
{
        background-color: #444444;
        color: #FFFFFF;
        size:1;
}
.Unreadwindowbg2, a:link.newwindowbg2, a:visited.newwindowbg2
{
        background-color: #333333;
        color: #000000;
        size:1;
}
.Oldwindowbg2, a:link.Oldwindowbg2, a:visited.Oldwindowbg2
{
        background-color: #444444;
        color: #000000;
        size:1;
}
.new, a:link.new, a:visited.new
{
        background-color: #333333;
        color: #000000;
        size:1;
}
.thread_new, a:link.thread_new, a:visited.thread_new
{
        background-color: #333333;
        color: #000000;
        size:1;
}
.thread_hot, a:link.thread_hot, a:visited.thread_hot
{
        background-color: #333333;
        color: #000000;
        size:1;
}
.old, a:link.old, a:visited.old
{
        background-color: #333333;
        color: #000000;
        size:1;
}
.navbar, a:link.navbar, a:visited.navbar
{
        background-color: #333333;
        color: #FFFFFF;
        size:1;
}
.footer, a:link.footer, a:visited.footer
{
        background-color: #333333;
        color: #FFFFFF;
        size:1;
}
.updated
{
        color: #ff0000;
        size:1;
}
.quote
{
        background-color: #666666;
        color: #000000;
        size:1;
}
.sticky
{
        background-color: #666666;
        color: #FFFFFF;
        size:1;
}
.announce
{
        background-color: #666666;
        color: #FFFFFF;
        size:1;
}


rrudeboy 05-28-2009 11:11 AM

Quote:

Originally Posted by dartho (Post 1818505)
edit the wireless.css file and I think its the titlebg, windowbg and windowbg2 classes that you need to modify. try this as your wireless.css for a few ideas

close... but not quite, i still want the background to be white. i can mess with it now that i know where :}

thanks.

BGObsession 05-29-2009 01:50 AM

Quote:

Originally Posted by dartho (Post 1788098)
If you wish to use an IMG tag, try and swap the parameters.

rather than <img src="mypic.jpg" alt="My Pic" /> use <img alt="My Pic" src="mypic.jpg" />

this shouldn't get replaced with an anchor tag


For the newbie coder (learning), WHERE would that html snippet be placed - somewhere in the xml code and then reuploaded, or in a specific section of the template under the mobile style?

Thanks in advance.....

dartho 05-29-2009 05:09 AM

template you want an image to show (ie. header template)! You can alternatively allow all images to be displayed by removing all the replacement variables (located at the very bottom of the style options screen) in the mobile style

BGObsession 05-29-2009 11:10 PM

Thanks Dartho - got it, and appreciate the patience for us self-learners....

Fangs404 05-31-2009 07:47 AM

I just installed this on a 3.8.2 install, and it seems to be working just fine. In the admin CP, I'm getting a message that says there are 34 templates that need to be updated/reverted, but other than that, it looks a-ok to me.

testbot 06-04-2009 07:26 PM

Quote:

Originally Posted by dartho (Post 1531419)
OK - I think I have working properly now. Code for plugin below. Ads don;t show up all teh time and after a bunch of refreshes they go a way for a while. This is a google thing and I guess it depends on your sites content and who is advertising? Anyway - the following seems to work for me. It is set for showing ads just before the quick reply, but you can change the ad_location in the code to show them after first post by searching and replacing ad_showthread_beforeqr for ad_showthread_firstpost in the plugin code...



Get your mobile adsense PHP code - here's the code Google game me (DO NOT USE THIS - GET YOUR OWN)
PHP Code:

<?php

$GLOBALS
['google']['ad_type']='text';
$GLOBALS['google']['channel']='0000000000';
$GLOBALS['google']['client']='pub-0000000000000000';
$GLOBALS['google']['format']='mobile_single';
$GLOBALS['google']['https']=$_SERVER['HTTPS'];
$GLOBALS['google']['host']=$_SERVER['HTTP_HOST'];
$GLOBALS['google']['ip']=$_SERVER['REMOTE_ADDR'];
$GLOBALS['google']['markup']='xhtml';
$GLOBALS['google']['oe']='utf8';
$GLOBALS['google']['output']='xhtml';
$GLOBALS['google']['ref']=$_SERVER['HTTP_REFERER'];
$GLOBALS['google']['url']=$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$GLOBALS['google']['useragent']=$_SERVER['HTTP_USER_AGENT'];
$google_dt time();
google_set_screen_res();

function 
google_append_url(&$url$param$value) {
  
$url .= '&' $param '=' urlencode($value);
}

function 
google_append_globals(&$url$param) {
  
google_append_url($url$param$GLOBALS['google'][$param]);
}

function 
google_append_color(&$url$param) {
  global 
$google_dt;
  
$color_array split(','$GLOBALS['google'][$param]);
  
google_append_url($url$param,
                    
$color_array[$google_dt sizeof($color_array)]);
}

function 
google_set_screen_res() {
  
$screen_res $_SERVER['HTTP_UA_PIXELS'];
  
$delimiter 'x';
  if (
$screen_res == '') {
    
$screen_res $_SERVER['HTTP_X_UP_DEVCAP_SCREENPIXELS'];
    
$delimiter ',';
  }
  
$res_array explode($delimiter$screen_res);
  if (
sizeof($res_array) == 2) {
    
$GLOBALS['google']['u_w'] = $res_array[0];
    
$GLOBALS['google']['u_h'] = $res_array[1];
  }
}

function 
google_get_ad_url() {
  
$google_ad_url 'http://pagead2.googlesyndication.com/pagead/ads?';
  
$google_scheme = ($GLOBALS['google']['https'] == 'on')
      ? 
'https://' 'http://';
  foreach (
$GLOBALS['google'] as $param => $value) {
    if (
$param == 'client') {
      
google_append_url($google_ad_url$param,
                        
'ca-mb-' $GLOBALS['google'][$param]);
    } else if (
strpos($param'color_') === 0) {
      
google_append_color($google_ad_url$param);
    } else if ((
strpos($param'host') === 0)
               || (
strpos($param'url') === 0)) {
      
google_append_url($google_ad_url$param,
                        
$google_scheme $GLOBALS['google'][$param]);
    } else {
      
google_append_globals($google_ad_url$param);
    }
  }
  
google_append_url($google_ad_url'dt',
               
round(1000 array_sum(explode(' 'microtime()))));
  return 
$google_ad_url;
}

$google_ad_handle = @fopen(google_get_ad_url(), 'r');
if (
$google_ad_handle) {
  while (!
feof($google_ad_handle)) {
    echo 
fread($google_ad_handle8192);
  }
  
fclose($google_ad_handle);
}

?>

I had to move al the functions to the top of the code block for it to work in a plug in I created a called "Google Adsense Mobile" on the showthread_start hook. Here is the working plugin code:
PHP Code:

if ($styleid == xx) {
function 
google_append_url(&$url$param$value) {
  
$url .= '&' $param '=' urlencode($value);
}

function 
google_append_globals(&$url$param) {
  
google_append_url($url$param$GLOBALS['google'][$param]);
}

function 
google_append_color(&$url$param) {
  global 
$google_dt;
  
$color_array split(','$GLOBALS['google'][$param]);
  
google_append_url($url$param,
                    
$color_array[$google_dt sizeof($color_array)]);
}

function 
google_set_screen_res() {
  
$screen_res $_SERVER['HTTP_UA_PIXELS'];
  
$delimiter 'x';
  if (
$screen_res == '') {
    
$screen_res $_SERVER['HTTP_X_UP_DEVCAP_SCREENPIXELS'];
    
$delimiter ',';
  }
  
$res_array explode($delimiter$screen_res);
  if (
sizeof($res_array) == 2) {
    
$GLOBALS['google']['u_w'] = $res_array[0];
    
$GLOBALS['google']['u_h'] = $res_array[1];
  }
}

function 
google_get_ad_url() {
  
$google_ad_url 'http://pagead2.googlesyndication.com/pagead/ads?';
  
$google_scheme = ($GLOBALS['google']['https'] == 'on')
      ? 
'https://' 'http://';
  foreach (
$GLOBALS['google'] as $param => $value) {
    if (
$param == 'client') {
      
google_append_url($google_ad_url$param,
                        
'ca-mb-' $GLOBALS['google'][$param]);
    } else if (
strpos($param'color_') === 0) {
      
google_append_color($google_ad_url$param);
    } else if ((
strpos($param'host') === 0)
               || (
strpos($param'url') === 0)) {
      
google_append_url($google_ad_url$param,
                        
$google_scheme $GLOBALS['google'][$param]);
    } else {
      
google_append_globals($google_ad_url$param);
    }
  }
  
google_append_url($google_ad_url'dt',
               
round(1000 array_sum(explode(' 'microtime()))));
  return 
$google_ad_url;
}

$GLOBALS['google']['ad_type']='text';
$GLOBALS['google']['channel']='0000000000';
$GLOBALS['google']['client']='pub-0000000000000000';
$GLOBALS['google']['format']='mobile_single';
$GLOBALS['google']['https']=$_SERVER['HTTPS'];
$GLOBALS['google']['host']=$_SERVER['HTTP_HOST'];
$GLOBALS['google']['ip']=$_SERVER['REMOTE_ADDR'];
$GLOBALS['google']['markup']='xhtml';
$GLOBALS['google']['oe']='utf8';
$GLOBALS['google']['output']='xhtml';
$GLOBALS['google']['ref']=$_SERVER['HTTP_REFERER'];
$GLOBALS['google']['url']=$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$GLOBALS['google']['useragent']=$_SERVER['HTTP_USER_AGENT'];
$google_dt time();
google_set_screen_res();

$find='"';
$replace="'";
$googlemad '';

$google_ad_handle = @fopen(google_get_ad_url(), 'r');
if (
$google_ad_handle) {
  while (!
feof($google_ad_handle)) {
    
$googlemad .= fread($google_ad_handle8192);
  }
  
fclose($google_ad_handle);
}
$vbulletin->templatecache['ad_showthread_beforeqr'] = str_replace($find,$replace,$googlemad);



You'll see I wrapped the google code in a conditional if ($styleid == xx) { ... } where xx is the styleid of my mobile style - you will need to change this and removed the opening and closing php tags.

The other changes (after moving the functions to the top) were:
1. replace
PHP Code:

$google_dt time();
google_set_screen_res(); 

with
PHP Code:

$google_dt time();
google_set_screen_res();

$find='"';
$replace="'";
$googlemad ''

2. replace
PHP Code:

    echo fread($google_ad_handle8192);
  }
  
fclose($google_ad_handle);


with
PHP Code:

    $googlemad .= fread($google_ad_handle8192);
  }
  
fclose($google_ad_handle);
}

$vbulletin->templatecache['ad_showthread_beforeqr'] = str_replace($find,$replace,$googlemad); 

That's about it. You could modify and or duplicate this to work with other ad_locations. Current defined ad_locations in vBulletin 3.7 (and this style) and the likely best hook location for these ads are (i'm not so sure about the ones in blue - they should work there, but there may be a more efficient place to put them. Feedback welcomed!):

ad_footer_start - global_start
ad_footer_end - global_start
ad_forumdisplay_afterthreads - forum_display_start
ad_forumhome_afterforums - forum_home_start
ad_header_end - global_start
ad_header_logo - global_start
ad_navbar_below - global_start
ad_showthread_beforeqr - showthread_start
ad_showthread_firstpost - showthread_start

Hope this helps!



that seems like so much work. can't we just copy the ad code somewhere in the template?

m52 06-07-2009 12:33 AM

installed, works a treat on 3.8.2. For my peace of mind though, I might make the font a touch bigger

l3it3r 06-07-2009 05:23 PM

Very flipping sweet.

edytwinky 06-13-2009 12:44 PM

How do I add a link on the line that says "Home New Posts User CP"

dartho 06-13-2009 02:49 PM

edit the navbar template

1viking 06-17-2009 11:51 AM

Anybody having problems getting this to work with people that have their default setting set to hybrid or threaded? The latest post is the only one to show up.

Lynne 06-17-2009 03:23 PM

Quote:

Originally Posted by 1viking (Post 1831231)
Anybody having problems getting this to work with people that have their default setting set to hybrid or threaded? The latest post is the only one to show up.

Easiest solution would probably be to write a plugin to disable threaded/hybrid mode when using this style.

dartho 06-17-2009 09:12 PM

@1viking - I didn't consider threaded/hybrid mode when writing this, so I'm not suprised that there may be issues in these modes. I'll look into it when time permits

edytwinky 06-20-2009 08:07 PM

Installed and works on 3.8.3

Any plans to release a version that is compatible with vb Blogs?


All times are GMT. The time now is 11:59 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.02431 seconds
  • Memory Usage 1,944KB
  • 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
  • (3)bbcode_code_printable
  • (6)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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