Page 2 of 2
Re: Tags
Posted: Tue Mar 06, 2012 12:35 pm
by Gregor
Jaja Rolf.....
Als ik een cgblog detail template dit plaats, dan kan ik de tags zien:
Code: Select all
{if isset($entry->fields)}
{foreach from=$entry->fields item='field'}
<div class="CGBlogDetailField">
{if $field->type == 'image'}
<img class="hidden" src="{$entry->file_location}/thumb_{$field->value}" alt="" />
{elseif $field->name == 'Tags'}
{if $field->name != ""} {*tags to show *}
{$field->name}: {eval var=$field->value|replace:',':' - ' }
{/if}
{else}
{$field->name}: {eval var=$field->value}
{/if}
</div>
{/foreach}
{/if}
Ik heb bedacht dat het handig is om het vorige en volgende artikel binnen eenzelfde tag te laten zien. Dit speelt m.n. een rol bij het sql-statement. Dus de bezoeker klikt op een tag en dan verschijnt het vorige of volgende artikel behorend bij die tag.
Twee vragen:
1. Hoe haal ik de aangeklikte tag-waarde uit het veld? Ik denk aan een array die wordt gevuld, maar wellicht is er een slimmere oplossing.
2. Hoe geef ik die waarde door aan de UDT zodat ik die waarde in het SQL-statement kan gebruiken?
Thanks

Gregor
Re: Tags
Posted: Tue Mar 06, 2012 4:38 pm
by Gregor
Ok, stapje verder. Kan nu een waarde uit fields doorgeven aan een udt en deze in de udt ook laten zien.
Aanroep uit cgblog detailtemplate
Code: Select all
{tags_prev_next pageid=$page_id currid=$entry->id currdate=$entry->postdate currtagid=$field->id currtagvalue=$field->value}
Ophalen in UDT
Code: Select all
// call from cgblog detail_template: {tags_prev_next pageid=$page_id currid=$entry->id currdate=$entry->postdate currtagid=$field->id currtagvalue=$field->value}
$pageid = ($_REQUEST['pageid']) ? $_REQUEST['pageid'] : $params['pageid'];
$currid = ($_REQUEST['currid']) ? $_REQUEST['currid'] : $params['currid'];
$currdate = $params['currdate'];
$currtagid = ($_REQUEST['currtagid']) ? $_REQUEST['currtagid'] : $params['currtagid'];
$currtagvalue= ($_REQUEST['currtagvalue']) ? $_REQUEST['currtagvalue'] : $params['currtagvalue'];
De SQL-code heb ik ook al grotendeel, maar nog niet kunnen proberen.
Vraag:
1. Hoe maak ik van de weergegeven tags deze afzonderlijk klikbaar?
2. Hoe geef ik die aangeklikte waarde dan door aan de UDT?
Thnks,
Gregor
Re: Tags
Posted: Tue Mar 06, 2012 5:21 pm
by Rolf
pff. je bent al een stuk verder

Een stuk verder dan dat ik op het moment even kan verwerken in mijn grijze massa (kom net terug van een middagje rev. centrum)
Maar met {$entry->Tags} kun je de waarde uit CGBlog halen. Tenminste volgens mij werkt dit nog steeds.
Om het te splitsen helpt dit je verder:
http://stormen.wordpress.com/2010/08/08 ... in-smarty/
grtz. Rolf
Re: Tags
Posted: Tue Mar 06, 2012 5:54 pm
by Gregor
Hoop dat het rev.centr. jou ook verder heeft gebracht! Ik gun je dat zo!
Deze aanroep werkt niet:
{$entry->Tags}
Het artikel ga ik zo eens lezen.
Tot later

Gregor
Re: Tags
Posted: Tue Mar 06, 2012 6:29 pm
by Rolf
Bedankt, Gregor
Is al wel gewijzigd dus, moet dan worden: {$entry->fieldsbyname.tags->value}
grtz. Rolf
Re: Tags
Posted: Tue Mar 06, 2012 6:34 pm
by Gregor
You're welcome
Ik heb de suggestie uit het artikel in WP in onderstaande code toegepast. De ink wordt gemaakt, maar de hele string wordt nu een link ipv de afzonderlijke woorden. Kijk maar eens op
http://www.uisge-beatha.eu/logboek/280/ ... onder.html
Code: Select all
{if isset($entry->fields)}
{foreach from=$entry->fields item='field'}
<div class="CGBlogDetailField">
{if $field->type == 'image'}
<img class="hidden" src="{$entry->file_location}/thumb_{$field->value}" alt="" />
{elseif $field->name == 'Tags'}
{if $field->name != ""} {*tags to show *}
{$field->name}: {eval var=$field->value|replace:',':' - '}
<br /> <br />
{*assign var=”keywords” value=”,”|explode:$MetaKeywords*}
{foreach from=$field->value item=value}
<a href=”/index.php?search={$value}”>{$value|trim}</a>,
{/foreach}
{/if}
{else}
{$field->name}: {eval var=$field->value}
{/if}
</div>
{/foreach}
{/if}
grtz., Gregor
Re: Tags
Posted: Tue Mar 06, 2012 6:36 pm
by Gregor
Dit werkt
Code: Select all
{$field->name}: {$entry->fieldsbyname.tags->value}
Re: Tags
Posted: Tue Mar 06, 2012 7:57 pm
by Gregor
De tags zijn links geworden
Code: Select all
{if isset($entry->fields)}
{foreach from=$entry->fields item='field'}
<div class="CGBlogDetailField">
{if $field->type == 'image'}
<img class="hidden" src="{$entry->file_location}/thumb_{$field->value}" alt="" />
{elseif $field->name == 'Tags'}
{if $field->name != ""} {*tags to show *}
{$field->name}: {*$entry->fieldsbyname.tags->value|replace:',':' - '*}
{assign var="taglist" value=$entry->fieldsbyname.tags->value}
{*taglist :{$taglist|print_r*}
{assign var="tagwords" value=", "|explode:$taglist}
{foreach from=$tagwords item=tagword}
<a href=”/index.php?search={$tagword}”>{$tagword|trim}</a> 
{/foreach}
{/if}
{else}
{$field->name}: {eval var=$field->value}
{/if}
</div>
{/foreach}
{/if}
De opmaak van de tags is later zorg.
Hoe zou je die link nu kunnen doorgeven aan de UDT om de zoekopdracht met SQL uit te voeren?
Grtz., Gregor
Re: Tags
Posted: Tue Mar 06, 2012 9:48 pm
by uniqu3
Use urlparam to show articles (as from your template, but added cms_selflink):
Code: Select all
{foreach from=$tagwords item=tagword}
{cms_selflink page='alias_of_your_summary_page' urlparam=$tagword text=$tagword|trim} 
{/foreach}
Now in "alias_of_your_summary_page" Page use
{news summarytemplate='my_tag_template'}
In my_tag_template do following:
Code: Select all
...stuff before foreach ...
{foreach from=$items item=entry}
{*check url for param tag= and compare to extra field *}
{if !empty($smarty.get.tag) && ($entry->fields.tags->value|strpos:"`$smarty.get.tag`" !== false)}
... here do whole summary template as you want to have it ...
{elseif empty($smarty.get.tag)}
... repeat the template so it'S not empty if someone comes to page without using urlparam ...
{/if}
{/foreach}
... stuff after foreach ...
Re: Tags
Posted: Tue Mar 06, 2012 10:15 pm
by Gregor
Thanks Uniqu3 for your help, however I don't think I fully get it.
My idea was, to show tags related to a cgblog article, I therefore added all previous code into the detailtamplate called 'Logboekpagina'.
I try to understand why you come up with a detailtemplate. Could you explain?
The code in the detailtemplate so far is:
Code: Select all
..... other code
{if isset($entry->fields)}
{foreach from=$entry->fields item='field'}
<div class="CGBlogDetailField">
{if $field->type == 'image'}
<img class="hidden" src="{$entry->file_location}/thumb_{$field->value}" alt="" />
{elseif $field->name == 'Tags'}
{if $field->name != ""} {*tags to show *}
{$field->name}: {*$entry->fieldsbyname.tags->value|replace:',':' - '*}
{assign var="taglist" value=$entry->fieldsbyname.tags->value}
{*taglist :{$taglist|print_r*}
{assign var="tagwords" value=", "|explode:$taglist}
{*foreach from=$tagwords item=tagword}
<a href=”{$tagword}” title="{$tagword|trim}">{$tagword}</a> 
{/foreach*}
{foreach from=$tagwords item=tagword}
{cms_selflink page='lbtochten' urlparam=$tagword text=$tagword|trim} 
{/foreach}
{/if}
{else}
{$field->name}: {eval var=$field->value}
{/if}
</div>
{/foreach}
{/if}
<h5>Tags</h5>
{tags_prev_next pageid=$page_id currid=$entry->id currdate=$entry->postdate currtagid=$field->id currtagvalue=$field->value currtagword=$tagword}
<div class="prevnext">
{if $cgblog_tag_next_url}<a href="{$cgblog_tag_next_url}"><< Vorig artikel in deze tag</a> | {/if}
{if $cgblog_tag_prev_url}<a href="{$cgblog_tag_prev_url}">Volgend artikel in deze tag >></a>{/if }
</div>
<br />
...... other code
If you look at the links, something funny happend, from the page source:
The UDT 'tags_prev_next' contains the following code (it has some print statement to see the values of certain variables):
Code: Select all
$gCms = cmsms();
$db = cmsms()->GetDb(); // changed this line.
$cgblog = cms_utils::get_module('CGBlog'); // changed this line.
// call from cgblog detail_template: {prev_next pageid=$page_id currid=$entry->id currdate=$entry->postdate currtag=$entry->.........}
$pageid = ($_REQUEST['pageid']) ? $_REQUEST['pageid'] : $params['pageid'];
$currid = ($_REQUEST['currid']) ? $_REQUEST['currid'] : $params['currid']; // added this line.
$currdate = $params['currdate'];
$currtagid = ($_REQUEST['currtagid']) ? $_REQUEST['currtagid'] : $params['currtagid'];
$currtagvalue = ($_REQUEST['currtagvalue']) ? $_REQUEST['currtagvalue'] : $params['currtagvalue'];
$tagword = $params['currtagword'];
echo "currid: ";
echo "$currid";
echo " | ";
echo "currtagid: ";
echo "$currtagid";
echo " | ";
echo "currtagvalue: ";
echo "$currtagvalue";
echo " | ";
echo "currtagword: ";
echo "$currtagword";
if(!$currdate) return;
//if($currdate) return;
// call from cgblog detail_template: {prev_next pageid=$page_id currid=$entry->id currdate=$entry->postdate}
// For performance, added an index over two columns on ".cms_db_prefix()."module_cgblog_blog_categories
// get all CGBlog articles sorted by ascending date
$query_tag_next = "
SELECT cgblog_id, cgblog_title
FROM ".cms_db_prefix()."module_cgblog
WHERE cgblog_date > ?
AND status = 'published'
AND (end_time >= CURRENT_DATE OR end_time IS NULL)
AND cgblog_id IN
((SELECT cgblog_id
FROM ".cms_db_prefix()."module_cgblog_fieldvals
WHERE fielddef_id IN
(SELECT fielddef_id
FROM ".cms_db_prefix()."module_cgblog_fieldvals
WHERE value like %".$currtagid."%)))
ORDER BY cgblog_date
ASC LIMIT 1";
$result_tag_next =& $db->GetRow($query_tag_next,array($currdate));
echo "next = ";
print_r($result_tag_next);
$query_tag_prev = "
SELECT cgblog_id, cgblog_title
FROM ".cms_db_prefix()."module_cgblog
WHERE cgblog_date < ?
AND status = 'published'
AND (end_time >= CURRENT_DATE OR end_time IS NULL)
AND cgblog_id IN
((SELECT cgblog_id
FROM ".cms_db_prefix()."module_cgblog_fieldvals
WHERE fielddef_id IN
(SELECT fielddef_id
FROM ".cms_db_prefix()."module_cgblog_fieldvals
WHERE value like %".$currtagid."%)))
ORDER BY cgblog_date
DESC LIMIT 1";
/* //echo "next-p = ";
//echo "$query_prev";
// end of get all CGBlog items */
$result_tag_prev = &$db->GetRow($query_ptag_rev,array($currdate));
echo "prev = ";
print_r($result_tag_prev);
//date -> id
if($result_tag_next['cgblog_id']) {
$aliased_title = munge_string_to_url($result_tag_next['cgblog_title']);
$prettyurl = 'logboek/' . $result_tag_next["cgblog_id"] .'/'.$pageid."/$aliased_title";
$next_uri = $cgblog->CreateLink('cntnt01', 'detail', $pageid, '', array('articleid' => $result_tag_next["cgblog_id"]) ,'', true, false, '', true, $prettyurl);
}else {
$next_uri = "";
}
if($result_tag_prev['cgblog_id']) {
$aliased_title = munge_string_to_url($result_tag_prev['cgblog_title']);
$prettyurl = 'logboek/' . $result_tag_prev["cgblog_id"] .'/'.$pageid."/$aliased_title";
$prev_uri = $cgblog->CreateLink('cntnt02', 'detail', $pageid, '', array('articleid' => $result_tag_prev["cgblog_id"]) ,'', true, false, '', true, $prettyurl);
}else {
$prev_uri = "";
}
$smarty->assign('cgblog_tag_next_url', $next_uri);
$smarty->assign('cgblog_tag_next_text', $cgblog->lang("next"));
$smarty->assign('cgblog_tag_prev_url', $prev_uri);
$smarty->assign('cgblog_tag_prev_text', $cgblog->lang("prev"));
Does this help to help me?
Gregor
Re: Tags
Posted: Wed Mar 07, 2012 6:11 am
by Gregor
In addition to my previous post, my whole currect cgblog detailtemplate looks like this:
Code: Select all
{cgfb_init}
{* capture assign=foo}{CGFeedback key1="CGBlog" key2=$entry->id action='ratings' ratingstemplate="feedback_counter"}{/capture *}
{* set a canonical variable that can be used in the head section if process_whole_template is false in the config.php *}
{if isset($entry->canonical)}
{assign var='canonical' value=$entry->canonical}
{/if}
{* 28nov11 http://www.i-do-this.com/blog/48/Put-your-CMSMS-Metatags-on-autopilot *}
{assign var='get_title' value=$entry->title}
{if $entry->summary}
{assign var='meta_descr' value=$entry->summary|truncate:'150'|strip_tags|strip}
{else}
{assign var='meta_descr' value=$entry->content|truncate:'150'|strip_tags|strip}
{/if}
{if $entry->postdate}
{assign var='meta_date' value=$entry->postdate|date_format:'%a, %d %b %Y %H:%M:%S %z'}
{/if}
{* Detail template
key2 begin news template ja/nee: ({$entry->id|print_r}) <br/> *}
{assign var='uisge_news_id' value=$entry->id}
<h3 id="NewsPostDetailTitle">{$get_title}</h3>
<hr id="NewsPostDetailHorizRule"></hr>
{if $entry->category}
<div id="NewsPostDetailCategory">
{$category_label} {$entry->category}
</div>
{/if}
{if $entry->postdate}
<div id="NewsPostDetailDate">
{$entry->postdate|date_format:'%a, %d %b %Y'}
</div>
{/if}
<div id="BlogCounter">
{CGFeedback key1="CGBlog" key2=$entry->id action='ratings' ratingstemplate="feedback_counter"} | Dit artikel is {HitCounter key1="CGBlog" key2=$entry->id} keer bekeken.
</div>
{if $entry->summary}
<div id="NewsPostDetailSummary">
{eval var=$entry->summary}
</div>
{/if}
{* if $entry->author}
<div id="NewsPostDetailAuthor">
{$entry->author}
</div>
{/if *}
<div id="NewsPostDetailContent">
{eval var=$entry->content}
</div>
<div id="NewsPostDetailPrintLink">
{$entry->printlink}
</div>
{if $return_url != ""}
<div id="NewsPostDetailReturnLink">{$return_url}</div>
{/if}
{* cms_module module='comments' modulename='CGBlog' pageid=$entry->id *}
{if $entry->category == 'Logboek' || $entry->category == 'Tochten' || $entry->category == 'Onderhoud'|| $entry->category == 'Hardlopen' || $entry->category == 'General' || $entry->category == 'Statistiek'}
categorie </br>
{cms_module module='comments' modulename='News' pageid=$entry->id}
categorie 1</br>
{CGFeedback key1="News" key2=$entry->id lang="nl_NL"}
key2 ja/nee: ({$entry->id|print_r}) <br/>
{CGFeedback key1="CGBlog" key2=$entry->id lang="nl_NL"}
{CGFeedback key1="CGBlog" key2=$entry->id action='summary' lang="nl_NL"}
uisge_news_id ja/nee: ({$uisge_news_id})
categorie 2</br>
{CGFeedback key1="CGBlog" key2=$uisge_news_id lang="nl_NL"}
{CGFeedback key1="CGBlog" key2=$uisge_news_id action='summary' lang="nl_NL"}
{/if}
{if isset($entry->fields)}
{foreach from=$entry->fields item='field'}
<div class="CGBlogDetailField">
{if $field->type == 'image'}
<img class="hidden" src="{$entry->file_location}/thumb_{$field->value}" alt="" />
{elseif $field->name == 'Tags'}
{if $field->name != ""} {*tags to show *}
{$field->name}: {*$entry->fieldsbyname.tags->value|replace:',':' - '*}
{assign var="taglist" value=$entry->fieldsbyname.tags->value}
{*taglist :{$taglist|print_r*}
{assign var="tagwords" value=", "|explode:$taglist}
{*foreach from=$tagwords item=tagword}
<a href=”{$tagword}” title="{$tagword|trim}">{$tagword}</a> 
{/foreach*}
{foreach from=$tagwords item=tagword}
{cms_selflink page='lbtochten' urlparam=$tagword text=$tagword|trim} 
{/foreach}
{/if}
{else}
{$field->name}: {eval var=$field->value}
{/if}
</div>
{/foreach}
{/if}
<br /><br />
{*tags_prev_next pageid=$page_id currid=$entry->id currdate=$entry->postdate currtagid=$field->id currtagvalue=$field->value currtagword=$tagword*}
<h5>Tags</h5>
{tags_prev_next pageid=$page_id currid=$entry->id currdate=$entry->postdate currtagid=$field->id currtagvalue=$field->value currtagword=$tagword}
<div class="prevnext">
{if $cgblog_tag_next_url}<a href="{$cgblog_tag_next_url}"><< Vorig artikel in deze tag</a> | {/if}
{if $cgblog_tag_prev_url}<a href="{$cgblog_tag_prev_url}">Volgend artikel in deze tag >></a>{/if }
</div>
<br />
{* 28nov11 *}
{cms_module module='comments' modulename='News' pageid=$entry->id }
{* CGFeedback key1="CGBlog" key2=$uisge_news_id lang="nl_NL"}
{CGFeedback key1="CGBlog" key2=$uisge_news_id action='summary' lang="nl_NL" *}
<br />
<h5>Reacties</h5>
{strip}
{if $stats.count !=0}
{CGFeedback key1="CGBlog" key2=$uisge_news_id action="summary" lang="nl_NL"}
{else}
<p>Op dit artikel zijn nog geen reacties... Laat als eerste een reactie achter!</p>
{/if}
<p>{startExpandCollapse id="Reageeropditartikel" title="Reageer op dit artikel (klik), of laat een bericht op FaceBook achter via het onderstaand FaceBook-scherm."}</p>
{CGFeedback key1="CGBlog" key2=$uisge_news_id action="default" lang="nl_NL"}
{stopExpandCollapse}
{/strip}
<br/>
{cgfb_comments href=$entry->detail_url}
<h5>Artikelen binnen dezelfde categorie</h5>
{prev_next pageid=$page_id currid=$entry->id currdate=$entry->postdate}
<div class="prevnext">
{if $cgblog_next_url}<a href="{$cgblog_next_url}"><< Vorig artikel in deze categorie</a> | {/if}
{if $cgblog_prev_url}<a href="{$cgblog_prev_url}">Volgend artikel in deze categorie >></a>{/if }
</div>
<br />
Re: Tags
Posted: Thu Mar 08, 2012 7:08 am
by Gregor
Spent several hours to understand Uniqu3's suggestion, followed Uniqu3's steps and created a cgblog summarytemplate, but I'm not sure if it has the right content
If I hover a tag, than I see the url of the site added with the hovered tag, although the it has cms_selflink
Code: Select all
{foreach from=$tagwords item=tagword}
{cms_selflink page="cgblog_logboek" urlparam=$tagword text=$tagword|trim} 
{/foreach}
When I click a tag, than I get a 'not found error', that's because the created link looks like
I'm stuck. Sorry. any help is highly appreciated

Gregor
Re: Tags
Posted: Thu Mar 08, 2012 7:30 am
by uniqu3
Sorry Georg, Google Translate isn't much help to understand what exactly you are trying to do

translations are funny and make laugh.
That cms_selflink returns a page not found is because url param isn't set correct.
You would need to do it like:
urlparam="?tag=`$tagword`" then your url would look like
http://www.uisge-beatha.eu/cgblog_logbo ... lex-O-Fold
But i dont know if this is what you want.
This will create a link with that param, and as written in my post above when using my suggested summary template, when tag= exists and is not empty this will list all Blog posts that have "Flex-O-Fold" in "tags" extra field.
Didn't look at you other templates and UDT's so far, i am a bit under deadline pressure, no time for fun things

Re: Tags
Posted: Thu Mar 08, 2012 7:37 am
by Gregor
Thanks for your time and reply Uniqu3.
Google translate is kind of stonecole English
To cut a long story sort, I'm trying to get tags under an article, tags I entered myself via an defined field in cgblog. I'd like to sort of link between the tags, meaning if one tag is clicked, the next article containing that tag, shows up. I'd like to do it two way, so give the option to go to a previous or a next article.
Simpletagging I tried, however it's marked as stale and it does not work with the latest cms version.
Gregor
Re: Tags
Posted: Sun Mar 11, 2012 8:48 am
by Gregor
I managed to get an answer from the query inside the UDT, although the query does not yet give the right output; it gives an cgblog_id from an article that does not contain the set tag-value.
I'm still kind a stuck on how to parse a value from the cgblog article to the udt. I somehow think that the call to the UDT is not in the right place (see detail template above). Looking at the logic, I think it should look this:
1. Enter the cgblog
2. Read the tags defined in the Extra field of the article
3. Fetch for each tag the previous and next article by calling the UDT, put the result in some sort of array
4. Show the whole article to the user
Code: Select all
$gCms = cmsms();
$db = cmsms()->GetDb(); // changed this line.
$cgblog = cms_utils::get_module('CGBlog'); // changed this line.
// call from cgblog detail_template: {prev_next pageid=$page_id currid=$entry->id currdate=$entry->postdate currtag=$entry->.........}
$pageid = ($_REQUEST['pageid']) ? $_REQUEST['pageid'] : $params['pageid'];
$currid = ($_REQUEST['currid']) ? $_REQUEST['currid'] : $params['currid']; // added this line.
$currdate = $params['currdate'];
$currtagid = ($_REQUEST['currtagid']) ? $_REQUEST['currtagid'] : $params['currtagid'];
$currtagvalue = ($_REQUEST['currtagvalue']) ? $_REQUEST['currtagvalue'] : $params['currtagvalue'];
$tagword = $params['currtagword'];
echo "currid: ";
echo "$currid";
echo " | ";
echo "currtagid: ";
echo "$currtagid";
echo " | ";
echo "currtagvalue: ";
echo "$currtagvalue";
echo " | ";
echo "currtagword: ";
echo "$currtagword";
if(!$currdate) return;
//if($currdate) return;
// temporary set of $currtagvalue, for testing purposes
$currtagvalue = Saildrive;
echo "currtagvalue: ";
echo "$currtagvalue";
echo " | ";
// call from cgblog detail_template: {prev_next pageid=$page_id currid=$entry->id currdate=$entry->postdate}
// For performance, added an index over two columns on ".cms_db_prefix()."module_cgblog_blog_categories
// get all CGBlog articles sorted by ascending date
$query_tag_next = "
SELECT cgblog_id, cgblog_title
FROM ".cms_db_prefix()."module_cgblog
WHERE cgblog_date > ?
AND status = 'published'
AND (end_time >= CURRENT_DATE OR end_time IS NULL)
AND cgblog_id IN
((SELECT cgblog_id
FROM ".cms_db_prefix()."module_cgblog_fieldvals
WHERE fielddef_id IN
(SELECT fielddef_id
FROM ".cms_db_prefix()."module_cgblog_fieldvals
WHERE value like '%".$currtagvalue."%')))
ORDER BY cgblog_date
ASC LIMIT 1";
$result_tag_next =& $db->GetRow($query_tag_next,array($currdate));
echo "next = ";
print_r($result_tag_next);
echo " | ";
$query_tag_prev = "
SELECT cgblog_id, cgblog_title
FROM ".cms_db_prefix()."module_cgblog
WHERE cgblog_date < ?
AND status = 'published'
AND (end_time >= CURRENT_DATE OR end_time IS NULL)
AND cgblog_id IN
((SELECT cgblog_id
FROM ".cms_db_prefix()."module_cgblog_fieldvals
WHERE fielddef_id IN
(SELECT fielddef_id
FROM ".cms_db_prefix()."module_cgblog_fieldvals
WHERE value like '%".$currtagvalue."%')))
ORDER BY cgblog_date
DESC LIMIT 1";
/* //echo "next-p = ";
//echo "$query_prev";
// end of get all CGBlog items */
$result_tag_prev = &$db->GetRow($query_tag_prev,array($currdate));
echo "prev = ";
print_r($result_tag_prev);
echo " | ";
//date -> id
if($result_tag_next['cgblog_id']) {
$aliased_title = munge_string_to_url($result_tag_next['cgblog_title']);
$prettyurl = 'logboek/' . $result_tag_next["cgblog_id"] .'/'.$pageid."/$aliased_title";
$next_uri = $cgblog->CreateLink('cntnt01', 'detail', $pageid, '', array('articleid' => $result_tag_next["cgblog_id"]) ,'', true, false, '', true, $prettyurl);
}else {
$next_uri = "";
}
if($result_tag_prev['cgblog_id']) {
$aliased_title = munge_string_to_url($result_tag_prev['cgblog_title']);
$prettyurl = 'logboek/' . $result_tag_prev["cgblog_id"] .'/'.$pageid."/$aliased_title";
$prev_uri = $cgblog->CreateLink('cntnt02', 'detail', $pageid, '', array('articleid' => $result_tag_prev["cgblog_id"]) ,'', true, false, '', true, $prettyurl);
}else {
$prev_uri = "";
}
$smarty->assign('cgblog_tag_next_url', $next_uri);
$smarty->assign('cgblog_tag_next_text', $cgblog->lang("next"));
$smarty->assign('cgblog_tag_prev_url', $prev_uri);
$smarty->assign('cgblog_tag_prev_text', $cgblog->lang("prev"));
Any ideas on how I can proceed?
Thanks, Gregor