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
You will upload 1 file to forum root: amp.php
You will edit /includes/class_bbcode.php and edit/replace a few lines.
You will add two new templates, and edit a few.
You will probably want to customize the <style amp-custom> CSS in ampthread template.
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?
Open a thread from your forum.
Replace the "showthread.php" with "amp.php" in the address bar, hit enter.
Add "#development=1" at the end of the URL and refresh the page.
Open Chrome DevTools, check the console log, it should say "AMP validation successful."
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...
Hi NeutralizeR,
Great mod! I am using VB 4.2.4 and keen to use this on my site. Do you have plans to release this for VB 4.x? Or can you guide me with the process to implement this on my 4.2.4 site.
Honestly, I would avoid Google AMP. If you do a bit of researching you'll see that it has more negatives than positives, including decreased ad-revenue. It's all aimed at speed. So unless that's your main goal, don't use it.
thanks for this addon , I did it on 3.8.8
but it doesn't work when I check the console log, it said this
PHP Code:
extensions-impl.js:509 Powered by AMP ⚡ HTML – Version 1534444305877 https://www.xxxxxx.com/vb/amp.php?t=32366#development=1 mozbar.moz.com/bartender/url-metrics:1 Failed to load resource: the server responded with a status of 403 () content_page.js:2561 Bartender API access denied. SerpResultsMetrics.handleError @ content_page.js:2561 validator.js:1001 AMP validation had errors: amp$validator$Terminal.error @ validator.js:1001 validator.js:1001 https://www.xxxxxx.com/vb/amp.php?t=32366:447:5 Custom JavaScript is not allowed. (see https://www.ampproject.org/docs/reference/spec#html-tags) amp$validator$Terminal.error @ validator.js:1001 validator.js:1023 See also https://validator.ampproject.org/#url=https://www.xxxxxx.com/vb/amp.php?t=3D32366 2start:1 Failed to load resource: the server responded with a status of 400 ()
- I wonder if It possible to make all style as amp ? such forums and user profile ?
- Is it possible to make copy from the archive folder and rename it to amp and make the editing to be amp ? and add script or meta name to head-include template !