コード例 #1
0
ファイル: A_init.py プロジェクト: wulliam/blogitizor
# This is the URL that points to the pingback and trackback public
# functions. This exposes the reception of trackback form POST and
# pingback xmlrpc handler.
#
plugin_linkback_pingback_server = request.env.http_host + URL(r=request, c='plugin_linkback', f='call', args='xmlrpc')
plugin_linkback_trackback_server = request.env.http_host + URL(r=request, c='plugin_linkback', f='receive_trackback')

#-----------------------------------------------------------------------

# Adds pingback headers as to specification.
# You must expose the trackback RDF tags manually.

response.headers['X-Pingback'] = plugin_linkback_pingback_server
response.files.append('<link rel="pingback" href="'+plugin_linkback_pingback_server+'" />')
#-----------------------------------------------------------------------
plugin_linkback.settings = Storage()

# This function is EXTREMELY important for integration with your
# web2py site. All incoming trackback/pingback requests are saved
# to the database, which contains a ``table_name`` and ``record_id`` 
# field. These fields identify which database table and record 
# that this is referring to. This is like a semi-foriegn-key relationship.
#
# The specification will pass a dictionary of data to this function,
# by using this data this function will determine three things.
# 1) The ``table_name`` for the records
# 2) The ``record_id`` of the record being referenced
# 3) If the record is a valid source that can be linked against.
#
# Refer to the plug-ins example app.
def record_identifier(data):
コード例 #2
0
ファイル: plugin_comments.py プロジェクト: wulliam/blogitizor
# META INFO
###########################################################
plugin_comments = Storage()

plugin_comments.meta = {
    'title': 'Commentizor',
    'author': 'Thadeus Burgess <*****@*****.**>',
    'keywords': 'comments, commenting, blog',
    'description': 'Provides a comment framework',
    'copyright': 'GPL v2'
}

# SETTINGS
###########################################################
plugin_comments.settings = Storage()

# Enable recaptcha to post comments
plugin_comments.settings.recaptcha = True

# Should users that are logged into auth get a captcha?
plugin_comments.settings.no_recaptcha_for_users = True

# If a user is logged in, should it prefill their name/email/website information?
plugin_comments.settings.auto_fill_users = True

# If we do auto fill, and the user is logged in, set the defaults.
if plugin_comments.settings.auto_fill_users and auth.is_logged_in():
        plugin_comments.settings.auth_name = "%(first_name)s %(last_name)s" % auth.user
        plugin_comments.settings.auth_email = "%(email)s" % auth.user
        plugin_comments.settings.auth_site = "%(site)s" % auth.user