Page 6 of 8

Re: Error

Posted: Fri 4. May 2007, 13:09
by Mr.Flash
ceint wrote:I am getting this error message:
Fatal error: Call to undefined function: get_gt_by_style() in /home/jreplysy/public_html/phpwcms_template/inc_script/frontend_render/blog.module.php(214) : regexp code on line 1

Any suggestions?
habe das gleiche Problem..
habe allerdings schon
$phpwcms['gt_mod'] = 1;

habe pepes version für die installation benutzt (around line 360)
(habe phpwcms 1.3.3 laufen)

verstehe nicht, warum es nicht funktioniert..
graphical text mod läuft..

jemand ne idee?

Posted: Fri 4. May 2007, 14:49
by Mr.Flash
also, in der include/inc_module/mod_graphical_text/inc_front/gt.func.inc.php ist die Funktion get_gt_by_style.
diese wird in der include/inc_front/content.func.inc.php wie folgt aufgerufen:
// Jérôme's Graphical Text MOD Coypright (C) 2004
if($phpwcms["gt_mod"]) { //enabled/disable GT MOD
require_once ('include/inc_module/mod_graphical_text/inc_front/gt.func.inc.php');
}
das heißt, gt_mod muss auf 1 gesetzt sein - ist es auch - aber trotzdem bekomme ich diesen Fehler:

Fatal error: Call to undefined function get_gt_by_style() in /var/www/bla_und_blub/template/inc_script/frontend_render/blog.module.php(216) : regexp code on line 1

hat jemand ne Idee, woran es noch liegen könnte?

Gruß Mr.Flash

Posted: Fri 4. May 2007, 15:41
by Mr.Flash
oh mist..
habe gerade erst gesehen, dass pepe es ja mit version 1.3 zum laufen bekommen hatte und nicht mit 1.3.3 ..

hatte gerade mal ne frische 1.3.3 aufgesetzt und WCMSBlog v0.6 integriert.
leider bekomme ich den gleichen Fehler wie zuvor :(

werde dann doch wohl warten, bis es von shiny was neues gibt..

Posted: Fri 4. May 2007, 17:19
by pepe
Hi Mr.

mittlerweile hab natürlich ich auf 1.3.3 upgedated... und es läuft auch dort....

lediglich beim REWRITE muß umgeschrieben werden....

Im Moment experimentiere ich mit der Einbindung von sNews:
http://phpwcms-templates.de/snews.phtml

und das scheint mir auch eine interessante alternative!!!

Vorteil, beim Update keine Probleme, da separat per iFrame .


Besser wäre natürlich eine "ECHTE" OG-Lösung...... aber?

Posted: Sun 6. May 2007, 12:29
by Mr.Flash
Hallo Pepe,

wenn javascript auf Deiner Seite ausgeschaltet ist, sieht man nur die erste Zeile von dem IFrame und nen paar Pixel von der 2. Zeile. liegt wohl an dem height="100", was dann durch die javascript Funktion iFrameHeight() auf nen vernünftigen Wert gesetzt wird.
wenn das von Anfang an nen größeren Wert hätte und auch scrollbalken (die dann mit dem script ausgeschaltet werden[geht das überhaupt?]), dann könnte man das auch mit ausgeschaltetem JavaScript betrachten...

Code: Select all

<iframe onload="iFrameHeight();" src="http://phpwcms-templates.de/sNews_14/index.php" scrolling="no" scroll="auto" id="iframename" name="iframename" marginwidth="0" marginheight="0" frameborder="0" style="width:100%;" height="100"
bei mir kommt leider bei WCMSBlog v0.6 und phpwcms 1.3.3 immer der genannte Fehler. Rewrite ist bei mir aus. habe jetzt keine Lust, noch weiter nach der Ursache zu suchen..
werde wohl warten, bis es was von OGs Seite gibt, oder nen neue Version von WCMSBlog..

P.S.: Danke auch für Deine Quick-Start Anleitung. Hat mir am Anfang sehr geholfen!

Frontend Integration

Posted: Tue 8. May 2007, 10:46
by yo-less
Hi everyone,

thanks Pepe for sharing your installation instructions for the 1.3.3 build. I've been trying to get the blog working in the frontend, but the replacement tags simply don't work. {BLOG:NAME-HERE} just doesn't get converted into my blog, did you change something else than just the "case 6" part when you installed your blog module?

Thanks a lot for your thoughts

Posted: Fri 15. Jun 2007, 10:59
by M3YD0N
I have also installed the new Phpwcms 1.3.3 and afterwards I found that great blog-mod and i've tried to integrate it. Well, it doesn't run... as yo-less mentioned, there's only the {blog:name} displayed, not the content of the block. I've also tryed the hint from Pepe, but it doesn't work for me.

So I hope it is just a matter of time until somebody can offer a solution to fix that problem.

Thank you very much indeed!

Posted: Fri 15. Jun 2007, 11:04
by jscholtysik
Hi MY3DON,


the only senseful solution in my eyes would be to wait for the results of the fundraising campaign, where a blog modul was also on the to-do list... ;-)

There you then have a solution that is cleanly integrated.


Joachim

Posted: Sun 15. Jul 2007, 11:00
by ourpobox
Hi all,

I agree the best solution for me is to see the integrated solution in v. 1.3.5 and just do an upgrade before I worry about a blog in phpWCMS. Is there any news on whether the blog is to be integrated soon? I don't want to spend time to integrate it, and have it lost when I upgrade....which I hope is SOON. :D

Greg

Posted: Mon 16. Jul 2007, 18:07
by StefanTS
Hi Mr. Flash,

hast Du nochmal an dem BLOG experimentiert? Ich häng an dem selben Fehler, den Du oben beschrieben hast. Neue Erfahrungen? Wenn ja, wäre ich wirklich sehr dankbar!

Gruß,
Stefan

Posted: Wed 15. Aug 2007, 14:57
by munzli
hallo jungs und mädels

habe beschrieben wie man das ganze zum laufen bringt im phpwcms 1.3.3 auf meinem blog: http://www.munz.li/?p=24

cheers

[edit]
der code der ausgespuckt wird vom wcms blog hat HTML fehler drin... kann später meine version vom blog.module.php posten wo wenigstens was das angeht korrigiert ist. und auch moo.fx mit der normalen mootools library die in phpwcms drin ist wurde ersetzt.
[/edit]

Posted: Tue 28. Aug 2007, 16:28
by nehemia
Hallo Leute,
es ist soweit, meiner Meinung nach scheint mir das ein Durchbruch beim Weblog unter phpwcms 1.3.3 und phpwcms 1.3.5pre zu sein.

In beiden Versionen ist es mir gelungen, anhand der Anleitung von Munzli den Weblog zum Laufen zu bringen. Der Beweis:
Hier http://mg888.freeprojekt.de läuft er im Moment unter phpwcms 1.3.3 und hier http://mg888.ohost.de unter phpwcms 1.3.5pre (trunk 20.08.07). Captcha fehlt zwar noch und Fragen habe ich auch noch eine ganze Menge, aber immerhin...

Vielen Dank, Munzli, für Deinen Beitrag dazu.

Die Schweizer sind die "Größten"!!! ':D' Es lebe die Schweiz!,
Martin

Posted: Tue 28. Aug 2007, 17:46
by munzli
nehemia wrote: Vielen Dank, Munzli, für Deinen Beitrag dazu.

Die Schweizer sind die "Größten"!!! ':D' Es lebe die Schweiz!,
Martin
ja bitte bitte...
aber übertreiben musst du's ja nicht ;)

hier noch meine ein bisschen überarbeitete version des blog.module.phps mit captcha ( hardcodiert ;) ) und XHTML valid output

Code: Select all

<?php



include("include/inc_module/mod_blogs/inc_lib/functions.general.inc.php");

include("include/inc_module/mod_blogs/inc_lib/functions.db.inc.php");



function bm_render_blog($title)

{
	global $gt, $b_prefs;
	$s = '';
	
	// style element not allowed here, this is XHTML baby!	
	//$s .= file_get_contents((dirname(realpath(__FILE__)) . "/blog.style.css"));

	/* removed the next lines since i'm now using mootools
	 *
	 * you need to call initializeLightbox(); in a frontend rendering file like: content.article.inc.php
	 * just add it somewhere so it's called on that page that you want to have the news.
	 */

	//$s .= '<script src="scripts/prototype.lite.js" type="text/javascript"></script>

  	//<script src="scripts/moo.fx.js" type="text/javascript"></script>';


	// Number of blog entries per page

	$pp = 5; 



	if ($_GET["offset"] != "") $start = $_GET["offset"];

	else $start = 0;

	



  	$bid = db_get_blogid($title);

	unserialize_prefs($bid);



	// Add a comment if we've been sent one

	if ($_POST["addcomment"] == true && $_POST["comment"] != "" && !empty($_POST["captcha"]))

	{
		include_once (PHPWCMS_ROOT.'/include/inc_ext/SOLMETRA_FormValidator/SPAF_FormValidator.class.php');


		// instantiate the object

		$spaf_obj = new SPAF_FormValidator();

		$captcha = clean_slweg($_POST['captcha']);

		if ($spaf_obj->validRequest($captcha)) {

			// destroy successful code

			$spaf_obj->destroy();
			
			$success = db_add_comment($_POST["entryid"], $_POST["author"], $_POST["url"], $_POST["comment"]);


			$msg = file_get_contents(dirname(__FILE__) . "/email.txt");		 

			$search = array("*COMMENT*", "*AUTHOR*", "*PERMALINK*", "*SITE*", "*TITLE*");

			$replace = array($_POST["comment"], $_POST["author"], $phpwcms["site"] . $b_prefs["permalink"], $phpwcms["site"], $title);

			$msg = str_replace($search, $replace, $msg);

			send_comment_notification($b_prefs["commentemails"], $msg);

		} else {

			$s .= '<div class="captcha_error">Fill in the correct security code!</div>';

		}



	}


	if ($bid != "")

	{

		if ($_GET["permalink"] != "")

		{

			$entries = db_get_permalink_entry($_GET["permalink"]);

		}

		else

		{

			$entries = db_get_entries($bid, $start, $pp);

		}


		foreach($entries as $e)

		{


			$s .= "<div class='blogtext'>";

			$cres = db_get_comments($e["id"]);

			$ccount = mysql_num_rows($cres);

			$etext = $e["content"];

			$eid = $e["id"];

			$etext = nl2br($etext);


			$s .= "<div class='blogheader'>";

			$s .= "<span class='blogdate'>" . strftime("%a %d/%m/%y %H:%M", $e["time"]) . "</span>";

			$s .= "<div class='blogheadline'>" . $e["title"] . "</div></div>";

			$s .= "<div class='blogcontent'><div class='blogsubtitle'>" . $e["subtitle"] . "</div>" . $etext . "</div>";



			// Begin comments

			$s .= "<div class='blogcomments'><div class="right">";



			if ($ccount > 0) {
				$s .= "<a style='cursor:pointer;' onclick='c" . $bid . "_" . $eid . ".toggle()'><b>";
			}

			$s .= "$ccount comment";

			
			if ($ccount != 1) {
				$s .= "s";  // "Comment" or "Comments"?
			}

			
			if ($ccount > 0) {
				$s .= "</b></a>";
			}

			
			// create a correct URL so it's XHTML valid
			$request_uri = preg_replace('/&(?!amp;)/','&',$_SERVER['REQUEST_URI']);


			if (!$_GET["permalink"]) {

				($_SERVER["QUERY_STRING"] != "") ? $permalink = $request_uri . "&" : $permalink = $request_uri . "?";

			
				// remove offset parameter for permalink
				$permalink = preg_replace("/&offset=\d*/i", "", $permalink);
				// permalink parameter

				$permalink .= "permalink=$eid";

			}

			$s.= "<span style='color: #999'> | </span> <a id='link$bid-$eid' style='cursor:pointer;' onmousedown='ac" . $bid . "_" . $eid . ".toggle()'>Add a comment</a></div>";

			$s.= "<a href='" . $permalink . "'>permalink</a>";
	      	$s .= "</div>";

			$s .= "<div style='width:100%' id='el" . $bid. "addcomment" . $eid . "'>";

			$s .= "<form method='post' action='" . $request_uri . "'>

					<input type='hidden' name='entryid' value='$eid'/>

					<input type='hidden' name='addcomment' value='true'/>

					<div style='width: 100%' class='addblogcomment'>

						<p>

							<label for='author" . $bid . "_" . $eid . "'>Author:</label>

							<input id='author" . $bid . "_" . $eid . "' name='author' type='text' />
						</p>						
						<p>

							<label for='url" . $bid . "_" . $eid . "'>Webpage:</label>

							<input id='url" . $bid . "_" . $eid . "' name='url' type='text' />

						</p>						
						<p>

							<label for='comment" . $bid . "_" . $eid . "'>Comment:</label>

							<textarea id='comment" . $bid . "_" . $eid . "' name='comment' rows='5' cols='43'></textarea>
						</p>						
						<!--CAPTCHA_START//-->	

						<p>

							<label for='captcha" . $bid . "_" . $eid . "'>Code:</label>

							<input name='captcha' type='text' id='captcha" . $bid . "_" . $eid . "' class='gbInputFieldCaptcha' value='' size='10' maxlength='10' />

							<img src='img/captcha.php?regen=y&length=5&".time()."' alt='captcha' border='0' class='gbCaptchaImage' />

						</p>

						<!--CAPTCHA_END//-->
						<p>

							<input class='submit' type='submit' value='Add Comment'/>
						</p>
					</div>

				</form>"; 

			$s .= "</div>"; 

			

			$s .= "<div style='width: 100%' class='comments' id='el" . $bid. "comments" . $eid . "' >";


			if ($ccount > 0)

			{

				$s .= "<div class='blogcomments'>

						<div class='blogcommentheader'>";

				while ($comment = mysql_fetch_array($cres))

				{

					$s .= "<b>";

					if ($comment ["url"] != "http://" && $comment["url"] != "") {
						$s .= "<a href='" . $comment["url"] . "'>";
					}

					$s .= $comment["author"];

			 		if ($comment ["url"] != "") {
						$s .= "</a>";
					}

					$s .= ":</b><br />";

					$s .= nl2br(trim($comment["comment"]));

					$s .= "<div style='height: 1px; border-top: 1px dashed #000; width: 100%; padding: 0; margin: 6px 0 6px 0;'></div>";

				}

				$s .= "</div></div>";

			}


			$s .= "</div>";

			$s .= "<script type='text/javascript'>

						var ac" . $bid . "_" . $eid . " = new Fx.Slide('el" . $bid . "addcomment" . $eid . "', {duration: 1000, transition: Fx.Transitions.Expo.easeOut});

						c" . $bid . "_" . $eid . " = new Fx.Slide('el" . $bid . "comments" . $eid . "', {duration: 1000, transition: Fx.Transitions.Expo.easeOut});
						ac" . $bid . "_" . $eid . ".hide();

						c" . $bid . "_" . $eid . ".hide();

					</script>";

			$s .= "</div>";

		}

		if ($_GET["permalink"] == "")

		{

			$prevlink = $request_uri;

			$nextlink = $request_uri;



			$prevlink = preg_replace("/&offset=\d*/i", "", $prevlink);

			$nextlink = preg_replace("/&offset=\d*/i", "", $nextlink);



			if (strstr($prevlink, "?") !== false)

			{

			  	$prevlink .= "&";

				$nextlink .= "&";

			}

			else

			{

			  	$prevlink .= "?";

  		  		$nextlink .= "?";

			}



			$prevlink .= "offset=" . ($_GET["offset"] + $pp);

			$nextlink .= "offset=" . ($_GET["offset"] - $pp);



			if ($start >= $pp) {
				$s .= "<span style='float:right'><a href='$nextlink'>NEXT >></a></span>";
			}

			if (db_num_entries($bid)-($start + $pp) > 0) {
				$s .= "<a href='$prevlink'><< PREVIOUS</a>";
			}

		}

	}
	// removed this since i don't need the permalink to be displayed with the GT mod

	/*if(class_exists('get_gt_by_style')) {

		$s = preg_replace('/\{GT:(.+?)\}(.*?)\{\/GT\}/ei', "get_gt_by_style(\$gt, "\$1", "\$2")", $s);
	}*/
  return $s;

}





if(!empty($content["all"]) && !(strpos($content["all"],'{BLOG')===false))

{

	// Style

	$content["all"] = preg_replace('/\{BLOG:(.+?)\}/ei', "bm_render_blog("$1")", $content["all"]);

}

?>
vergesst nicht das "initializeLightbox();" im content.article.inc.php immer zu aufrufen, den diese version nützt mootools und nicht moo.fx

Posted: Tue 28. Aug 2007, 21:53
by MrPotter
munzli, klasse klasse klasse! War grad dabei die Captcha-Abfrage einzubauen, da bin ich auf deinen Post gestoßen. Ging ja echt schnell. Aber sag mal, warum hast du denn die moo.fx-Db rausgenommen? Mit deiner funktioniert das irgendwie nicht. Wo genau soll ich denn in der conten.articles.php die initializeLightbox(); aufrufen?

Grüße
MrPotter

Posted: Wed 29. Aug 2007, 18:00
by nehemia
Ok, munzli,
jetzt habe ich bezüglich Captcha die bestehende Datei blog.module.php mit der Deinigen ausgetauscht, und zwar sowohl unter phpwcms 1.3.3 als auch unter phpwcms 1.3.5pre.
Unter 1.3.3 http://mg888.freeprojekt.de bekomme ich leider überhaupt keine Darstellung und stattdessen eine richtige Fehlermeldung ':cry:' und unter 1.3.5pre http://mg888.ohost.de ist die Darstellung leder auch nicht so, wie sie eigentlich sein müsste ':(':
- es fehlt der blaugraue Header
- die Kommentare werden nicht mehr gelb dargestellt
- der Ziehharmonikaeffekt geht leider auch nicht mehr. etc.
Kannst Du mir evtl. weiter helfen?
Gruß, Martin