[wordpress插件] Display CPG Thumbnails显示CPG缩略图

wordpress 插件 文章 2020-04-19 09:01 521 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

The plugin is intended to create a number of links which you can display on your wordpress page.

该插件旨在创建许多链接,您可以在您的wordpress页面上显示这些链接。

Each link is represented by a thumbnail image which exists within the associated CPG Gallery.

每个链接都由关联的CPG库中存在的缩略图表示。

Clicking on a link will take you to the associated picture within the CPG application.

单击链接将带您到CPG应用程序中的关联图片。

There are a number of parameters which indicate how many images to display per row and how many columns, along with size information and flexible caption (user defined information).

有许多参数指示每行显示多少图像和几列,以及尺寸信息和灵活的标题(用户定义的信息)。

As one of the parameter driven data points which can be used in the caption is user name.

由于可以在标题中使用的参数驱动数据点之一是用户名。

For this reason the plugin will work correctly if the CPG Gallery is ‘bridged’ to phpbb or not (in the case in which it is bridged, the user name is pulled from the phpbb database).

因此,无论CPG Gallery是否“桥接”到phpbb,插件都可以正常工作(在桥接的情况下,用户名是从phpbb数据库中提取的。)

One of the very nice features of the plug in is that you can specify the maximum number of images for one user (or the maximum number of images for one album).

该插件的一个很好的功能之一就是您可以为一个用户指定最大图像数量(或为一个相册指定最大图像数量)。

If you are displaying the latest uploaded images and one user has just uploaded a bunch of images, this helps keep the display ‘balanced’ and present a cross section of images on your page.

如果您显示的是最新上传的图像,而一个用户刚刚上传了一堆图像,则可以使显示保持“平衡”并在页面上显示图像的横截面。

安装步骤

    1. Copy to your plugin folder.
    2. 复制到您的插件文件夹。

    3. Activate the plugin.
    4. 激活插件。

    5. Go to Widgets.

    6. 转到小部件。

    7. Drag the widget to the desired sidebar.
    8. 将小部件拖动到所需的侧边栏。

    9. Establish the required parameter values on the Widget Screen.
    10. 在窗口小部件屏幕上建立所需的参数值。

    11. Edit and set the DEFINE statemtents to correspond with your environment in the script ‘DisplayCPGThumbnailsGuts.php’.
    12. 在脚本“ DisplayCPGThumbnailsGuts.php”中编辑并设置DEFINE状态要与您的环境相对应。

    Widget Setup

    小部件设置

      • Title: Type in the desired title.
      • 标题:输入所需的标题。

      • CPG Config Location: This is the file location of your CPG Config file.

      • CPG配置位置:这是CPG配置文件的文件位置。

        There is a Document Root Path display on the bottom of the screen to help you with this.

        屏幕底部显示一个“文档根路径”,以帮助您解决此问题。

        This file is in your CPG Directory and is conifg.inc.php.

        该文件在您的CPG目录中,并且是conifg.inc.php。

        The indicated location is the full file location and not the URL.

        指示的位置是完整的文件位置,而不是URL。

      • Random or Update: This radio box selects if the display of selected thumbnails is random or update.
      • 随机或更新:此单选框选择所选缩略图的显示是随机还是更新。

      • Number Images: The number of images to be displayed, must be a numeric integer value between 1 and 100 inclusive.
      • 图片数量:要显示的图片数量,必须是1到100之间的数字整数值。

      • Max Per Album: The maximum number of images that can be displayed from any one album.

      • 每个相册的最大数量:任何一个相册可以显示的最大图像数量。

        A value of -1 means the field is ignored.

        值-1表示该字段被忽略。

        Values allowed are between 1 and 5 inclusive.

      • 允许的值在1到5之间(包括1和5)。

      • Max Per User: The maximum number of images to be displayed from any one user.

      • 每个用户的最大数量:任何一个用户要显示的最大图像数量。

        A value of -1 means the field is ignored.

        值-1表示该字段被忽略。

        Values allowed are between 1 and 5 inclusive.

      • 允许的值在1到5之间(包括1和5)。

      • Thumb Width: The maximum width of the thumbnail displayed, in pixels.

      • 缩略图宽度:显示的缩略图的最大宽度,以像素为单位。

        A value of -1 means the field is ignored.

        值-1表示该字段被忽略。

        Valid values are between 50 and 100 inclusive.

      • 有效值介于50和100之间。

      • Thumb Height: The maximum height of the displayed thumbnail in pixels.

      • 缩略图高度:显示的缩略图的最大高度(以像素为单位)。

        A value of -1 means the field is ignored.

        值-1表示该字段被忽略。

        Valid values are between 50 and 100 inclusive.

      • 有效值介于50和100之间。

      • NBR of TBL Cols: The number of columns displayed.

        TBL列的

      • NBR:显示的列数。

        If -1 is entered the output is not returned as a html table, otherwise values must be between 1 and 12 inclusive.

        如果输入-1,则输出不作为html表返回,否则值必须在1到12之间(包括1和12)。

      • Caption Options: This controls the captioning text.

      • 字幕选项:控制字幕文本。

        Valid options are ‘USR’ (for user name), ‘DTE’ (for upload date), ‘TIT’ (for picture title) and ‘CAP’ (for picture caption).

        有效选项为“ USR”(用于用户名),“ DTE”(用于上传日期),“ TIT”(用于图片标题)和“ CAP”(用于图片标题)。

        These are entered as you want text displayed below your thumbnails.

        输入这些内容是因为您希望在缩略图下方显示文本。

        The values are entered separated by ‘/’, eg.

        输入的值以“ /”分隔,例如。

        DTE/TIT to display only a date and title.

      • DTE / TIT仅显示日期和标题。

      • Caption Prefixes: The prefix displayed before the caption option.

      • 字幕前缀:在字幕选项之前显示的前缀。

        These are entered separated by ‘/’ and are free text.

      • 这些输入用“ /”分隔,是自由文本。

      • Caption Lengths: Indicates the length in bytes of the associated caption option.
      • 字幕长度:指示相关字幕选项的长度(以字节为单位)。

      • Caption Cont.

      • 字幕续

        Text: This is the text you want after the max length has been reached and that caption option has been trunctated.

        文本:这是在达到最大长度并且该标题选项已被截断后想要的文本。

        For example, ‘…’ would do something like ‘my new do…’ if the length was set to 9.

      • 例如,如果长度设置为9,则“…”将执行类似“我的新动作…”的操作。

      • Document Root Path: For display only.

      • 文档根路径:仅用于显示。

        Indicates the root file path.

        指示根文件路径。

        This will be helpful in setting up the CPG Config Location.

      • 这将有助于设置CPG配置位置。

      • Parameter Validation Return Area: For display only.

      • 参数验证返回区:仅用于显示。

        Indicates if there are any errors.

      • 指示是否存在任何错误。

      Defines in DisplayCPGTHumbnailsGuts.php

      在DisplayCPGTHumbnailsGuts.php中定义

      You will need to set up these variables depending on your requirements and setup.

      您将需要根据您的要求和设置来设置这些变量。

      The only item that is mandatory to set is the BRIDGEDtoPHPBB3.

      唯一必须设置的项目是BRIDGEDtoPHPBB3。

      All of these items are defines in the script because once set up they will not normally ever need to be modified.

      所有这些项目都是在脚本中定义的,因为一旦设置,通常将不需要修改它们。

        • define(“BRIDGEDtoPHPBB3”, TRUE);

        • define(“ BRIDGEDtoPHPBB3”,TRUE);

          -> This indicates if your CPG environment is ‘bridged’ to a phpbb3 forum.

          ->这表示您的CPG环境是否已“桥接”到phpbb3论坛。

          This is important since if your CPG environment is bridged to a forum the user name will be in the forum database (not within CPG).

          这很重要,因为如果您的CPG环境已桥接到论坛,则用户名将位于论坛数据库中(而不是CPG内)。

          Since the user name is displayed as a part of the caption this is important.

          由于用户名显示为标题的一部分,因此这很重要。

        • define(“sqldb_MAX_READS”, -1);

        • define(“ sqldb_MAX_READS”,-1);

          -> This is the max number of reads if not -1.

          ->如果不是-1,则为最大读取次数。

          Recommend just leaving it as -1 unless it is required for performance.

        • 除非性能需要,否则建议将其保留为-1。

        • define(“scaleImages”, FALSE);

        • define(“ scaleImages”,FALSE);

          -> This indicates if the images are to be ‘scaled’.

          ->这表示是否要“缩放”图像。

          If this is set to true (not recommended) both the width and height directives will be used on the img tag.

        • 如果将其设置为true(不建议),则img标签上将同时使用width和height指令。

        • define(“sizeDownOnly”, TRUE);

        • define(“ sizeDownOnly”,TRUE);

          -> If set to true will not increase the size of the image.

          ->如果设置为true,则不会增加图像的大小。

          Example, actual image height is 80 px, height is indicated as 100 px, the displayed image will be 80.

        • 例如,实际图像高度为80像素,高度指示为100像素,显示的图像将为80。

        CSS

        CSS

        You will need to add some CSS to your wordpress theme.

        您将需要在您的wordpress主题中添加一些CSS。

        This normally goes into the style.css file in your theme folder.

        这通常进入主题文件夹中的style.css文件。

        There may be some more CSS you need to integrate the widget into your theme.

        可能需要更多CSS才能将小部件集成到主题中。

        You can see the full scope of css at coolthaihouse by using firebug.

        您可以使用Firebug在coolthaihouse 上查看CSS的全部范围。

        table.CPGImage{   

          table.CPGImage {   

        border: none !important;   

        边界:无重要!   

        margin: 0px 0px 0px 3px !important;   

        margin:0px 0px 0px 3px!重要;   

        width: auto !important;}

        宽度:自动!important;}

        .CPGImage tr td {border-width: 0px 1px 0px 1px !important;    

        .CPGImage tr td {border-width:0px 1px 0px 1px!important;    

        border-color: #E4E2DB !important;    

        border-color:#E4E2DB!important;    

        border-style: dotted !important;    

        边框样式:点缀!重要;    

        padding: 2px 2px 2px 2px !important;}

        填充:2px 2px 2px 2px!important;}

        table.CPGImage td:first-child {border-left: 0 !important;}

        table.CPGImage td:first-child {border-left:0!important;}

        table.CPGImage td:last-child {border-right: 0 !important;}

        table.CPGImage td:last-child {border-right:0!important;}

        .CPGImage tr td {margin-bottom: 3px !important;}

        .CPGImage tr td {margin-bottom:3px!important;}

        .CPGImage p {   

        .CPGImage p {   

        width: 90px !important;   

        宽度:90px!重要;   

        margin-bottom: 0px !important;   

        margin-bottom:0px!important;   

        margin-right: 2px !important;   

        margin-right:2px!important;   

        padding-right: 2px !important;   

        padding-right:2px!important;   

        margin-left: 2px !important;   

        margin-left:2px!important;   

        margin-right: 2px !important;   

        margin-right:2px!important;   

        font-size: 9px !important;   

        font-size:9px!important;   

        vertical-align: bottom !important;   

        垂直对齐:底部!重要;   

        text-align: left !important;   

        text-align:左!重要;   

        line-height: 1.1em !important;   

        行高:1.1em!important;   

        word-wrap: break-word !important;   

        自动换行:断字!重要;   

        clear: both !important;    

        清楚:两者都重要!    

        }

        }

        Table

        If the NBR of TBL Cols is used (not -1) the output is tabelized.

        如果使用TBL Cols的NBR(而不是-1),则将表显示为表格。

        The resultant tabel looks something like this:        

         生成的表格看起来像这样:        

                    

                    

                        

                        

                        

                        

                            

                            

                        

        <带有文本p的a href和img标签>                

                    

                    

        etc.

        等等

        下载地址
        https://downloads.wordpress.org/plugin/display-cpg-thumbnails.1.0481.zip
        -EOF-

        AI助手支持GPT4.0