Vous n'êtes pas identifié(e).
13 février 2024 Sortie de Dotclear 2.29
Pages : 1
Doesn't work... think I'll gonna make a external php file and load the quote via javascript.
Now it works... any work-around so I can use the plug-in without patching a core-file?
Well, but it returns unparsed php-code ;)
this is my widget function:
public static function quotesWidget(&$w)
{
global $core;
if ($w->homeonly && $core->url->type != 'default') {
return;
}
return
'<div class="quote">'.
($w->title ? '<h2>'.html::escapeHTML($w->title).'</h2>' : '').
self::getQuote('<p class="quote-text">%s</p>','<span class="quote-author">%s</span>').
'</div>';
}
this is the method to get a random quote:
public function getRandomQuote()
{
$strReq = 'SELECT quote_id '.
'FROM '.$this->table.' '.
"WHERE blog_id = '".$this->con->escape($this->blog->id)."' ORDER BY RAND()";
$rs = $this->con->select($strReq);
$rs = $this->getQuote($rs->field("quote_id"));
return $rs;
}
method to get a quote:
public function getQuotes($params=array())
{
$strReq = 'SELECT quote_id, quote_text, quote_author '.
'FROM '.$this->table.' '.
"WHERE blog_id = '".$this->con->escape($this->blog->id)."' ";
if (isset($params['quote_id'])) {
$strReq .= 'AND quote_id = '.(integer) $params['quote_id'].' ';
}
$rs = $this->con->select($strReq);
return $rs;
}
Hi,
I'm currently working on a plugin to display a random quote in a widget. Unfortunately, the plug-in doesn't work 'cause caching - it always displays the same quote (I tested the SQL query, it works the way it should do).
So now I'm wondering how to disable caching for this plugin. Is there a way to do so?
GreeetZ ;)
well done, i've joined yesterday and today I finished the translation of the backend and the frontend of DC2. now I'm about the help and afterwards I will translate the plugins.
ok, ich bin der mailing list gestern begetreten und habe heute die administration und das frontend von DC2 fertig übersetzr. Ich werde jetzt die Hilfe übersetzen und danach kommen die plugins dran.
Pages : 1
Vous n'êtes pas identifié(e).