View Full Version : Integration with vBulletin - Accelerated Mobile Pages for vBulletin
NeutralizeR
10-19-2016, 09:00 PM
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
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.
Demo
Visit any thread from https://www.msxlabs.org homepage.
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.
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
Download and extract the ZIP file.
Upload the amp.php file to your forum root folder (same folder with showthread.php)
Add a new template called "ampthread" and copy the template content from ampthread_template.txt file.
Add a new template called "ampthreadbit" and copy the template content from ampthreadbit_template.txt file.
Edit your bbcode_quote template and replace It's content with bbcode_quote.txt file's.
Edit includes/class_bbcode.php, find:if ($do_imgcode AND ($this->registry->userinfo['userid'] == 0 OR $this->registry->userinfo['showimages'])) replace with: if ($do_imgcode AND ($this->registry->userinfo['userid'] == 0 OR $this->registry->userinfo['showimages']) OR THIS_SCRIPT == 'amp') //amp hack find: return '<img src="' . $link . '" border="0" alt="" />'; replace with: 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
Save and upload class_bbcode.php (overwrite).
Edit SHOWTHREAD template and add <link rel="amphtml" href="http://www.vbulletin.com/amp.php?t=$threadid<if condition="$pagenumber>1">&page=$pagenumber</if>" /> before </head>. Don't forget to change "yourforum.com" URL with yours.
Edit ampthread template and change "vbulletin.com" with your forum URL:<link rel="canonical" href="http://www.vbulletin.com/showthread.php?t=$threadinfo[threadid]<if condition="$pagenumber>1">&page=$pagenumber</if>" />
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."
Screenshots
155404
155405
155406
155407
Credits
Accelerated Mobile Pages for vBulletin 3.8 is created by NeutralizeR from https://www.msxlabs.org
NeutralizeR
10-20-2016, 05:05 PM
Template edits for validation.
Page Navigation Templates > pagenav
remove:
style="font-weight:normal"
Brandon Sheley
10-20-2016, 09:56 PM
It's crazy to see a vbulletin 3 mod released, thanks for sharing NeutralizeR
attilio
10-21-2016, 10:57 AM
Can this mod work with vbulletin 4.2.4?
NeutralizeR
10-21-2016, 11:09 AM
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
10-21-2016, 07:11 PM
Thanks NeutralizeR.
Nas.er
10-21-2016, 08:49 PM
Thanks NeutralizeR
Goomzee
10-24-2016, 04:24 AM
I am using 3.8.2 and not works
Wana Maly
10-26-2016, 07:01 AM
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
10-26-2016, 09:10 AM
I am using 3.8.2 and not works
Need more detail... Check the examples in the code.
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:
155427
For example, you can't use "style" on elements. Add a "class" instead.
<td class="vbmenu_control" style="font-weight:normal"><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.
I am using a plugin to proxy cache remote images for https.
This is my class_bbcode-
function handle_bbcode_img_match($link)
{
$link = $this->strip_smilies(str_replace('\\"', '"', $link));
// remove double spaces -- fixes issues with wordwrap
$link = str_replace(array(' ', '"'), '', $link);
$retval = '<img src="' . $link . '" border="0" alt="" />';
($hook = vBulletinHook::fetch_hook('bbcode_img_match')) ? eval($hook) : false;
return $retval;
}
And this is the plugin I am using-
$url = parse_url($link);
if ($url['scheme'] == 'https') {
$retval = ($fullsize ? '<div class="size_fullsize">' : '') . '<img src="' . $link .'" border="0" alt="" />' . ($fullsize ? '</div>' : '');
} elseif ($url['host'] == 'www.site.com') {
$retval = ($fullsize ? '<div class="size_fullsize">' : '') . '<img src="' . $link .'" border="0" alt="" />' . ($fullsize ? '</div>' : '');
} else {
$retval = ($fullsize ? '<div class="size_fullsize">' : '') . '<img src="cache.php?img=' . rawurlencode($link) .'" border="0" alt="" />' . ($fullsize ? '</div>' : '');
}
Kindly help.
NeutralizeR
10-27-2016, 06:14 PM
Modify your class_bbcode.php as told in first post.
Replace your plugin with:
$url = parse_url($link);
//amphack
if (THIS_SCRIPT == 'amp') {
if ($url['scheme'] == 'https') {
$retval = ($fullsize ? '<div class="size_fullsize">' : '') . '<amp-img layout="responsive" src="' . $link .'" alt="" />' . ($fullsize ? '</div>' : '');
} elseif ($url['host'] == 'www.site.com') {
$retval = ($fullsize ? '<div class="size_fullsize">' : '') . '<amp-img layout="responsive" src="' . $link .'" alt="" />' . ($fullsize ? '</div>' : '');
} else {
$retval = ($fullsize ? '<div class="size_fullsize">' : '') . '<amp-img layout="responsive" src="cache.php?img=' . rawurlencode($link) .'" alt="" />' . ($fullsize ? '</div>' : '');
}
}
else
{
if ($url['scheme'] == 'https') {
$retval = ($fullsize ? '<div class="size_fullsize">' : '') . '<img src="' . $link .'" border="0" alt="" />' . ($fullsize ? '</div>' : '');
} elseif ($url['host'] == 'www.site.com') {
$retval = ($fullsize ? '<div class="size_fullsize">' : '') . '<img src="' . $link .'" border="0" alt="" />' . ($fullsize ? '</div>' : '');
} else {
$retval = ($fullsize ? '<div class="size_fullsize">' : '') . '<img src="cache.php?img=' . rawurlencode($link) .'" border="0" alt="" />' . ($fullsize ? '</div>' : '');
}
}
//amp hack
Masterix
10-30-2016, 09:23 AM
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
10-30-2016, 05:08 PM
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:
'^amp\.php\?t=(\d+)' => 'amp/$1.html'or
'^amp\.php\?t=(\d+)&page=(\d+)$' => 'amp/$1-$2.html'
beansbaxter
11-01-2016, 02:15 PM
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!
NeutralizeR
11-01-2016, 02:39 PM
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
<html amp lang="tr">to<html amp lang="en">or to your language code. (de,fr,ro, etc...)
beansbaxter
11-01-2016, 02:51 PM
Sorry, I forgot to tell you need to edit the "ampthread" template and change
<html amp lang="tr">to<html amp lang="en">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!
beansbaxter
11-01-2016, 03:03 PM
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:
[forum_title]/[thread_id]-[thread_title]-print.html
Can it be changed to the following:
[forum_title]/[thread_id]-[thread_title]-amp.html
--
Currently, the vbSEO Print Thread Pagination:
[forum_title]/[thread_id]-[thread_title]-[thread_page]-print.html
Can it be changed to the following:
[forum_title]/[thread_id]-[thread_title]-[thread_page]-amp.html
--
And then how to change the AMP permalink to match up?
Thoughts?
NeutralizeR
11-01-2016, 03:17 PM
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:
155444
NeutralizeR
11-01-2016, 03:29 PM
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.
beansbaxter
11-01-2016, 03:54 PM
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.
NeutralizeR
11-01-2016, 04:23 PM
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 $durl = 'http://'.$_SERVER['HTTP_HOST'];right below this line there is a line starting with $newtext.
Replace:
$newtext = preg_replace('#<head>#i', "$0\n".'<base href="'.$durl.(defined('VBSEO_BASE_URL')?VBSEO_BASE_URL: '').'/" /><!--[if IE]></base><![endif]-->', $newtext, 1);width:
if(THIS_SCRIPT != 'amp')
{$newtext = preg_replace('#<head>#i', "$0\n".'<base href="'.$durl.(defined('VBSEO_BASE_URL')?VBSEO_BASE_URL: '').'/" /><!--[if IE]></base><![endif]-->', $newtext, 1);}
beansbaxter
11-01-2016, 04:54 PM
Open vbseo\includes\functions_vbseo.php, find $durl = 'http://'.$_SERVER['HTTP_HOST'];right below this line there is a line starting with $newtext.
Replace:
$newtext = preg_replace('#<head>#i', "$0\n".'<base href="'.$durl.(defined('VBSEO_BASE_URL')?VBSEO_BASE_URL: '').'/" /><!--[if IE]></base><![endif]-->', $newtext, 1);width:
if(THIS_SCRIPT != 'amp')
{$newtext = preg_replace('#<head>#i', "$0\n".'<base href="'.$durl.(defined('VBSEO_BASE_URL')?VBSEO_BASE_URL: '').'/" /><!--[if IE]></base><![endif]-->', $newtext, 1);}
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.
NeutralizeR
11-01-2016, 04:56 PM
You are welcome :)
nw-fotografie
11-01-2016, 07:17 PM
Great stuff!
How can we put a link in the thread tools section?
Thanks for support!
Greetings
Klaus
nw-fotografie
11-01-2016, 07:32 PM
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?
NeutralizeR
11-04-2016, 09:43 AM
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.
I have "Missing structured data element" in google webmasters.
I checked your pages and found this:
xxxxx
"@id":"https://www.msxlabs.org/forum/amp/505911.html",
"mainEntityOfPage":"https://www.msxlabs.org/forum/amp/505911.html",
"datePublished":"2016-10-29T03:33:19+03:00",
"dateModified":"2016-10-29T19:41:46+03:00",
xxxxx
I need some help with this datePublished and DateModified.
with $threadinfo[dateline & lastpost] I get unix date format.
Regards,
NeutralizeR
11-04-2016, 02:21 PM
http://searchengineland.com/amp-pages-no-longer-need-structured-data-valid-google-search-console-255016
You can check this example regarding dates in unix format:
$datepublished = date('c', $post['dateline']);
Masterix
11-04-2016, 05:54 PM
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:
'^amp\.php\?t=(\d+)' => 'amp/$1.html'or
'^amp\.php\?t=(\d+)&page=(\d+)$' => 'amp/$1-$2.html'
Thanks, Google is crawling now
nw-fotografie
11-04-2016, 08:15 PM
Great job! Thanks a lot!
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.
Masterix
11-05-2016, 06:53 AM
You don't actually need to rewrite AMP pages. AMP pages will be served by Google once they are crawled.
[...]
Thats right but you need to change your vBSEO-settings to get AMPlike-URLs
See there https://vborg.vbsupport.ru/showpost.php?p=2577466&postcount=13
Thanks again for your top Addon ! :up:
Kindly share if anyone use and figure how to disable ame on amp pages.
https://vborg.vbsupport.ru/showthread.php?t=303416
or a possible alternative to ame.
NeutralizeR
11-07-2016, 01:18 PM
Kindly share if anyone use and figure how to disable ame on amp pages.
https://vborg.vbsupport.ru/showthread.php?t=303416
or a possible alternative to ame.
Check these pages:
https://www.ampproject.org/docs/guides/amp_replacements
https://www.ampproject.org/docs/guides/iframes
Check the preg_replace examples in the amp.php file.
//Remove&Replace stuff for AMP validation
citeman
01-09-2017, 10:16 PM
Hi NeutralizeR, Thanks for this incredible mod to get AMP threads going.
I am however unable to get the url structure of the AMP threads to be like yours - .org/forum/amp/249347.html.
Adding the VBSEO custom rewrite rule:
'^amp\.php\?t=(\d+)&page=(\d+)$' => 'amp/$1-$2.html'
Is giving an error when I try to load the rewritten URL. Am I missing something here?
Emad ELsayed
01-29-2017, 06:58 PM
Hello dear
Thank you very much for the featured product
Installation was successfully 3.8.10
Please check my site and whether everything is fine
http://www.lover3moon.com/vb/showthread.php?t=184366
http://www.lover3moon.com/vb/amp.php?t=184366
I have error when checking link
https://validator.ampproject.org/#url=http%3A%2F%2Fwww.lover3moon.com%2Fvb%2Famp.ph p%3Ft%3D184366
Best regards
carlosacgj
01-31-2017, 12:58 PM
Hello dear
Thank you very much for the featured product
Installation was successfully 3.8.10
Please check my site and whether everything is fine
http://www.lover3moon.com/vb/showthread.php?t=184366
http://www.lover3moon.com/vb/amp.php?t=184366
I have error when checking link
https://validator.ampproject.org/#url=http%3A%2F%2Fwww.lover3moon.com%2Fvb%2Famp.ph p%3Ft%3D184366
Best regards
I have the same validation problems and I thought that only happened to me ....
dr-php
03-19-2017, 06:57 PM
Hello,
plugin not working with me
we show blank page on visit any post included amp
example :
http://www.amalh.net/test/amp.php?t=1
hosamalzagh
05-10-2017, 10:33 PM
I have the same validation problems and I thought that only happened to me ....
i can repair all error for 50$
FelipeB
06-08-2017, 03:27 PM
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...
Is there some news about this?
pri.studynama
06-26-2017, 04:58 AM
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.
Cheers,
An avid VB user!
Akeles
08-24-2017, 09:44 AM
I added it to my forum with some edits
dany_danay
12-10-2017, 03:02 PM
Someone can edit to 4.2?
Someone can edit to 4.2?
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.
unitedpunjab
02-14-2018, 09:16 AM
attachments are not showing on amp pages, any solution ?
m7sen
08-17-2018, 01:55 AM
hi
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
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 also test it on https://search.google.com/test/amp
it said:
Custom JavaScript is not allowed.
line 446:5
<script type="text/javascript">
I tried to remove Google Analytics but it doesn't work!
Update ***************
I fix it.
open ampthread template.
search on:
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-ad" src="https://cdn.ampproject.org/v0/amp-ad-0.1.js"></script>
<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
move it to be above
<style amp-custom>
body {
search on
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
add this under it
<script async custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.1.js"></script>
--------------------
Another issue comes on theads pages
https://www.xxxxxx.com/vb/amp.php?t=127909&page=140
is will give you this error on amp google test
Forbidden or incorrect use of the HTML tag
The 'nowrap' attribute can not appear in the 'td' tag.
<td class="alt1" nowrap="nowrap"><a class="smallfont" href="amp.php?t=127909&page=216" title="last page - Results 1,076 to 1,077 from 1,077"><strong>?</strong></a></td>
i tried to fix it, and it's work with me but I don't know if it currect
go to pagenav tamplete
search on:
nowrap="nowrap"
change it to:
style="white-space:nowrap"
End ***************
* There are general issue
very important! must add schema.org data
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "NewsArticle",
"headline": "Article headline",
"image": [
"thumbnail1.jpg"
],
"datePublished": "2015-02-05T08:00:00+08:00"
}
</script>
but the problem is I don't know how to edit the information like:
"@context": "http://schema.org",
"@type": "NewsArticle",
"headline": "Article headline",
so I tried to make it by using
https://www.google.com/webmasters/markup-helper/
search on
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
add this under it
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "Article",
"name" : "$threadinfo[title]",
"author" : {
"@type" : "Person",
"name" : "$post[username]"
},
"datePublished" : "$post[postdate] - $post[posttime]",
"image" : "$post[avatarurl]",
"articleSection" : "$vboptions[bburl]/Channel$foruminfo[forumid]",
"articleBody" : "$post[message]",
"url" : "$vboptions[bburl]/blackberry$threadid.html",
"publisher" : {
"@type" : "Organization",
"name" : "$vboptions[bbtitle]"
"url" : "$vboptions[bburl]",
}
}
</script>
now the problem in those
"name" : "$post[username]"
"datePublished" : "$post[postdate] - $post[posttime]",
"articleBody" : "$post[message]",
I tried to fix it but it doesn't show on "View page source"
another issue, there is no choose to turn amp off or run it again.
* My issue
- I have an issue using DBSEO, need to change the link to be
amp.php?t=32366 => amp-t32366.html
i tried any&every thing
'amp.php?t(.+)' => 'amp-t$1'
'amp.php?t=(.*)' => 'amp-t(.*).html'
'amp.php?t=(.*)' => 'amp-t$1.html'
'^amp\.php\?t=(\d+)' => '/amp/$1'
'^amp\.php\?t=(\d+)' => 'amp/$1.html'
'^amp\.php\?t=(\d+)' => 'amp-t$1.html'
'^amp\.php\?t=(\d+)&page=(\d+)$' => 'amp-t$1-$2.html'
but nothings work!
I also need to make the template RTL.
some Idea !
- 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 !
any help ?
m7sen
08-18-2018, 10:50 PM
Bugs!
I got new issue from theards in the posts
An HTML tag is blocked on an equivalent speed mobile page.
The tag 'img' may only appear as a descendant of tag 'noscript'. Did you mean 'amp-img'?
<img style="filter:fliph" border="0" src="xxxx" border="0" /><br />
I'm trying to fix it.
I i tried to fix this line in class_bbcode.php file
return "<img src=\"$sigpic_url\" alt=\"$description\" border=\"0\" />";
to be
if (THIS_SCRIPT == 'amp')
{
return "<img-amp src=\"$sigpic_url\" alt=\"$description\" border=\"0\" ></amp-img>";
} //amp hack
else if ($this->registry->userinfo['userid'] == 0 OR $this->registry->userinfo['showimages'])
{
return "<img src=\"$sigpic_url\" alt=\"$description\" border=\"0\" />";
}
but nothing happend!
the problem is this line
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
in class_bbcode.php file doesn't affect the posts!
Its just affect the first post only!
---------------
css 'tg' & 'table' issue
CSS syntax error in tag 'td' - invalid declaration.
CSS syntax error in tag 'table' - invalid declaration.
I think the problem from bbcode_quote tamplete
<if condition="THIS_SCRIPT == 'amp'">
<div class="bbcode-quote">
<div class="bbcode-quote-text">
<div class="smallfont time">$vbphrase[quote]</div>
<if condition="$show['username']">
<span class="smallfont">
<phrase 1="$username">$vbphrase[originally_posted_by_x]</phrase>
<if condition="$postid"><a class="font15" href="showthread.php?$session[sessionurl]p=$postid#post$postid" title="$vbphrase[view_post]" rel="nofollow"><b>»</b></a></if>
</span>
<div class="msx-quote"><p>$message</p></div>
<else />
<div class="msx-quote"><p>$message</p></div>
</if>
</div>
</div>
<else />
<div style="margin:20px; margin-top:5px; <if condition="$show['iewidthfix']">width: 100%;</if>">
<div class="smallfont" style="margin-bottom:2px">$vbphrase[quote]:</div>
<table cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%">
<tr>
<td class="alt2" style="border:1px inset">
<if condition="$show['username']">
<div>
<phrase 1="$username">$vbphrase[originally_posted_by_x]</phrase>
<if condition="$postid"><a href="showthread.php?$session[sessionurl]p=$postid#post$postid" rel="nofollow"><img class="inlineimg" src="$stylevar[imgdir_button]/viewpost.gif" border="0" alt="$vbphrase[view_post]" /></a></if>
</div>
<div style="font-style:italic">$message</div>
<else />
$message
</if>
</td>
</tr>
</table>
</div>
</if>
I couldn't fix it :(
I'm afraid I must to remove every things! because those issues make the site die.
esskmk
08-07-2020, 08:12 AM
It does not work.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.