vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Styles (https://vborg.vbsupport.ru/forumdisplay.php?f=247)
-   -   Forum Style - Lightweight Style for Small Screen Devices (cell phone, iphone, mobile, android) (https://vborg.vbsupport.ru/showthread.php?t=249277)

tafreeh 12-08-2011 03:51 AM

Quote:

Originally Posted by dartho (Post 2275506)
I haven;t forgotten you - it's just that I've been fixing style bugs - your request is not related to this style as such.

Having said all that - I'll try and point you in the right direction -

To strip all HTML tags from posts for a specific style ID, create a plugin as follows:

Product:vBulletin
Hook Location: Postbit Disaply Complete
Name: Strip HTML from Mobile Style Posts
Execution Order:5
Code:
Code:

if (STYLEID=='n') {
$post['message']=strip_tags($post['message'],'<br><a>');
}

replace 'n' with teh styleid of your lightweight style.

the bit in teh code with teh <br><a> is HTML tags you wish to allow, if you want images, add in <img>, if you want <stong> add it in etc. Google php strip_tags

thanks allot for this :)

inphoenix 12-08-2011 05:24 AM

I see this question was asked but not sure if it was answered. Can I add admob banners to this style? If yes, how? Thanks.

dartho 12-08-2011 06:41 AM

if you can add to standard style, you can ad to this I guess. I don't know what admob is

inphoenix 12-08-2011 12:08 PM

Quote:

Originally Posted by dartho (Post 2275804)
if you can add to standard style, you can ad to this I guess. I don't know what admob is

Admob is banner ad serving program for mobile devices. It generates a Google adsense like script to use. Where would I add that script if I want to post the banner after

1. First post.
2. Last post.

Thanks for your prompt response.

dartho 12-08-2011 12:53 PM

I don't do advertising inposts or threads etc, so have no idea. I'm pretty sure the ad hooks are in this style, so you would use them the same way you would with the default style. Find where someone else has done this with the default style and do the same as them.

inphoenix 12-09-2011 04:28 PM

Quote:

Originally Posted by dartho (Post 2275875)
I don't do advertising inposts or threads etc, so have no idea. I'm pretty sure the ad hooks are in this style, so you would use them the same way you would with the default style. Find where someone else has done this with the default style and do the same as them.

Thanks for a quick response. I found out that admob does not work for mobile apps but I got the code for Mobile Adsense. Those links are javascript. I tried using it in a regular HTML page on phone and it works but using it in the ad_showthread_firstpost_start does not work. If I use an adsense link in this ad_showthread_firstpost_start on regular desktop style it works.

Do you know if the lighweight (mobile) style will support javascript?

Has anyone else done this?

dartho 12-09-2011 09:28 PM

I just had a look, and those template hooks aren;t there. Try editing the postbit and postbit legacy templates and adding the following code at the end of the template and see how that goes (try both to see how it looks)
Code:

        <vb:if condition="$post['isfirstshown']">
                {vb:raw ad_location.ad_showthread_firstpost_start}
                {vb:raw ad_location.thread_first_post_content}
        </vb:if>
        <vb:if condition="$post['islastshown']">
                {vb:raw ad_location.thread_last_post_content}
        </vb:if>


inphoenix 12-09-2011 10:59 PM

Quote:

Originally Posted by dartho (Post 2276388)
I just had a look, and those template hooks aren;t there. Try editing the postbit and postbit legacy templates and adding the following code at the end of the template and see how that goes (try both to see how it looks)

Code:

        <vb:if condition="$post['isfirstshown']">
                {vb:raw ad_location.ad_showthread_firstpost_start}
                {vb:raw ad_location.thread_first_post_content}
        </vb:if>
        <vb:if condition="$post['islastshown']">
                {vb:raw ad_location.thread_last_post_content}
        </vb:if>


Adding this in postbit legacy did it. Thank you so much !!

inphoenix 12-12-2011 02:49 AM

How do I add another banner at the end of thread? I tried adding it in ad_thread_last_post_content but it won't show up. Ideally something at the end of thread (after all posts) would be really nice. Thanks.

dartho 12-12-2011 04:40 AM

The only other ad hook location in threads is the first post sig. I think that if those ad hooks I asked you to add to the postbit template aren't doing it, your problem lays elsewhere. Alternatively there are header and footer hooks that can be added in.


All times are GMT. The time now is 07:33 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.02232 seconds
  • Memory Usage 1,747KB
  • 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
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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