vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=323668

Accelerated Mobile Pages for vBulletin
by NeutralizeR
20 Oct 2016 17:59

5 Attachment(s)
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

NeutralizeR 20 Oct 2016 19:05

Template edits for validation.

Page Navigation Templates > pagenav
remove:

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


Brandon Sheley 20 Oct 2016 23:56

It's crazy to see a vbulletin 3 mod released, thanks for sharing NeutralizeR

attilio 21 Oct 2016 12:57

Can this mod work with vbulletin 4.2.4?

NeutralizeR 21 Oct 2016 13:09

Quote:

Originally Posted by attilio (Post 2577146)
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...

zorcocuq 21 Oct 2016 21:11

Thanks NeutralizeR.

Nas.er 21 Oct 2016 22:49

Thanks NeutralizeR

Goomzee 24 Oct 2016 06:24

I am using 3.8.2 and not works

Wana Maly 26 Oct 2016 09:01

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

NeutralizeR 26 Oct 2016 11:10

1 Attachment(s)
Quote:

Originally Posted by Goomzee (Post 2577228)
I am using 3.8.2 and not works

Need more detail... Check the examples in the code.

Quote:

Originally Posted by Wana Maly (Post 2577307)
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.


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


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

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.

unp 27 Oct 2016 16:54

I am using a plugin to proxy cache remote images for https.

This is my class_bbcode-


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

And this is the plugin I am using-


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

Kindly help.

NeutralizeR 27 Oct 2016 20:14

Modify your class_bbcode.php as told in first post.

Replace your plugin with:

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


Need an rewriterule forVBSEO
by Masterix
30 Oct 2016 10:23

Installed but VBSEO rewrite showthread.php

Any Help?

OK, my bad
https://www.elo-forum.org/amp.php?t=92082&page=5
anyway need to add or change a rewriterule?

EDIT
Ok, with vbseo you dont need any rewriterule!
Goto your VBSEO-Admincp. Select: "General Settings" -> "vBSEO Basic Settings".
Scoll down to "Exclusion of pages?". Add there amp.php and save your settings. :D

Btw. Thanks in advance!

NeutralizeR 30 Oct 2016 18:08

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.


beansbaxter 01 Nov 2016 15:15

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!


All times are GMT. The time now is 21:07.

Powered by vBulletin® Version 3.8.12
Copyright © 2019, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.