Thread: Integration with vBulletin - Accelerated Mobile Pages for vBulletin
View Single Post
  #47  
Old 08-17-2018, 01:55 AM
m7sen m7sen is offline
 
Join Date: Mar 2014
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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 resourcethe 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 resourcethe 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
PHP Code:
<script type="text/javascript"
I tried to remove Google Analytics but it doesn't work!

Update ***************

I fix it.
open ampthread template.

search on:
PHP Code:
<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
PHP Code:
<style amp-custom>
body 
search on
PHP Code:
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"
add this under it
PHP Code:
<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
PHP Code:
Forbidden or incorrect use of the HTML tag
The 
'nowrap' attribute can not appear in the 'td' tag.

    <
td class="alt1" nowrap="nowrap"><class="smallfont" href="amp.php?t=127909&amp;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:
PHP Code:
nowrap="nowrap" 
change it to:
PHP Code:
style="white-space:nowrap" 
End ***************

* There are general issue
very important! must add schema.org data
PHP Code:
    <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:
PHP Code:
"@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
PHP Code:
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"
add this under it
PHP Code:
<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
PHP Code:
  "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
PHP Code:
amp.php?t=32366 => amp-t32366.html 
i tried any&every thing
PHP Code:
'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 ?
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01152 seconds
  • Memory Usage 1,865KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (16)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete