WCMSBlog v0.6 (was Phpwcms Blog Module)

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.

Re: Error

Postby Mr.Flash on Fri May 04, 2007 11:09

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?
User avatar
Mr.Flash
 
Posts: 50
Joined: Thu May 03, 2007 17:17

Postby Mr.Flash on Fri May 04, 2007 12:49

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
User avatar
Mr.Flash
 
Posts: 50
Joined: Thu May 03, 2007 17:17

Postby Mr.Flash on Fri May 04, 2007 13:41

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..
User avatar
Mr.Flash
 
Posts: 50
Joined: Thu May 03, 2007 17:17

Postby pepe on Fri May 04, 2007 15:19

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?
mfG pepe

Image

Natürlich lese ich hier immer noch mit (ist ja nicht mehr so viel), gespannt darauf, was noch kommen wird... und wann!
Denn phpwcms ist - nach wie vor - ein TOP CMS, welches einen Vergleich nicht scheuen muß!

phpWCMS Installation + Quick-Start + Tuning | some Replacement-Tags | free-X templates (4.000 downloads/1.anno)
User avatar
pepe
 
Posts: 2849
Joined: Mon Jan 19, 2004 12:46
Location: Mülheim-Ruhr, Germany

Postby Mr.Flash on Sun May 06, 2007 10:29

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!
User avatar
Mr.Flash
 
Posts: 50
Joined: Thu May 03, 2007 17:17

Frontend Integration

Postby yo-less on Tue May 08, 2007 08:46

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
yo-less
 
Posts: 1
Joined: Tue May 08, 2007 08:41

Postby M3YD0N on Fri Jun 15, 2007 08:59

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!
M3YD0N
 
Posts: 1
Joined: Fri Jun 15, 2007 08:50

Postby jscholtysik on Fri Jun 15, 2007 09:04

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
Last edited by jscholtysik on Sun Jul 15, 2007 11:06, edited 1 time in total.
********************************************************
Was wir alleine nicht schaffen, das schaffen wir dann zusammen... oder auch nicht
********************************************************
User avatar
jscholtysik
 
Posts: 847
Joined: Fri Jan 07, 2005 12:55
Location: Munich

Postby ourpobox on Sun Jul 15, 2007 09:00

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
ourpobox
 
Posts: 54
Joined: Wed Jun 02, 2004 14:41
Location: Virginia, USA

Postby StefanTS on Mon Jul 16, 2007 16:07

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
StefanTS
 
Posts: 6
Joined: Tue Jul 10, 2007 13:31

Postby munzli on Wed Aug 15, 2007 12:57

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]
munzli
 
Posts: 20
Joined: Wed Oct 25, 2006 17:04
Location: Zürich, Switzerland

Postby nehemia on Tue Aug 28, 2007 14:28

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
nehemia
 
Posts: 109
Joined: Mon Sep 11, 2006 19:19
Location: Fürth

Postby munzli on Tue Aug 28, 2007 15:46

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;)/','&amp;',$_SERVER['REQUEST_URI']);


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

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

         
            // remove offset parameter for permalink
            $permalink = preg_replace("/&amp;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&amp;length=5&amp;".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("/&amp;offset=\d*/i", "", $prevlink);

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



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

         {

              $prevlink .= "&amp;";

            $nextlink .= "&amp;";

         }

         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 &gt;&gt;</a></span>";
         }

         if (db_num_entries($bid)-($start + $pp) > 0) {
            $s .= "<a href='$prevlink'>&lt;&lt; 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
munzli
 
Posts: 20
Joined: Wed Oct 25, 2006 17:04
Location: Zürich, Switzerland

Postby MrPotter on Tue Aug 28, 2007 19:53

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
MrPotter
 
Posts: 22
Joined: Tue Oct 10, 2006 08:33

Postby nehemia on Wed Aug 29, 2007 16:00

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
nehemia
 
Posts: 109
Joined: Mon Sep 11, 2006 19:19
Location: Fürth

PreviousNext

Return to hacks & enhancements

Who is online

Users browsing this forum: Alexa [Bot], DF6IH and 0 guests