Code: Select all
{if $view == 'entry'} ... {elseif $view == 'category} ... {/if}What I need now (and can't figure out myself) is a way to detemine whether a user is visiting any page created by the download manager plugin. Any hints?
YL
Code: Select all
{if $view == 'entry'} ... {elseif $view == 'category} ... {/if}Code: Select all
case 'entry_display' :
if ($this->selected()) {
if (is_array($eventData)) {
$eventData['clean_page'] = true;
} else {
$eventData = array ('clean_page' => true);
}
}
return true;
break;
Code: Select all
case 'entry_display' :
if ($this->selected()) {
$serendipity['view'] = 'downloadmanager';
define('IS_DOWNLOADMANAGER', 'true');
if (is_array($eventData)) {
$eventData['clean_page'] = true;
} else {
$eventData = array ('clean_page' => true);
}
}
return true;
break;
I was gonna say: who doesn't? I have never really used it before, but man, it's a PITA! Emits horrible HTML code, too.garvinhicking wrote:I think the current logic of the downloadmanager plugin (I hate that one)
I tested some of the variables used in the .tpl files (which, BTW, are more or less pointless since you can only modifiy the emitted HTML - did I mention it's horrible? - to a certain point), but none of them worked, so I'm pretty sure it doesn't have that.garvinhicking wrote:doesn'T feature a possibility to distinct it
Hm, thanks, I'll keep that in mind. However, I'm not really comfortable with hacking a plugin - there's always the matter of backporting the changes in case of a plugin upgrade, which I tend to forgetgarvinhicking wrote:You could try to change this code:
No, there isn't. I was thkning you tell me if the patch worked, and if it did, I'd put it into the official pluginMaybe there's another solution in this particular project.
Why didn't you say so? I LOVE being a guinea pig!garvinhicking wrote:I was thkning you tell me if the patch worked, and if it did, I'd put it into the official plugin
In my project, it wouldn't suffice just to test whether one is on any page generated by the download manager, I would also need to distinguish between various categories in the download manager. I.e. emit different code if cat A, cat B, cat C, is visited.garvinhicking wrote:and later in your smarty code try to either check $view (I believe this won't work with current mechanism) or "{if (defined('IS_DOWNLOADMANAGER'))}...{/if}".
No, that is even harder to do, and I refuse to dig so much into the plugin *ggg*Does this code cover that?
Perfectly fine. Maybe we should just throw it away and have someone rewrite it from scratch. *g*garvinhicking wrote:No, that is even harder to do, and I refuse to dig so much into the plugin *ggg*