Dotclear

Vous n'êtes pas identifié(e).

Annonce

13 février 2024 Sortie de Dotclear 2.29

#1 Re : English » Plugin-Development: Cache-Problem » 2010-03-23 15:24:11

Doesn't work... think I'll gonna make a external php file and load the quote via javascript.

#2 Re : English » Plugin-Development: Cache-Problem » 2010-03-23 13:27:19

Now it works... any work-around so I can use the plug-in without patching a core-file?

#4 Re : English » Plugin-Development: Cache-Problem » 2010-03-23 09:05:44

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;
	}

#5 English » Plugin-Development: Cache-Problem » 2010-03-23 07:18:47

FearOfTheDark
Réponses : 11

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 ;)

#6 Re : Grenier Dotclear 1 » Localizing Dotclear » 2007-08-07 14:16:58

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.

Vous n'êtes pas identifié(e).

Pied de page des forums

Propulsé par FluxBB

Sites map