QR-Code zeigt kein img mehr an !?

Hier bekommst Du deutschsprachigen Support. Keine Fehlermeldungen oder Erweiterungswünsche bitte!
Old Boy
Posts: 1203
Joined: Fri 23. Nov 2012, 13:52

QR-Code zeigt kein img mehr an !?

Post by Old Boy »

Seit ewigen Zeiten hatte ich das Script nicht mehr verwendet. Jetzt aber habe mal wieder damit experimentieren wollen und stelle fest, es wird kein Image angezeigt.
Hat sich da ggf. etwas geändert, von dem ich oder das Script nichts weiss?
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: QR-Code zeigt kein img mehr an !?

Post by update »

habe vor zwei Wochen so einen QR_Code eingebaut und kann sagen: rennt:

Code: Select all

<div class="qrcode">{QR_CODE240}</div>
Muss natürlich das Script in FE-Render rein... ;)

Ach ja: phpwcms 1.7.5 (2014/10/02, r538)
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Old Boy
Posts: 1203
Joined: Fri 23. Nov 2012, 13:52

Re: QR-Code zeigt kein img mehr an !?

Post by Old Boy »

Komisch... welches Script hast du denn verwendet?
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: QR-Code zeigt kein img mehr an !?

Post by update »

Das hier:

Code: Select all

<?php
// ----------------------------------------------------------------
// simple current url qr-code generator
// TAG {QR_CODE}, {QR_CODE 200}, {QR_CODE175}
// e.g. 200 or 175 are the dimensions of the image
//
// OG (Oliver Georgi): 16.02.2012
// ----------------------------------------------------------------

// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {die("You Cannot Access This Script Directly, Have a Nice Day.");}
// ----------------------------------------------------------------

if(preg_match('/\{QR_CODE(.*?)\}/', $content['all'], $qr_code)) {

   $qr_code['size'] = abs(intval(trim($qr_code[1])));

   if(empty($qr_code['size'])) {
      $qr_code['size'] = 150; // default size
   }

   $qr_code['url'] = rawurlencode( abs_url(array(),array(),'','') );

   $content['all'] = str_replace(
      $qr_code[0],
      '<img src="http://chart.apis.google.com/chart?cht=qr&chl='.$qr_code['url'].'&chs='.$qr_code['size'].'x'.$qr_code['size'].'" alt="QR Direct Link" />',
      $content['all']
   );

}
?>
Das alt="QR Direct Link" könnte noch optimiert werden...

Edit: ist aus dem wiki
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Old Boy
Posts: 1203
Joined: Fri 23. Nov 2012, 13:52

Re: QR-Code zeigt kein img mehr an !?

Post by Old Boy »

Komisch... das hatte ich doch auch im render Ordner????

Na, werd' ich's halt noch mal rein packen und sehen, ob's dann funktioniert?
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: QR-Code zeigt kein img mehr an !?

Post by update »

habs erweitert für den Artikeltitel in der ALT-Beschreibung, sollte gehen:

Code: Select all

<?php
// ----------------------------------------------------------------
// simple current url qr-code generator
// TAG {QR_CODE}, {QR_CODE 200}, {QR_CODE175}
// e.g. 200 or 175 are the dimensions of the image
//
// OG (Oliver Georgi): 16.02.2012
// ----------------------------------------------------------------

// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {die("You Cannot Access This Script Directly, Have a Nice Day.");}
// ----------------------------------------------------------------


if(preg_match('/\{QR_CODE(.*?)\}/', $content['all'], $qr_code)) {

   $qr_code['size'] = abs(intval(trim($qr_code[1])));

   if(empty($qr_code['size'])) {
      $qr_code['size'] = 150; // default size
   }

   $qr_code['url'] = rawurlencode( abs_url(array(),array(),'','') );

   $content['all'] = str_replace(
      $qr_code[0],
      '<img src="http://chart.apis.google.com/chart?cht=qr&chl='.$qr_code['url'].'&chs='.$qr_code['size'].'x'.$qr_code['size'].'" alt="{ARTICLE_TITLE}" />',
      $content['all']
   );

}

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

    // {ARTICLE_TITLE}  -> ARTICLE_TITLE replacement
    // -----------------------------------------------------
    if( ! (strpos($content["all"],'{ARTICLE_TITLE}')===false)) {
       $content["all"] = str_replace('{ARTICLE_TITLE}', $content['article_title'], $content["all"]);
    }
}
?>
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Old Boy
Posts: 1203
Joined: Fri 23. Nov 2012, 13:52

Re: QR-Code zeigt kein img mehr an !?

Post by Old Boy »

Dein Script hat leider nicht funktioniert :(

Ich hatte es jetzt folgendermassen gemacht ... und es hat funktioniert :D

Code: Select all

<?php
// ----------------------------------------------------------------
// simple current url qr-code generator
// TAG {QR_CODE}, {QR_CODE 200}, {QR_CODE175}
// e.g. 200 or 175 are the dimensions of the image
//
// OG (Oliver Georgi): 16.02.2012
// ----------------------------------------------------------------

// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {die("You Cannot Access This Script Directly, Have a Nice Day.");}
// ----------------------------------------------------------------

if(preg_match('/\{QR_CODE(.*?)\}/', $content['all'], $qr_code)) {

   $qr_code['size'] = abs(intval(trim($qr_code[1])));

   if(empty($qr_code['size'])) {
      $qr_code['size'] = 150; // default size
   }

   $qr_code['url'] = rawurlencode( abs_url(array(),array(),'','') );

   $content['all'] = str_replace(
      $qr_code[0],
      '<img src="https://chart.googleapis.com/chart?chs='.$qr_code['size'].'x'.$qr_code['size'].'&cht=qr&chl='.$qr_code['url'].'" />',
      $content['all']
   );

}
?>
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: QR-Code zeigt kein img mehr an !?

Post by update »

Der Code funktioniert hier. Ist vielleicht nicht die feine Art, aber...
Aber gut, wenn Du jetzt, mit diesem Schubs, Erfolg hattest :)
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Old Boy
Posts: 1203
Joined: Fri 23. Nov 2012, 13:52

Re: QR-Code zeigt kein img mehr an !?

Post by Old Boy »

Mensch claus... was sind wir zwei super "Fachleute"...

Keine Ahnung von PHP, aber "La Paloma" pfeifen :lol: :lol: :lol:
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: QR-Code zeigt kein img mehr an !?

Post by update »

Old Boy wrote:Keine Ahnung von PHP, aber "La Paloma" pfeifen :lol: :lol: :lol:
WOLLJA! :mrgreen:
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
nameless1
Posts: 880
Joined: Sun 27. Apr 2008, 23:22

Re: QR-Code zeigt kein img mehr an !?

Post by nameless1 »

Old Boy wrote: Ich hatte es jetzt folgendermassen gemacht ... und es hat funktioniert :D
google hat die api angepasst. kannst du das bitte gleich ins wiki heben. das dort befindliche script funktioniert ja nur noch suboptimal.
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: QR-Code zeigt kein img mehr an !?

Post by update »

nameless1 wrote:kannst du das bitte gleich ins wiki heben
den code von OldBoy?
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: QR-Code zeigt kein img mehr an !?

Post by update »

hab mal angenommen, dass Du das meintest und das wiki aktualisiert (en + de)
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
nameless1
Posts: 880
Joined: Sun 27. Apr 2008, 23:22

Re: QR-Code zeigt kein img mehr an !?

Post by nameless1 »

danke.

bin gerade ein bisschen unsicher ob die api von google komplett depreceated ist?!? dann sollten wir das auch so ins wiki schreiben.
User avatar
juergen
Moderator
Posts: 4556
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Re: QR-Code zeigt kein img mehr an !?

Post by juergen »

Sie hat noch 3 Monate !
Google will announce if it intends to discontinue or make backwards incompatible changes to this API or Service. Google will use commercially reasonable efforts to continue to operate those Google Chart Tools versions and features identified at http://developers.google.com/chart/chart-api-list without these changes until April 20, 2015, unless (as Google determines in its reasonable good faith judgment):

required by law or third party relationship (including if there is a change in applicable law or relationship), or
doing so could create a security risk or substantial economic or material technical burden.
The above policy is the "Deprecation Policy."

After April 20, 2015, this Deprecation Policy will not apply.
Das erinnert mich an:
Wenn der Hahn kräht auf dem Mist, ändert sich das Wetter oder es bleibt wies' ist
:mrgreen:
Post Reply