Skip to content

Commit

Permalink
Display Clean, New Options
Browse files Browse the repository at this point in the history
  • Loading branch information
cogdog committed May 1, 2019
1 parent 0192dfd commit 7a73f3e
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 78 deletions.
21 changes: 4 additions & 17 deletions README.md
Expand Up @@ -180,23 +180,9 @@ You can follow the link to create an account; for an email you can use a fictiti

** Note: As of version 1.1 of TRU Collector you no longer need to copy the password into the options page. ** If you are using a version of the theme that has a password field in the options, maybe it's a good time to update? Otherwise, [see an older version of this ReadMe](https://github.com/cogdog/tru-collector/blob/a8637ef4739a6aa64210fee5ddffe8426cfa62b3/README.md#author-account-setup) for instructions.

### JetPack Post by Email (optional)
### JetPack Post by Email (no longer built in)

![](images/jetpack-not-installed.jpg)

You can enable a feature that allows people to add an image to your site simply by sending it via email. This uses the Post By Email module that is part of the [Wordpress Jetpack plugin](http://jetpack.me/). The options will check that the plugin is installed and that the module is enabled.

The subject line of the email becomes the title, the body of the email the content, and the first image attached becomes the Collectable -- that is why we suggest using a plugin such as [Auto Thumbailer](https://wordpress.org/plugins/auto-thumbnailer/) that converts the first image to the theme's featured image.

To create an email address that can post via this plugin, any authenticated admin or editor user can generate the `*********@post.wordpress.com` address via their profile; you need not add it to the Collector user as you can only generate it for an account you are logged in to Wordpress with.

The field here is just to keep the email address as a reference; it is not used anywhere in the site-- you most likely do not want to have this email address posted in a public space as it allows direct posting to the site.

We (well I, the person writing this) recommend creating an email forwarding address to use as the one that you share; for example, if the email address I set up as a forwarder was `quickpost@splot.ca` and made to forward to `*********@post.wordpress.com` if I need to change the address, I can just do so at the Wordpress level, update my forwarder, and never have to tell people a new address to use.

Also, your site looks a tad more credible without use of a `wordpress.com` email address (no offense, Wordpress, we love ya).

Also, if you are using Post By Email, you will need to add the [Auto Thumbnailer plugin](https://wordpress.org/plugins/auto-thumbnailer/) so it generates featured images from the ones sent by email.
This feature was unreliable and the coding around it created problems to minute to make it worthwhile. One could still implement it as a way to post, your mileage will vary.

## Customize the Add / Collect form

Expand Down Expand Up @@ -311,7 +297,8 @@ Go collect stuff!


* **Name the items** New customizer panel to create the name of the item/items in the collection displayed below the site name (replacing generic "item/items")
* **Preview Option** on collect form allows reviewing content in overlay preview before submitting.
* **Better Rich Text Editor** the visual editor will now embed media WordPress supports (YouTube, twitter, soundcloud, etc)
* **Preview Option** on collect form allows reviewing content in overlay preview before submitting (embedded tweets do not render in preview, just a big space).
* **By Licenses Shortcode** useful for putting an indexed list of items by licenses into widget or any page.
* **New Login Code** removes the need to copy the collector user's password to the theme options. The special user account is closed after their item is uploaded. Also, there are new admin notices to activate or install the two recommended plugins
* **Enabled for WP-Ratings** With the Wp-Ratings Plugin installed, you can have front page and single item ratings for items
Expand Down
29 changes: 12 additions & 17 deletions class.trucollector-theme-options.php
Expand Up @@ -240,6 +240,18 @@ public function get_settings() {
'r' => 'Rich text editor'
)
);

$this->settings['show_sharedby'] = array(
'section' => 'general',
'title' => __( 'Display name of person sharing?'),
'desc' => '',
'type' => 'radio',
'std' => '1',
'choices' => array (
'0' => 'No',
'1' => 'Yes'
)
);


$this->settings['use_source'] = array(
Expand Down Expand Up @@ -358,30 +370,13 @@ public function get_settings() {
)
);


$this->settings['authorcheck'] = array(
'section' => 'general',
'title' => '' ,// Not used for headings.
'desc' => 'Author Account',
'std' => trucollector_author_user_check( 'collector' ),
'type' => 'heading'
);

$this->settings['jetpackcheck'] = array(
'section' => 'general',
'title' => '' ,// Not used for headings.
'desc' => 'JetPack Post By Email',
'std' => splot_jetpack_post_email_check (),
'type' => 'heading'
);

$this->settings['postbyemail'] = array(
'title' => __( 'Post By Email Address' ),
'desc' => __( 'Email address set up for submitting new items by email; it can be associated withany account on this site. We suggest creating a forwarding domain email address to the one generated by the Jetpack Post BY Email plugin. This info is not used anywhere, it is just here to store the email address for your own reference.' ),
'std' => '',
'type' => 'text',
'section' => 'general'
);


/* Reset
Expand Down
6 changes: 5 additions & 1 deletion functions.php
Expand Up @@ -470,6 +470,7 @@ function splot_redirect_url() {
function splot_user_login( $user_login = 'collector' ) {
// login the special user account to allow authoring

// check for the correct user
// check for the correct user
$autologin_user = get_user_by( 'login', $user_login );

Expand Down Expand Up @@ -1309,10 +1310,13 @@ function add_trucollector_scripts() {

// Build in tag auto complete script
wp_enqueue_script( 'suggest' );


// Autoembed functionality in rich text editor
// needs dependency on tiny_mce
// h/t https://wordpress.stackexchange.com/a/287623
wp_enqueue_script( 'mce-view' );

wp_enqueue_script( 'mce-view', '', array('tiny_mce') );


// custom jquery for the uploader on the form
Expand Down
2 changes: 1 addition & 1 deletion header.php
Expand Up @@ -62,7 +62,7 @@
<?php endif; ?>

<div class="siteblurb"><strong><?php $item_count = wp_count_posts()->publish; echo $item_count ?></strong> total <?php
if ( $item_count === 1 ) {
if ( $item_count == 1 ) {
trucollector_collection_single_item();
} else {
trucollector_collection_plural_item();
Expand Down
3 changes: 2 additions & 1 deletion includes/lightbox/js/lightbox_preview.js
Expand Up @@ -137,7 +137,8 @@ function nl2br (str, is_xhtml) {

// using visual editor?
if ( $("#wp-wTextHTML-wrap").hasClass("tmce-active") ){
wtext = tinymce.get('wTextHTML').getContent();
wtext = $('#wTextHTML_ifr').contents().find("html").html()


// using HTML editor
} else {
Expand Down
8 changes: 8 additions & 0 deletions index.php
Expand Up @@ -38,6 +38,14 @@
<div class="clear"></div>

</h4>

<?php
// Show an optional term description.
$term_description = term_description();
if ( ! empty( $term_description ) ) :
printf( '<div class="taxonomy-description">%s</div>', $term_description );
endif;
?>

</div><!-- .section-inner -->

Expand Down
57 changes: 18 additions & 39 deletions singular.php
Expand Up @@ -83,48 +83,27 @@
</div><!-- .post-header -->

<div class="post-content">


<?php if ( is_single() AND $wAuthor == '') : // empty meta data for author means post by email ?>

<?php
// strip the img tags out of content for stuff sent by email
$content = get_the_content();
$content = preg_replace("/<img[^>]+\>/i", "", $content);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
echo $content;
?>

<hr />

<p><em>This item was posted by email.</em></p>


<?php else:?>


<?php if ( $post_format == 'video' ) {
$content = $content_parts['extended'];
$content = apply_filters( 'the_content', $content );
echo $content;
} else {
the_content();
}
?>

<?php the_content();?>

<?php endif; // is_single AND $wAuthor == '' ?>

<?php if ( is_single() ): ?>
<p>
<?php
// Sharer
echo '<strong>Shared by:</strong> ' . $wAuthor . '<br />';

if ( ( trucollector_option('use_source') > 0 ) AND $wSource ) echo '<strong>Image Credit:</strong> ' . make_links_clickable($wSource) . '<br />';



if ( trucollector_option('show_sharedby') AND !empty($wAuthor) ) {
echo '<strong>Shared by:</strong> ' . $wAuthor . '<br />';
}


if ( ( trucollector_option('use_source') > 0 ) AND !empty($wSource) ) {
echo '<strong>Image Credit:</strong> ' . make_links_clickable($wSource) . '<br />';
}

if ( trucollector_option('use_license') > 0 ) {
if ( trucollector_option('use_license') > 0 AND !empty($wLicense) ) {
echo '<strong>Reuse License:</strong> ';
trucollector_the_license( $wLicense );
echo '<br />';
Expand All @@ -136,18 +115,18 @@
}

?>
<?php if ( trucollector_option( 'show_link' ) != 0 ) :?>
<?php if ( trucollector_option( 'show_link' ) != 0 AND has_post_thumbnail() ) :?>

<form>
<form>
<label for="link">Link to image:</label>
<input type="text" class="form-control" id="link" value="<?php $iurl = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); echo $iurl[0]; ?>" onClick="this.select();" />
</form>
</form>

<?php endif;?>


</p>
<?php endif; // is_single?>


</div><!-- .post-content -->

<div class="clear"></div>
Expand Down
17 changes: 15 additions & 2 deletions style.css
@@ -1,8 +1,8 @@
/*
Theme Name: TRU Collector
Theme URI: https://github.com/cogdog/tru-collector
Description: SPLOT Image Collector (Child of Fukasawa)
Version: 1.54
Description: SPLOT Image Collector (Child of Fukasawa) for sites built around shared collections of images
Version: 1.6
Template: fukasawa
Author: CogDog
Author URI: https://cog.dog/
Expand Down Expand Up @@ -81,6 +81,15 @@ h1.blog-title {
border: none;
}

.taxonomy-description p {
margin: 0.5em 10px;
font-size: 0.8em;
font-weight: 400;
font-style: italic;
color: #999;
}


/* media uploader */
.upload-instructions, .max-upload-size {
text-align: center;
Expand Down Expand Up @@ -216,4 +225,8 @@ h1.blog-title {
margin: 1em;
font-size: 0.75rem
}

.blog-title {
margin-right: 0;
}
}

0 comments on commit 7a73f3e

Please sign in to comment.