NAVIGATION
This shows you the differences between two versions of the page.
|
english:other-enhancements:hacks:guestbook-hide_entry [2010/02/10 20:08] Knut Heermann (flip-flop) |
english:other-enhancements:hacks:guestbook-hide_entry [2018/06/03 18:09] (current) |
||
|---|---|---|---|
| Line 5: | Line 5: | ||
| FIXME translate | FIXME translate | ||
| - | A small enlargement to turn new guestbook entries invisible until they have been edited //(released)// in BE. | + | A small enlhancement to turn new guestbook entries invisible until they have been edited by admin //(released)// in BE. |
| - | **Expiration:** | + | **Explanation:** |
| - | * After submitting a new entry, an "[##]" is placed in front of the message text automatically ////(mini-hack)//. | + | * After submitting a new entry, a "[##]" is placed at the beginning of the message text automatically //(mini-hack)//. |
| - | * All entries that include an "[##]" will not displayed in the FE output, or an alternative text is displayed. //(Template/cp-trigger Script)//. | + | * All entries including a "[##]" will not be displayed in the FE output, or an alternative text is displayed. //(Template/cp-trigger Script)//. |
| - | * If "%%[##]%%" will be deleted from the entry in BE, the entry in FE is visible. //("[##]" can also be added in BE in order to hide entries)//. | + | * If "%%[##]%%" will be deleted from the entry in BE, the entry in FE will become visible. //("[##]" can also be added in BE in order to hide entries)//. |
| \\ | \\ | ||
| + | |||
| **Blocked Messages:** | **Blocked Messages:** | ||
| - | {{:deutsch:andere-erweiterungen:hacks:gb_entry_hide_fe01_1.gif| }} | + | |
| + | {{:english:other-enhancements:hacks:gb_entry_hide_fe01_en_1.gif| }} | ||
| {{:deutsch:andere-erweiterungen:hacks:gb_entry_hide_be01_2.gif|}} | {{:deutsch:andere-erweiterungen:hacks:gb_entry_hide_be01_2.gif|}} | ||
| + | |||
| + | \\ | ||
| **Unlocked Entries:** | **Unlocked Entries:** | ||
| + | |||
| {{:deutsch:andere-erweiterungen:hacks:gb_entry_hide_fe02_1.gif| }} | {{:deutsch:andere-erweiterungen:hacks:gb_entry_hide_fe02_1.gif| }} | ||
| {{:deutsch:andere-erweiterungen:hacks:gb_entry_hide_be02_2.gif|}} | {{:deutsch:andere-erweiterungen:hacks:gb_entry_hide_be02_2.gif|}} | ||
| + | |||
| + | |||
| \\ | \\ | ||
| - | ===== Voraussetzungen ===== | + | ===== Necessary preparations ===== |
| - | - dazu sind: | + | - as there are: |
| - | - Der Schalter **$phpwcms['guestbook_hidden'] = 1;** wird in die conf.inc.php eingetragen | + | |
| - | - Die Datei **include/inc_front/content/cnt18.article.inc.php** verändern //(kleiner Hack)// | + | - enter the switch **$phpwcms['guestbook_hidden'] = 1;** in conf.inc.php |
| - | - Im Template **template/inc_cntpart/guestbook/*.html** mind. zwei neue Tags einsetzen | + | - The file **include/inc_front/content/cnt18.article.inc.php** has to be changed a little bit //(small hack)// |
| - | - Das PHP-Script **template/inc_script/frontend_init/cp_trig_guestbook.php** installieren | + | - In template **template/inc_cntpart/guestbook/*.html** there have to be entered two new Tags (at least) |
| + | - The PHP-Script **template/inc_script/frontend_init/cp_trig_guestbook.php** has to be installed | ||
| \\ | \\ | ||
| + | |||
| ---- | ---- | ||
| + | |||
| Docu: -- \\ | Docu: -- \\ | ||
| Forum: -- | Forum: -- | ||
| Line 47: | Line 57: | ||
| ---- | ---- | ||
| + | |||
| \\ | \\ | ||
| - | **Tag** //(in der Vorlage)//: | + | **Tag** //(in template)//: |
| %%<!--GUESTBOOK_ENTRY_START//-->%% \\ | %%<!--GUESTBOOK_ENTRY_START//-->%% \\ | ||
| - | ##%%<!--##Begin-{DBID}##//-->%%## **... Eintrag ...** ##%%<!--##End-{DBID}##//-->%%## \\ | + | ##%%<!--##Begin-{DBID}##//-->%%## **... Entry ...** ##%%<!--##End-{DBID}##//-->%%## \\ |
| %%<!--GUESTBOOK_ENTRY_END//-->%% \\ | %%<!--GUESTBOOK_ENTRY_END//-->%% \\ | ||
| - | * Alles zwischen **%%<!--##Begin-{DBID}##//-->%%** und **%%<!--##End-{DBID}##//-->%%** wird getriggert und wenn ein [##] dort auftaucht nicht ausgeliefert. | + | * All between **%%<!--##Begin-{DBID}##//-->%%** and **%%<!--##End-{DBID}##//-->%%** will be triggered and will not be delivered in case a [##] is found. |
| In | In | ||
| - | <code html><!--##:AlternativText AlternativText:##//--></code> | + | <code html><!--##:Alternative AlternativText:##//--></code> |
| - | steht der Alternativtext der angezeigt wird wenn der Eintrag gesperrt ist. | + | the text is entered which will be shown in case the entry is locked, e.g. ''%%<!--##:<h2>{TIMESTAMP:d.m.Y H:i}</h2> :##//-->%%''. |
| - | **%%<!--##%%:**AlternativText AlternativText**:%%##//-->%%** muss irgendwo zwischen **%%<!--##Begin-{DBID}##//-->%%** und **%%<!--##End-{DBID}##//-->%%** gesetzt werden. \\ | + | **%%<!--##%%:**AlternativeText AlternativeText**:%%##//-->%%** has to be set anywhere between **%%<!--##Begin-{DBID}##//-->%%** and **%%<!--##End-{DBID}##//-->%%** . \\ |
| - | //(Wird dieser Alternativtext-Tag nicht verwendet, bleibt die Ausgabe für den gesperrten Eintrag leer)//. | + | //(If the alternative text is not set the output will stay empty)//. |
| \\ | \\ | ||
| - | **Beispiel:** | + | **Example:** |
| <code html> | <code html> | ||
| <!--GUESTBOOK_ENTRY_START//--> | <!--GUESTBOOK_ENTRY_START//--> | ||
| Line 73: | Line 84: | ||
| <!--##Begin-{DBID}##//--> | <!--##Begin-{DBID}##//--> | ||
| - | <!--##:<h1 style="padding-top:10px">Eintrag am {TIMESTAMP:m/d/Y H:i} von {NAME}</h1>:##//--> | + | <!--##:<h1 style="padding-top:10px">Entry on {TIMESTAMP:m/d/Y H:i} by {NAME}</h1>:##//--> |
| <h1><span class="entryID">entry #{ID} by </span>[URL]<a href="{URL}" target="_blank">{NAME}</a>[/URL][URL_ELSE]{NAME}[/URL_ELSE]</h1> | <h1><span class="entryID">entry #{ID} by </span>[URL]<a href="{URL}" target="_blank">{NAME}</a>[/URL][URL_ELSE]{NAME}[/URL_ELSE]</h1> | ||
| Line 91: | Line 102: | ||
| ==== conf.inc.php ==== | ==== conf.inc.php ==== | ||
| - | Mit diesem Schalter wird bestimmt, ob dieses Versteckspiel ein -oder ausgeschaltet ist. //(Ist der Schaltet nicht vorhanden ist das gleichbedeutend "0" = aus )//. | + | Here you can determine if the little guestbook hack is on or off. //(If not present at all this is equal to "0" = off )//. |
| - | In der config/phpwcms/conf.inc.php wird eingefügt | + | In config/phpwcms/conf.inc.php you'll enter |
| <code php> | <code php> | ||
| $phpwcms['guestbook_hidden'] = 1; // enable|disable hidden guestbook entry +KH090210 | $phpwcms['guestbook_hidden'] = 1; // enable|disable hidden guestbook entry +KH090210 | ||
| Line 100: | Line 111: | ||
| \\ | \\ | ||
| - | ==== Codeschnipsel (Hack) ==== | + | ==== Code snippet (hack) ==== |
| - | **Dateiname:** cnt18.article.inc.php \\ | + | **File name:** cnt18.article.inc.php \\ |
| - | **Ort:** include/inc_front/content/ | + | **Location:** include/inc_front/content/ |
| - | **Erweiterung** der Datei etwa ab Zeile 387: | + | **Enhancement** of the file around line 387: |
| - | Die Zeile | + | The line |
| <code php> | <code php> | ||
| $guestbook['sql'] .= "guestbook_msg='".aporeplace($guestbook['post']['msg'])."', "; | $guestbook['sql'] .= "guestbook_msg='".aporeplace($guestbook['post']['msg'])."', "; | ||
| </code> | </code> | ||
| \\ | \\ | ||
| - | wird ersetzt durch | + | will be replaced by |
| <code php> | <code php> | ||
| // Insert tag to hide entry ================= +KH090210 | // Insert tag to hide entry ================= +KH090210 | ||
| Line 124: | Line 135: | ||
| \\ | \\ | ||
| - | === Dokumentation === | + | === Documentation === |
| - | Die Datei PATCH-DOC01.php im Verzeichnis include/inc_front/content/ ablegen. //(Oder an einem anderen Ort und/oder mit anderem Namen - aber immer mit der Endung ***.php**) // | + | Save the file PATCH-DOC01.php in include/inc_front/content/ . //(Or at any other place or under any other name, but with the suffix ***.php**) // |
| Line 157: | Line 168: | ||
| - | ==== Vorlage ==== | + | ==== Template ==== |
| - | **Dateiname:** guestbook_vorlage.html \\ | + | **File name:** guestbook_vorlage.html \\ |
| - | **Ort:** template/inc_cntpart/guestbook/ | + | **Location:** template/inc_cntpart/guestbook/ |
| - | Hier müssen noch die Wrapper-Tags eingesetzt werden: | + | Here you'll have to insert the Wrapper-Tags: |
| - | Z.B.: | + | e.g.: |
| <code html> | <code html> | ||
| <!--GUESTBOOK_ENTRY_START//--> | <!--GUESTBOOK_ENTRY_START//--> | ||
| <!--##Begin-{DBID}##//--> | <!--##Begin-{DBID}##//--> | ||
| - | <!--##:ERSATZTEXT ERSATZTEXT ERSATZTEXT:##//--> | + | <!--##:SUBSTITUTETEXT SUBSTITUTETEXT SUBSTITUTETEXT:##//--> |
| ..... | ..... | ||
| ..... | ..... | ||
| Line 178: | Line 189: | ||
| <note important> | <note important> | ||
| - | Der Tag %%<!--##:ERSATZTEXT ERSATZTEXT ERSATZTEXT:##//-->%% muss innerhalb von \\ | + | The Tag %%<!--##:SUBSTITUTETEXT SUBSTITUTETEXT SUBSTITUTETEXT:##//-->%% has to be between \\ |
| **%%<!--##Begin-{DBID}##//-->%%** \\ | **%%<!--##Begin-{DBID}##//-->%%** \\ | ||
| - | %%<!--##:ERSATZTEXT ERSATZTEXT ERSATZTEXT:##//-->%% \\ | + | %%<!--##:SUBSTITUTETEXT SUBSTITUTETEXT SUBSTITUTETEXT:##//-->%% \\ |
| **%%<!--##End-{DBID}##//-->%%** \\ | **%%<!--##End-{DBID}##//-->%%** \\ | ||
| - | stehen. | ||
| </note> | </note> | ||
| Line 189: | Line 199: | ||
| ==== PHP ==== | ==== PHP ==== | ||
| - | **Dateiname:** cp_trig_guestbook.php \\ | + | In the area **%%CUSTOM VAR ==========================%%** \\ |
| - | **Ort:** template/inc_script/frontend_init/ | + | an additional text can be entered in **$replacement_text**, which is issued when an item is not yet released. This text will be displayed only if in template also the tag ''%%<!--##:AlternativText AlternativText:##//-->%%'' is used. |
| + | |||
| + | ---- | ||
| + | \\ | ||
| + | |||
| + | **File name:** cp_trig_guestbook.php \\ | ||
| + | **Location:** template/inc_script/frontend_init/ | ||
| <code php |h cp_trig_guestbook.php |h > | <code php |h cp_trig_guestbook.php |h > | ||
| Line 241: | Line 257: | ||
| // additional replacement text | // additional replacement text | ||
| - | $replacement_text = ' <span style="color:red"> [[Der Eintrag wird bearbeitet]]</span><br><br>'.LF; | + | // $replacement_text = ' <span style="color:red"> [[Der Eintrag wird bearbeitet]]</span><br><br>'.LF; |
| + | $replacement_text = ' <span style="color:red"> [[The entry will be processed]]</span><br><br>'.LF; | ||
| // ===================================== | // ===================================== | ||