Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Commit

Permalink
improved blog templates
Browse files Browse the repository at this point in the history
- Different buttons depending on post type
- Count Images in Galleries
- Fix missing Teaser in Messages without images
  • Loading branch information
patkon committed Feb 4, 2021
1 parent d0301ee commit d2350aa
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 28 deletions.
55 changes: 33 additions & 22 deletions core/posts-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,6 @@

}

$this_entry = str_replace("{read_more_text}", $lang['btn_read_more'], $this_entry);
$this_entry = str_replace('{post_href}', $post_href, $this_entry);

$this_entry = str_replace('{post_author}', $get_posts[$k]['post_autor'], $this_entry);
$this_entry = str_replace('{post_title}', $get_posts[$k]['post_title'], $this_entry);
$this_entry = str_replace('{post_teaser}', $post_teaser, $this_entry);
Expand Down Expand Up @@ -275,33 +272,47 @@
$this_entry = str_replace("{post_tpl_event_prices}", $price_list, $this_entry);

/* products */
if($get_posts[$k]['post_product_tax'] == '1') {
$tax = $fc_prefs['prefs_posts_products_default_tax'];
} else if($get_posts[$k]['post_product_tax'] == '2') {
$tax = $fc_prefs['prefs_posts_products_tax_alt1'];
} else {
$tax = $fc_prefs['prefs_posts_products_tax_alt2'];
if($get_posts[$k]['post_type'] == 'p') {

if($get_posts[$k]['post_product_tax'] == '1') {
$tax = $fc_prefs['prefs_posts_products_default_tax'];
} else if($get_posts[$k]['post_product_tax'] == '2') {
$tax = $fc_prefs['prefs_posts_products_tax_alt1'];
} else {
$tax = $fc_prefs['prefs_posts_products_tax_alt2'];
}

$post_price_net = str_replace('.', '', $get_posts[$k]['post_product_price_net']);
$post_price_net = str_replace(',', '.', $post_price_net);

$post_price_gross = $post_price_net*($tax+100)/100;;
$post_price_gross = fc_post_print_currency($post_price_gross);
$post_price_net = fc_post_print_currency($post_price_net);

$this_entry = str_replace("{post_price_gross}", $post_price_gross, $this_entry);
$this_entry = str_replace("{post_price_net}", $post_price_net, $this_entry);
$this_entry = str_replace("{post_price_tax}", $tax, $this_entry);
$this_entry = str_replace("{post_currency}", $get_posts[$k]['post_product_currency'], $this_entry);
$this_entry = str_replace("{post_product_unit}", $get_posts[$k]['post_product_unit'], $this_entry);
$this_entry = str_replace("{post_product_price_label}", $get_posts[$k]['post_product_price_label'], $this_entry);

$this_entry = str_replace("{read_more_text}", $lang['btn_open_product'], $this_entry);
}

$post_price_net = str_replace('.', '', $get_posts[$k]['post_product_price_net']);
$post_price_net = str_replace(',', '.', $post_price_net);

$post_price_gross = $post_price_net*($tax+100)/100;;
$post_price_gross = fc_post_print_currency($post_price_gross);
$post_price_net = fc_post_print_currency($post_price_net);

$this_entry = str_replace("{post_price_gross}", $post_price_gross, $this_entry);
$this_entry = str_replace("{post_price_net}", $post_price_net, $this_entry);
$this_entry = str_replace("{post_price_tax}", $tax, $this_entry);
$this_entry = str_replace("{post_currency}", $get_posts[$k]['post_product_currency'], $this_entry);
$this_entry = str_replace("{post_product_unit}", $get_posts[$k]['post_product_unit'], $this_entry);
$this_entry = str_replace("{post_product_price_label}", $get_posts[$k]['post_product_price_label'], $this_entry);

/* links */
$this_entry = str_replace("{post_external_link}", $get_posts[$k]['post_link'], $this_entry);

$this_entry = str_replace("{post_thumbnails}", $thumbnails_str, $this_entry);
/* gallery */
if($get_posts[$k]['post_type'] == 'g') {
$this_entry = str_replace("{post_thumbnails}", $thumbnails_str, $this_entry);
$this_entry = str_replace("{read_more_text}", $lang['btn_show_gallery'], $this_entry);
$this_entry = str_replace("{cnt_images}", $cnt_thumbs_array, $this_entry);
}

$this_entry = str_replace("{read_more_text}", $lang['btn_read_more'], $this_entry);
$this_entry = str_replace('{post_href}', $post_href, $this_entry);

$posts_list .= $this_entry;

Expand Down
2 changes: 2 additions & 0 deletions lib/lang/de/dict-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
$lang['link_register'] = "Jetzt registrieren ...";
$lang['btn_read_more'] = "weiter lesen";
$lang['btn_download'] = "Download";
$lang['btn_show_gallery'] = "Alle {cnt_images} Bilder anzeigen";
$lang['btn_open_product'] = "Weitere Informationen";

/* Messages */
$lang['msg_missingfield'] = "Alle Felder müssen ausgefüllt werden";
Expand Down
5 changes: 3 additions & 2 deletions lib/lang/en/dict-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@
$lang['button_acp_edit_page'] = "Edit Page";
$lang['link_delete_avatar'] = "Delete Avatar";
$lang['link_register'] = "Register now ...";
$lang['btn_read_more'] = "read more";
$lang['btn_read_more'] = "Read more";
$lang['btn_download'] = "Download";

$lang['btn_show_gallery'] = "Show {cnt_images} Images";
$lang['btn_open_product'] = "More Informations";

/* Messages */
$lang['msg_missingfield'] = "All fields are required";
Expand Down
5 changes: 2 additions & 3 deletions styles/default/templates/posts/post-list-l.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
</div>
<div class="col-md-8">
<span class="post-author">{post_author}</span> <span class="post-releasedate">{post_releasedate}</span>
<a class="post-headline-link" href="{post_href}"><h3>{post_title}</h3></a>
<a class="post-headline-link" href="{post_href}" title="{post_title}"><h3>{post_title}</h3></a>
{post_teaser}
<p><a href="{post_external_link}" target="_blank">{post_external_link}</a></p>
<p><a href="{post_external_link}" title="{post_external_link}" target="_blank">{post_external_link}</a></p>
</div>
</div>
<div class="row">
<div class="col-md-8 offset-md-4 text-right">
<p class="m-0 post-categories">{post_cats}</p>
<p><a class="btn btn-primary {read_more_class}" href="{post_href}">{read_more_text}</a></p>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion styles/default/templates/posts/post-list-m-wo.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<span class="post-author">{post_author}</span> <span class="post-releasedate">{post_releasedate}</span>
<a class="post-headline-link" href="{post_href}"><h3>{post_title}</h3></a>

{post_teaser}
<div class="row">
<div class="col-md-8 offset-md-4 text-right">
<p class="m-0 post-categories">{post_cats}</p>
Expand Down

0 comments on commit d2350aa

Please sign in to comment.