Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Accelerated Mobile Pages for vBulletin Details »»
Accelerated Mobile Pages for vBulletin
Version: 1.00, by NeutralizeR NeutralizeR is offline
Developer Last Online: Oct 2021 Show Printable Version Email this Page

Category: Integration with vBulletin - Version: 3.8.x Rating:
Released: 10-19-2016 Last Update: 10-19-2016 Installs: 17
Template Edits
Re-useable Code Code Changes Additional Files Translations  
No support by the author.

What is AMP?
https://www.ampproject.org/

Info
When Google announced AMP, I realized I'd eventually need AMP support for my vBulletin forum. After reading the AMP implementation docs, I decided to modify printthread.php file since It only displays the basic elements and contents of a thread. So, you got the idea...

Implementation
  1. You will upload 1 file to forum root: amp.php
  2. You will edit /includes/class_bbcode.php and edit/replace a few lines.
  3. You will add two new templates, and edit a few.
  4. You will probably want to customize the <style amp-custom> CSS in ampthread template.
Demo
  1. Visit any thread from https://www.msxlabs.org homepage.
  2. Scroll down to footer; you will see the AMP link at the left bottom corner, click on it. It will open the AMP version of the thread.
  3. The link is there for quick access to AMP version of a thread, It is not mandatory, nor It is used by AMP recognation.
Installation
  1. Download and extract the ZIP file.
  2. Upload the amp.php file to your forum root folder (same folder with showthread.php)
  3. Add a new template called "ampthread" and copy the template content from ampthread_template.txt file.
  4. Add a new template called "ampthreadbit" and copy the template content from ampthreadbit_template.txt file.
  5. Edit your bbcode_quote template and replace It's content with bbcode_quote.txt file's.
  6. Edit includes/class_bbcode.php, find:
    PHP Code:
    if ($do_imgcode AND ($this->registry->userinfo['userid'] == OR $this->registry->userinfo['showimages'])) 
    replace with:
    PHP Code:
    if ($do_imgcode AND ($this->registry->userinfo['userid'] == OR $this->registry->userinfo['showimages']) OR THIS_SCRIPT == 'amp'//amp hack 
    find:
    PHP Code:
    return '<img src="' .  $link '" border="0" alt="" />'
    replace with:
    Code:
    if (THIS_SCRIPT == 'amp') {    return '<amp-img layout="responsive" src="' .  $link . '" width="300" height="250" alt=""></amp-img>';}    else { return '<img src="' .  $link . '" border="0" alt="" />';    } //amp hack
  7. Save and upload class_bbcode.php (overwrite).
  8. Edit SHOWTHREAD template and add
    Code:
    <link rel="amphtml" href="http://www.vbulletin.com/amp.php?t=$threadid<if condition="$pagenumber>1">&amp;page=$pagenumber</if>" />
    before </head>. Don't forget to change "yourforum.com" URL with yours.
  9. Edit ampthread template and change "vbulletin.com" with your forum URL:
    Code:
    <link rel="canonical" href="http://www.vbulletin.com/showthread.php?t=$threadinfo[threadid]<if condition="$pagenumber>1">&page=$pagenumber</if>" />
  10. You will find some comments in amp.php and ampthread template; modify them according to your needs (optional).
Notes
I installed a fresh vBulletin 3.8 to my localhost and tested this mod. It should work just fine unless your vBulletin is highly modified. If you get validation errors, I believe you can fix them by looking at the examples (comments).


Does it work?

  1. Open a thread from your forum.
  2. Replace the "showthread.php" with "amp.php" in the address bar, hit enter.
  3. Add "#development=1" at the end of the URL and refresh the page.
  4. Open Chrome DevTools, check the console log, it should say "AMP validation successful."
Screenshots
Snap2.png

Snap3.png

Snap4.png

Snap5.png

Credits
Accelerated Mobile Pages for vBulletin 3.8 is created by NeutralizeR from https://www.msxlabs.org

Download Now

File Type: zip AMP for vBulletin by MsXLabs.org v1.0.zip (8.2 KB, 264 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
12 благодарности(ей) от:
A.Chakery, Abu1, blind-eddie, bond010007, Brandon Sheley, Kane@airrifle, LeventX, m7sen, Masterix, Nas.er, PinkMilk, z3r0

Comments
  #2  
Old 10-20-2016, 05:05 PM
NeutralizeR NeutralizeR is offline
 
Join Date: Aug 2005
Posts: 355
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Template edits for validation.

Page Navigation Templates > pagenav
remove:
Code:
style="font-weight:normal"
Reply With Quote
Благодарность от:
Masterix
  #3  
Old 10-20-2016, 09:56 PM
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Location: Google Kansas
Posts: 4,678
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's crazy to see a vbulletin 3 mod released, thanks for sharing NeutralizeR
Reply With Quote
2 благодарности(ей) от:
Masterix, NeutralizeR
  #4  
Old 10-21-2016, 10:57 AM
attilio's Avatar
attilio attilio is offline
 
Join Date: Apr 2007
Location: Wokingham, Berkshire, UK
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can this mod work with vbulletin 4.2.4?
Reply With Quote
Благодарность от:
Kane@airrifle
  #5  
Old 10-21-2016, 11:09 AM
NeutralizeR NeutralizeR is offline
 
Join Date: Aug 2005
Posts: 355
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by attilio View Post
Can this mod work with vbulletin 4.2.4?
It is possible. I guess somebody else can create a vB 4 version of this mod.

I'll do it when I have time, if nobody else is willing to do...
Reply With Quote
Благодарность от:
RichieBoy67
  #6  
Old 10-21-2016, 07:11 PM
zorcocuq zorcocuq is offline
 
Join Date: Apr 2011
Location: Izmir,Turkey
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks NeutralizeR.
Reply With Quote
Благодарность от:
NeutralizeR
  #7  
Old 10-21-2016, 08:49 PM
Nas.er Nas.er is offline
 
Join Date: Mar 2016
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks NeutralizeR
Reply With Quote
Благодарность от:
NeutralizeR
  #8  
Old 10-24-2016, 04:24 AM
Goomzee Goomzee is offline
 
Join Date: Apr 2008
Location: Philippines
Posts: 588
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am using 3.8.2 and not works
Reply With Quote
  #9  
Old 10-26-2016, 07:01 AM
Wana Maly Wana Maly is offline
 
Join Date: Oct 2016
Location: Egypt
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you too much
I added it to my forum with some edits
example: http://vb.elmstba.com/amp.php?t=28465

http://vb.elmstba.com/t28465.html
Reply With Quote
2 благодарности(ей) от:
Masterix, NeutralizeR
  #10  
Old 10-26-2016, 09:10 AM
NeutralizeR NeutralizeR is offline
 
Join Date: Aug 2005
Posts: 355
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Goomzee View Post
I am using 3.8.2 and not works
Need more detail... Check the examples in the code.

Quote:
Originally Posted by Wana Maly View Post
thank you too much
I added it to my forum with some edits
example: http://vb.elmstba.com/amp.php?t=28465

http://vb.elmstba.com/t28465.html
You need to fix the validation errors:
Attachment 155427

For example, you can't use "style" on elements. Add a "class" instead.

HTML Code:
<td class="vbmenu_control" style="font-weight:normal">
HTML Code:
<td class="vbmenu_control normalfont">
and add your style as ".normalfont {font-weight:normal}" to your "ampthread" template.

I guess that part comes from pagination template. You can edit and remove the "style" part, too.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:11 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05200 seconds
  • Memory Usage 2,377KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (2)bbcode_html
  • (3)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (21)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete