Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Accelerated Mobile Pages for vBulletin Details »
Accelerated Mobile Pages for vBulletin
Mod Version: 1.00, by NeutralizeR (Coder/Designer) NeutralizeR is offline
Developer Last Online: Jul 2019 I like it Show Printable Version Email this Page

vB Version: 3.8.x Rating: (4 votes - 5.00 average) Installs: 15
Released: 20 Oct 2016 Last Update: 20 Oct 2016 Downloads: 183
Not Supported Template Edits Code Changes Additional Files Re-usable Code Translations  

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:
    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

    replace with:
    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

    find:
    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

    replace with:
    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

  7. Save and upload class_bbcode.php (overwrite).
  8. Edit SHOWTHREAD template and add
    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

    before </head>. Don't forget to change "yourforum.com" URL with yours.
  9. Edit ampthread template and change "vbulletin.com" with your forum URL:
    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

  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
Attachment 155404

Attachment 155405

Attachment 155406

Attachment 155407

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

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	Snap2.png
Views:	501
Size:	42.0 KB
ID:	155404   Click image for larger version

Name:	Snap3.png
Views:	408
Size:	94.9 KB
ID:	155405   Click image for larger version

Name:	Snap4.png
Views:	374
Size:	26.2 KB
ID:	155406   Click image for larger version

Name:	Snap5.png
Views:	331
Size:	54.9 KB
ID:	155407  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
  #16  
Old 01 Nov 2016, 15:39
NeutralizeR NeutralizeR is offline
 
Join Date: Aug 2005
Originally Posted by beansbaxter View Post
Installed on 3.8.8 PL2 and seems to work... however, the website is in English and Chrome thinks the AMP page is in Turkish and wants to translate? How to resolve?

Example Thread - http://pnwmoto.com/amp/2425.html

And thanks for building this mod!
Sorry, I forgot to tell you need to edit the "ampthread" template and change

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

or to your language code. (de,fr,ro, etc...)
__________________
MsXLabs Forum
Reply With Quote
  #17  
Old 01 Nov 2016, 15:51
beansbaxter's Avatar
beansbaxter beansbaxter is offline
 
Join Date: May 2005
Originally Posted by NeutralizeR View Post
Sorry, I forgot to tell you need to edit the "ampthread" template and change

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

to
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

or to your language code. (de,fr,ro, etc...)
You beat me to it! I found out where the problem was happening, made the edit, and came back to this thread to find you already posted a fix. Thanks!
__________________
PNW Moto - Motorcycle riders in Washington, Oregon, Idaho
Reply With Quote
  #18  
Old 01 Nov 2016, 16:03
beansbaxter's Avatar
beansbaxter beansbaxter is offline
 
Join Date: May 2005
Great everything works...

I too am running vBSEO. Not sure if this is possible, is there a way to change the AMP permalink structure to match up with vBSEO URL's?

And to convert the vBSEO Printable Thread URL's to the AMP version?

Examples below:

--

Currently, the vBSEO Print Thread structure is:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Can it be changed to the following:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

--

Currently, the vbSEO Print Thread Pagination:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Can it be changed to the following:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

--

And then how to change the AMP permalink to match up?

Thoughts?
__________________
PNW Moto - Motorcycle riders in Washington, Oregon, Idaho
Reply With Quote
  #19  
Old 01 Nov 2016, 16:17
NeutralizeR NeutralizeR is offline
 
Join Date: Aug 2005
AMP version of threads are unaffaced by vBSEO on my setup. I guess you are tying to make vBSEO powered AMP threads. It will require some edits in vbseo\includes.

You currently have two canonical tags on your AMP threads. Remove the one in ampthread template. Check my second post, edit your pagenav template.

Finally, you should remove <base href...> tag from your AMP threads. I think it is added by vBSEO, too.

You must see the "AMP validation successful." message in your developer console log.

http://pnwmoto.com/amp/2425.html#development=1

Example:
Snap1.png
__________________
MsXLabs Forum
Reply With Quote
  #20  
Old 01 Nov 2016, 16:29
NeutralizeR NeutralizeR is offline
 
Join Date: Aug 2005
Once Googlebot crawls your AMP thread, (and if it returns valid AMP status code) Google will save a copy of your page to their servers.

So, when Google pushes AMP content for all kind of websites to mobile search results (soon), your AMP thread will be served via Google. This is what I know and I did not make any extra SEO efforts for AMP threads, based on this information.
__________________
MsXLabs Forum
Reply With Quote
  #21  
Old 01 Nov 2016, 16:54
beansbaxter's Avatar
beansbaxter beansbaxter is offline
 
Join Date: May 2005
Thanks for the feedback. I've been working in the Developer Console Log and have worked through all the errors, except for one...

I see where vBSEO is adding the <base href...> tag, however when I remove it, then the forum's CSS and Style doesn't load... not sure if there is a workaround...

This the last issue I need to resolve to validate AMP.
__________________
PNW Moto - Motorcycle riders in Washington, Oregon, Idaho
Reply With Quote
  #22  
Old 01 Nov 2016, 17:23
NeutralizeR NeutralizeR is offline
 
Join Date: Aug 2005
Originally Posted by beansbaxter View Post
Thanks for the feedback. I've been working in the Developer Console Log and have worked through all the errors, except for one...

I see where vBSEO is adding the <base href...> tag, however when I remove it, then the forum's CSS and Style doesn't load... not sure if there is a workaround...

This the last issue I need to resolve to validate AMP.
Open vbseo\includes\functions_vbseo.php, find
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

right below this line there is a line starting with $newtext.

Replace:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

width:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
MsXLabs Forum
Reply With Quote
  #23  
Old 01 Nov 2016, 17:54
beansbaxter's Avatar
beansbaxter beansbaxter is offline
 
Join Date: May 2005
Originally Posted by NeutralizeR View Post
Open vbseo\includes\functions_vbseo.php, find
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

right below this line there is a line starting with $newtext.

Replace:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

width:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
Thank you so much! I tried several things and couldn't get it to work. And this worked great!

AMP is now being validated.

Thanks again. I appreciate your help.
__________________
PNW Moto - Motorcycle riders in Washington, Oregon, Idaho
Reply With Quote
  #24  
Old 01 Nov 2016, 17:56
NeutralizeR NeutralizeR is offline
 
Join Date: Aug 2005
You are welcome
__________________
MsXLabs Forum
Reply With Quote
  #25  
Old 01 Nov 2016, 20:17
nw-fotografie nw-fotografie is offline
 
Join Date: Mar 2016
Great stuff!

How can we put a link in the thread tools section?

Thanks for support!

Greetings

Klaus
Reply With Quote
  #26  
Old 01 Nov 2016, 20:32
nw-fotografie nw-fotografie is offline
 
Join Date: Mar 2016
Ok, validation makes some problems:

The attribute 'nowrap' may not appear in tag 'td'.
The attribute 'style' may not appear in tag 'div'.
The attribute 'style' may not appear in tag 'td'.
The tag 'img' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-img'? 585 https://www.ampproject.org/docs/reference/amp-img.html
The attribute 'style' may not appear in tag 'div'.
The attribute 'nowrap' may not appear in tag 'td'.
The tag 'script' is disallowed except in specific forms.

Any idea how to fix this?
Reply With Quote
  #27  
Old 04 Nov 2016, 10:43
NeutralizeR NeutralizeR is offline
 
Join Date: Aug 2005
Originally Posted by nw-fotografie View Post
Ok, validation makes some problems:

The attribute 'nowrap' may not appear in tag 'td'.
The attribute 'style' may not appear in tag 'div'.
The attribute 'style' may not appear in tag 'td'.
The tag 'img' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-img'? 585 https://www.ampproject.org/docs/reference/amp-img.html
The attribute 'style' may not appear in tag 'div'.
The attribute 'nowrap' may not appear in tag 'td'.
The tag 'script' is disallowed except in specific forms.

Any idea how to fix this?
Helped via PM.

Note: I can't answer all questions via PM but I'll try to help you fix the validation issues. I believe we covered most of them. Some plugins globally add codes/lines to many vB pages, including AMP. You should exclude them for AMP threads.
__________________
MsXLabs Forum

Last edited by NeutralizeR; 04 Nov 2016 at 15:24.
Reply With Quote
  #28  
Old 04 Nov 2016, 14:52
unp unp is offline
 
Join Date: Oct 2008
I have "Missing structured data element" in google webmasters.

I checked your pages and found this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

I need some help with this datePublished and DateModified.

with $threadinfo[dateline & lastpost] I get unix date format.

Regards,
Reply With Quote
  #29  
Old 04 Nov 2016, 15:21
NeutralizeR NeutralizeR is offline
 
Join Date: Aug 2005
http://searchengineland.com/amp-page...console-255016

You can check this example regarding dates in unix format:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
MsXLabs Forum
Reply With Quote
  #30  
Old 04 Nov 2016, 18:54
Masterix Masterix is offline
 
Join Date: Jan 2008
Originally Posted by NeutralizeR View Post
You don't actually need to rewrite AMP pages. AMP pages will be served by Google once they are crawled.

You can try these Custom Rewrite Rules for vBSEO:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

or

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.
Thanks, Google is crawling now
Reply With Quote
Reply

Tags
accelerated mobile pages, amp, amp for vbulletin, google amp


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 10:52.

Layout Options | Width: Wide Color: