Plugin Directory

Changeset 2260538


Ignore:
Timestamp:
03/13/2020 01:40:49 PM (6 years ago)
Author:
vthierry
Message:

from makefile

Location:
http-syndication/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • http-syndication/trunk/http_syndication.php

    r2259310 r2260538  
    22/**
    33 * Plugin Name: http-syndication
     4 * Plugin URI: https://wordpress.org/plugins/http-syndication/
    45 * Description: Allows to offer the content of page to other sites and import content from this or other sites.
    5  * Version: 1.6
     6 * Version: 1.7
    67 * Author: Thierry.Vieville@inria.fr
    78 * Author URI: http://www-sop.inria.fr/members/Thierry.Vieville
     
    9596        $content = str_replace(']]>', ']]>', $content);
    9697        unset($this->import_ids[$atts['id']]);
     98        $content = $this->http_syndication_encapsulate($content, $atts);
    9799        return self::html_repair($content);
    98100      } else
     
    125127          $content = apply_filters($filter, $content, $atts);
    126128          }
     129          $content = $this->http_syndication_encapsulate($content, $atts);
    127130          return self::html_repair($content);
    128131        }         
     
    202205     }
    203206    $content = substr($content, $begin, $end - $begin);
    204     if (isset($atts['class']))
    205       $content = preg_replace('/<\s*([^\s]*)/', '$0 class="'.$atts['class'].'" ', $content, 1);
    206     if (isset($atts['style']))
    207       $content = preg_replace('/<\s*([^\s]*)/', '$0 style="'.$atts['style'].'" ', $content, 1);
     207    return $content;
     208  }
     209
     210  function http_syndication_encapsulate($content, $atts) {
     211    if (isset($atts['class']) || isset($atts['style']))
     212      $content = "<div".
     213    (isset($atts['class']) ? " class='".$atts['class']."'" : "").
     214    (isset($atts['style']) ? " style='".$atts['style']."'" : "").
     215    ">".$content."</div>";
    208216    return $content;
    209217  }
  • http-syndication/trunk/readme.txt

    r2259310 r2260538  
    1212This plugins offers the following "ground" functionnalities:
    1313
    14 1. Display the content of a post or page without any header, sidebar and footer.
    15 2. Importing an internal content of the wordpress site
    16 3. Importing the content from an external web site
    17 4. A few other deprecated functionalities
     14* 1. Display the content of a post or page without any header, sidebar and footer.
     15* 2. Importing the content from an external web site
     16* 3. Importing an internal content of the wordpress site
     17* 4. A few other deprecated functionalities
    1818
    1919= 1. Displaying a post or page without any header, sidebar and footer =
     
    2727* `#mywordpressadress` is the wordpress web site adress.
    2828* `#post_or_page_id` is the post or page id (you can read the post id in the http link when you edit the post).
    29 * `#1_or_0 defines whether the post title  (enclosed in `<h1>` HTML tag) is displayed (default is `1`, i.e., true).
     29* `#1_or_0` defines whether the post title  (enclosed in a `<h1>` HTML tag) is displayed (default is `1`, i.e., true).
    3030
    3131*Remarks:*
     
    3333* The post content is exported after filtering.
    3434
    35 = 2. Importing an internal content of the wordpress site =
    36 
    37 In order to import a post or page contents in another post or page, use the following shortcode:
    38 
    39 * `[import id="#post_or_page_id"]` to include the filtered content of another post or page in the current content.
    40 * `[import id="#post_or_page_id" content=1]` to include the raw (with shortcode expanded, but not content filter applied) of another post or page in the current content (to be used only if required).
    41 * `[import id="#post_or_page_id" title=1]` to include the title of another post or page in the current content.
    42 
    43 where:
    44 
    45 * `#post_or_page_id` is the post or page id (you can read the post id in the http link when you edit the post).
    46 
    47 *Remarks:*
    48 
    49 * This avoids spurious import, e.g. of social media buttons (contrary to usual [include plugins](http://wordpress.org/plugins/search.php?q=include)).
    50 * Shortcode recursion is managed (i.e. stopped when an infinite loop is detected).
    51 
    52 = 3. Importing the content from an external web site =
     35= 2. Importing the content from an external web site =
    5336
    5437In order to import an external a post or page contents in another post or page, use the following shortcode:
     
    7255  * `raw_href=1` : in order to provide raw href values, instead of properly relocating relative href in the source HTML code, as done by default.
    7356  * `mediawiki=1` : adds the `?printable=yes&action=render` query to the URL, in order to properly syndicate mediawiki sites.
    74   * `style=#style` or `class=#class` allows to add a customized class or style attribute to the tag.
     57  * `style=#style` or `class=#class` allows to encapsulate the content in a `<div .` with customized class and/or style attribute.
    7558
    7659*Example* :
     
    8871  * The [embed](http://codex.wordpress.org/Embeds) shortcode is a core WordPress feature. It can embed content from many resources via direct link, and the [iframe](http://www.w3schools.com/tags/tag_iframe.asp) allows to safely and obviously include any external site page in "frame". The [iframe plugin](http://wordpress.org/plugins/iframe) works well and properly make the job. The present import is a 3rd alternative, to be preferred when the former fail or mixing pages content is required.
    8972
     73= 3. Importing an internal content of the wordpress site =
     74
     75In order to import a post or page contents in another post or page, use the following shortcode:
     76
     77* `[import id="#post_or_page_id"]` to include the filtered content of another post or page in the current content.
     78* `[import id="#post_or_page_id" content=1]` to include the raw (with shortcode expanded, but not content filter applied) of another post or page in the current content (to be used only if required).
     79* `[import id="#post_or_page_id" title=1]` to include the title of another post or page in the current content.
     80
     81where:
     82
     83* `#post_or_page_id` is the post or page id (you can read the post id in the http link when you edit the post).
     84
     85*Remarks:*
     86
     87* This avoids spurious import, e.g. of social media buttons (contrary to usual [include plugins](http://wordpress.org/plugins/search.php?q=include)).
     88* Shortcode recursion is managed (i.e. stopped when an infinite loop is detected).
    9089
    9190= 4. A few other deprecated functionalities =
     
    118117
    119118== Changelog ==
     119
     120= 1.7 =
     121
     122Improve the introduction of style or class in import.
    120123
    121124= 1.6 =
Note: See TracChangeset for help on using the changeset viewer.