Guest book

V tejto téme sa nachádzajú snippety (rozšírenia) pre Etomite.

Moderátor: Moderators

em
Thief
Thief
Príspevky: 6
Dátum registrácie: Ut Sep 05, 2006 12:55 pm
Kontaktovať užívateľa:

Guest book

Príspevok od užívateľa em » Št Sep 14, 2006 8:06 pm

ludia pomozte s nejakym guest bookom neviem co tam presne treba upravit aby siel dajte nejaky kratky navod a ktory snippet si vybrat tusim su tam aspon 4
trnky brnky

Užívateľov profilový obrázok
_rasel^
ETOMITE Admin
ETOMITE Admin
Príspevky: 1122
Dátum registrácie: Ut Sep 20, 2005 1:03 am
Bydlisko: Košice (SR)
Kontaktovať užívateľa:

Príspevok od užívateľa _rasel^ » Št Sep 14, 2006 8:13 pm

Ak by si na fore pouzil funkciu hladania, tak by si urcite nasiel svoju odpoved... :eto:
..:: Etomite CMS → Rulezzz !.!.!. ::..

em
Thief
Thief
Príspevky: 6
Dátum registrácie: Ut Sep 05, 2006 12:55 pm
Kontaktovať užívateľa:

Príspevok od užívateľa em » St Sep 20, 2006 10:07 pm

hladat som hladal ale aj tak mi to nepomohlo, neviem co presne treba upravit a kde, trebars
//$gbookFolder: set to the folder where the entries should be stored and read from
$gbookFolder = isset($gbookFolder) ? $gbookFolder : 530;

hm ale kde mam ten nazov foldru napisat za rovnasa za bodkociarku? za za za pred pred :) proste mi nechce ist ta kniha :) tak mi pls porad co mam upravit v snippete aby to slo
trnky brnky

Užívateľov profilový obrázok
_rasel^
ETOMITE Admin
ETOMITE Admin
Príspevky: 1122
Dátum registrácie: Ut Sep 20, 2005 1:03 am
Bydlisko: Košice (SR)
Kontaktovať užívateľa:

Príspevok od užívateľa _rasel^ » St Sep 20, 2006 10:29 pm

Daj link na snippet, ktory pouzivas... niesom si uplne isty.
..:: Etomite CMS → Rulezzz !.!.!. ::..

em
Thief
Thief
Príspevky: 6
Dátum registrácie: Ut Sep 05, 2006 12:55 pm
Kontaktovať užívateľa:

Príspevok od užívateľa em » Št Sep 21, 2006 12:21 am

http://www.etomite.org/browsesnippets.h ... category=9

tento som skusal naposledy, ale v podstate to je jedno dal bych tam aj iny, ak poradis ktory
trnky brnky

Užívateľov profilový obrázok
churchyard
Czech LT
Czech LT
Príspevky: 181
Dátum registrácie: Ne Nov 06, 2005 4:40 pm
Bydlisko: Praha [CZ]
Kontaktovať užívateľa:

Príspevok od užívateľa churchyard » Št Sep 28, 2006 9:45 pm

Udejel usera guestbook, muzes mu vsecko zakazat, ale musi umet poslat Zpravy v ramci Etomite Manageru.
Nazev: GuestBook
Volas: [!GuestBook!]
Stranku necachuj

Kód: Vybrať všetko

/*
Snippet:        GuestBook2 (based on GuestBook) - Etomite v0.6.3 - Modified 2005-04-04

Created By:     Ralph A. Dahlgren - rad14701@yahoo.com
Modified By:    Mikko K. Lammi - lammikko@gmail.com - www.parea.fi

Demo URL:       http://www.parea.fi/raaputuksia/guestbook.html

Usage:          Create an Etomite user or admin as GuestBook owner in Etomite Manager
                Change $defaultadmin variable to match GuestBook owner
                OR
                Messages will be deposited into that mailbox, but only GuestBook
                messages will be displayed within the GuestBook listing.

Variables:      $gbtype - Referenced in GuestBook admin User Messages Subject
                $gbadmin - Etomite User/Admin who will receive this message

Examples:       Use the [!SnippetName!] syntax instead of regular [[SnippetName]]:
                [!GuestBook!] - Will use snippet defaults for $gbtype and $gbadmin
                [!GuestBook?gbtype=GuestBook&gbadmin=guestbook!] - Self Explanatory
                [!GuestBook?gbadmin=someuser!] - Uses $etomite->documentObject['pagetitle'] for $gbtype
                [!GuestBook?bgtype=SomeTopic!] - Uses $defaultadmin for $gbadmin

Note:           $etomite->documentObject['createdby'] was not used for $gbadmin intentionally
                To implement this capability would entail and additonal DB Query before Inserts
*/

// BEGIN SETTINGS -------------------------------------------------------------

// Variables you may want to change

$defaultadmin = "guestbook"; // Default GuestBook admin to use if $gbadmin not passed
$gap = " :: "; // Separator between $type and $subject in User Messages Subject field
$messages = 10; // Number of messages on one page
$header_style = ""; // Css style for header
$message_box_style = "style='border: 1px solid #DDA729; padding: 5px;'"; // Css style for message box
$dateformat = "%d.%m.%Y v %H:%M:%S"; // Preferred Date & Time display format, European dateformat is "%d.%m.%Y %H:%M:%S"
$order = "DESC"; // Order of messages by postdate: DESC = descending, ASC = ascending

// Czech language for guestbook

$_lang_guestbook["write_new_message"] = "Přidat zprávu";
$_lang_guestbook["messages"] = "Zprávy";
$_lang_guestbook["name_or_alias"] = "Jméno";
$_lang_guestbook["send"] = "Poslat";
$_lang_guestbook["reset"] = "Reset";
$_lang_guestbook["next_page"] = "Další strana";
$_lang_guestbook["previous_page"] = "Předchozí strana";
$_lang_guestbook["message"] = "Zpráva";
$_lang_guestbook["date_and_time"] = "Datum a čas";
$_lang_guestbook["sender"] = "Autor";
$_lang_guestbook["error"] = "GuestBook User/Manager nenalezen... Zkontrolujte nastavení...";

// English language for guestbook
/*
$_lang_guestbook["write_new_message"] = "Write a new message";
$_lang_guestbook["messages"] = "Messages";
$_lang_guestbook["name_or_alias"] = "Name or alias";
$_lang_guestbook["send"] = "Send";
$_lang_guestbook["reset"] = "Reset";
$_lang_guestbook["next_page"] = "Next page";
$_lang_guestbook["previous_page"] = "Previous page";
$_lang_guestbook["message"] = "Message";
$_lang_guestbook["date_and_time"] = "Date and time";
$_lang_guestbook["sender"] = "Sender";
$_lang_guestbook["error"] = "GuestBook User/Manager not found... Check your settings...";
*/

// END SETTINGS ---------------------------------------------------------------



// Variables you should not need to change
$type = isset($gbtype) ? $gbtype : $etomite->documentObject['pagetitle']; // Set $type field for new entry
$trimtype=substr($type,0,15); // Truncate $type to 15 character limit for field
$guestbookadmin = isset($gbadmin) ? $gbadmin : $defaultadmin; // Set GuestBook admin
$pageid=$etomite->documentIdentifier; // ID of the calling document
$tbl = $etomite->dbConfig['dbase'].".".$etomite->dbConfig['table_prefix'];
$msgdb = $tbl."user_messages"; // DB.Prefix_user_messages variable

// Function to make hyperlinks
function hyperlink($text) {
    $search = array ("/([\w\.\/\&\=\?\-]+)@([\w\.\/\&\=\?\-]+)/","/((ftp(7?):\/\/)|(ftp\.))([\w\.\/\&\=\?\-]+)/","/((http(s?):\/\/)|(www\.))([\w\.\/\&\=\?\-]+)/");
    $replace = array ("<a href='mailto:$1@$2'>$1@$2</a>","<a href='ftp$3://$4$5' target='_blank'>$4$5</a>","<a href='http$3://$4$5' target='_blank'>$4$5</a>");
    return preg_replace ($search, $replace, $text);
}

// Don't allow unwanted re-posts of messages
if($_POST['submitted'] == "TRUE") header( "Location: index.php?id=$etomite->documentIdentifier" );

// Query for the user ID (id) for the GuestBook owner
$sql = "SELECT id FROM ".$tbl."manager_users WHERE ".$tbl."manager_users.username='$guestbookadmin';";
$rs = $etomite->dbQuery($sql);
$limit = $etomite->recordCount($rs);

// Check to make sure $guestbookadmin has been created and assigned
if($limit == 1) {

    $userrec = $etomite->fetchRow($rs);
    $userid = $userrec['id'];

    // Check to see if a valid message has been submitted
    if(isset($_POST['submit']) && ($_POST['subject'] > "")  && ($_POST['message'] > "")){
        $postdate = time();

        $recipient = $userid;
        $subject = $type . $gap . strip_tags($_POST['subject']);
        $message = strip_tags($_POST['message']);

        // Query to INSERT a new GuestBook message into user_messages
        $sql = "INSERT INTO $msgdb ( id , type , subject , message , sender , recipient , private , postdate , messageread ) VALUES ( '', '$type', '$subject', '$message', '0', '$recipient', '0', '$postdate', '0' );";

        $rs = $etomite->dbQuery($sql);  // Execute the Query
        $submitted="TRUE";
    }
    else $submitted = "TRUE";

    // Display write new message form
    if ($_GET['new_message'] == "TRUE") {
        // Display a Form for submitting a new message
        $output .= "<br />";
        $output .= "<table width='100%'><tr><td>";
        $output .= "<form method='post' action='index.php'>";
        $output .= "<input type='hidden' name='id' value='$pageid' />";
        $output .= "<input type='hidden' name='submitted' value='$submitted' />";
        $output .= $_lang_guestbook["name_or_alias"]."<br /><input name='subject' size='40' />";
        $output .= "<br /><br />".$_lang_guestbook["message"]."<br /><text"."area rows='8' cols='50' name='message'></"."text"."area><br /><br />";
        $output .= "<input type='submit' class='button' name='submit' value='".$_lang_guestbook["send"]."' />";
        $output .= "  <input type='reset' class='button' name='reset' value='".$_lang_guestbook["reset"]."' />";
        $output .= "</form>";
        $output .= "</td></tr></table>";
    }
  
    // Display write new message link
    else {
        $output .= "<br />";
        $output .= "<input class='button' type='button' value='" . $_lang_guestbook["write_new_message"] . "' onClick=\"window.location.href='index.php?id=" . $pageid . "&new_message=TRUE'\"><br /><br />";
    }
  
    $output .= "<br />";

    // Query to COUNT existing messages
    $sql = "SELECT * FROM ".$tbl."user_messages
    WHERE ".$tbl."user_messages.recipient=$userid
    AND ".$tbl."user_messages.type='".$trimtype."'
    ORDER BY ".$tbl."user_messages.postdate $order;";

    $rs = $etomite->dbQuery($sql);  // Execute the Query
    $total = $etomite->recordCount($rs);  // Number of messages found

    // Message page number from GET
    if (isset($_GET["page"])) { $page = $_GET["page"]; }
    else { $page = 1; }

    // Index where to start in result set
    $from = 0 + ($page-1)*$messages;

    // Query to SELECT existing messages
    $sql = "SELECT * FROM ".$tbl."user_messages
    WHERE ".$tbl."user_messages.recipient=$userid
    AND ".$tbl."user_messages.type='".$trimtype."'
    ORDER BY ".$tbl."user_messages.postdate $order LIMIT $from, $messages;";

    $rs = $etomite->dbQuery($sql);  // Execute the Query
    $limit = $etomite->recordCount($rs);  // Number of messages found

    // Number of pages
    $pages = ceil($total/$messages);

    // Previous page link
    $previouspage = $page-1;
    $previouspage_text = "<input class='button' type='button' value='«" . $_lang_guestbook["previous_page"] . " [" . $previouspage . "/" . $pages ."]' onClick=\"window.location.href='index.php?id=" . $pageid . "&page=" . $previouspage . "'\">";

    // Next page link
    $nextpage = $page+1;
    $nextpage_text = "<input class='button' type='button' value='»" . $_lang_guestbook["next_page"] . " [" . $nextpage . "/" . $pages ."]' onClick=\"window.location.href='index.php?id=" . $pageid . "&page=" . $nextpage . "'\">";

    // Previous and next page links at top of the page
    if ($previouspage > 0) { $output .= $previouspage_text; }
    if ($nextpage <= $pages) { $output .= $nextpage_text; }

    // Empty lines
    if ($total > $messages) {
        $output .= "<br /><br />";
    }

    // Loop through each of the messages and format for display
    for ($y = 0; $y < $limit; $y++) {
        if ($order == "DESC") { $number = $total - $from - $y; }
        if ($order == "ASC") { $number = $from + $y + 1; }
        $guestbookrec = $etomite->fetchRow($rs);
        $poster = str_replace($type.$gap,"",$guestbookrec['subject']);
        $message = nl2br($guestbookrec['message']);
        $postdate = strftime($dateformat, $guestbookrec['postdate']+$server_offset_time);
        $output .= "<fieldset><legend>" . $poster . "</legend>";
        $output .= "<div align='right'><b>" . $postdate . "</b></div>";
        $output .= "<div align='left'>" . hyperlink($message) . "</left>"; 
        $output .= "<div align='right'>" . $_lang_guestbook["message"] . ":&nbsp;&nbsp;" . $number . "/" . $total . "</div>";
        $output .= "</fieldset>";
    }

    // Previous and next page links at bottom of the page
    if ($previouspage > 0) { $output .= $previouspage_text; }
    if ($nextpage <= $pages) { $output .= $nextpage_text; }
}

// If no valid GuestBook owner is found display error message...
else  $output = $_lang_guestbook["error"];

// Output
return $output;
Demo: http://www.prdi.cz/index.php?id=68
  • The Neverhood - Československý web o Neverhoodovi
  • P.R.D.I. - nejlepší folkrock široko daleko
  • Yozzefy - hudební gulášek známých písní

Užívateľov profilový obrázok
Marek Adamec
Medium Star
Medium Star
Príspevky: 246
Dátum registrácie: Pi Dec 28, 2007 7:58 pm
Bydlisko: Dubnica nad Váhom
Kontaktovať užívateľa:

Re: Guest book

Príspevok od užívateľa Marek Adamec » Ut Aug 05, 2008 10:45 am

takze nainstaloval som si snippet pre knuhu navstev, presnejsie tento snippet: http://www.etomite.com/browsesnippets.h ... category=9 ale ked som ho vlozil do vytvorenej podstranky tak mi vypisuje toto: There are no entries in the guestbook. http://www.navrchol.sk/index.php?id=419 Kde som spravil chybu?

Užívateľov profilový obrázok
_rasel^
ETOMITE Admin
ETOMITE Admin
Príspevky: 1122
Dátum registrácie: Ut Sep 20, 2005 1:03 am
Bydlisko: Košice (SR)
Kontaktovať užívateľa:

Re: Guest book

Príspevok od užívateľa _rasel^ » Ut Aug 05, 2008 10:54 pm

Máš ho dobre nakonfigurovaný? Pozri si podrobne obsah snippetu.
..:: Etomite CMS → Rulezzz !.!.!. ::..

Užívateľov profilový obrázok
Marek Adamec
Medium Star
Medium Star
Príspevky: 246
Dátum registrácie: Pi Dec 28, 2007 7:58 pm
Bydlisko: Dubnica nad Váhom
Kontaktovať užívateľa:

Re: Guest book

Príspevok od užívateľa Marek Adamec » St Aug 06, 2008 9:09 am

No ja som ho tam len skopiroval nic som vtom snippete neprepisoval... som nevedel ze tam treba nieco prepisat... a neviem zatial ani kde..

Kód: Vybrať všetko

// set variables here
//$gbookFolder: set to the folder where the entries should be stored and read from
$gbookFolder = isset($gbookFolder) ? $gbookFolder : 530;
//$entriesPerPage: set the number of entries per page
$entriesPerPage = isset($entriesPerPage) ? $entriesPerPage : 10;
//$thxPageId: set to the page id where the visitor should be redirected to after writing the entry
$thxPageId = isset($thxPageId) ? $thxPageId : 531;
//$rePostProtection: set to the seconds a visitor which just created an entry has to wait to create a new one
$repostProtection = 30;
//$minCaptchaLength: set to the minimal length of the captcha text
$minCaptchaLength = 6;
//$maxCaptchaLength: set to the maximal length of the captcha text
$maxCaptchaLength = 12;
//$maxURLLength: maximal length of an url before it is shortened, unit: chars
$maxURLLength = 25;
// you can adjust the output of the script below the line 257

// do not change things below this line until you know what you are doing!
// set the chunk names
$chunkForm = 'kgbook-newentryfrm';
$chunkEntryDisplay = 'kgbook-entrydisplay';
$chunkPageNavigation = 'kgbook-pagenavigation';
$chunkSummary = 'kgbook-summary';
$chunkAlreadyEntered = 'kgbook-alreadyEntered';
// init variables
$entryFormular = '';
$entriesView = '';
$pageNavigation = '';
$output = '';
$gbookSessionID = md5($_SERVER['HTTP_HOST'] . 'KGbook2sessionID');
// provides support for multilanguage - primary for the error strings
function langString($key) {
	$noKeyFound = 'Appropiate language string for <em>'.$key.'</em> not found.';
	$langArray = array (
		'error_head' => 'Sorry, there are errors:',
		'error_name' => 'You have to enter a name',
		'error_mail' => 'The mail adress is empty or has the wrong format',
		'error_message' => 'There is no entry for the guest book!',
		'error_weburl' => 'The adress of your homepage is obviously wrong.',
		'error_DBQuery' => 'Error while accessing the database.',
		'error_captcha' => 'The captcha code is wrong or has not been entered.',
		'dateTimeFormat' => 'd-m-Y - H:i',
		'noEntriesFound' => 'There are no entries in the guestbook.',
		'nextPage' => 'Next page',
		'prevPage' => 'Previous page',
		'firstPage' => 'First page'
	);
	$langStr = $langArray[$key];
	$result = empty($langStr) ? $noKeyFound : $langStr;
	return $result;
}

// create new entry form
$formChunk = $etomite->putChunk($chunkForm);
$gbookCaptcha = $etomite->getCaptchaCode(rand($minCaptchaLength, $maxCaptchaLength), 'captcha code', 'captcha Code');

$formChunk = str_replace(array('%actionurl%', '%captcha%', '%maxcaptcha%'), array($PHP_SELF, $gbookCaptcha, $maxCaptchaLength), $formChunk);
$entryFormular .= "<script type=\"text/javascript\">\n".
	"function Check () {\n".
	"	var alerttext = \"".langString('error_head')."\\n\\n\";\n".
	"	var result;\n".
	"	if (document.newentry.gbook_name.value == \"\") {\n".
	"		alerttext += \"- ".langString('error_name')."\\n\";\n".
	"		result = false;\n".
	"	}\n".
	"	if (document.newentry.gbook_email.value == \"\") {\n".
	"		alerttext += \"- ".langString('error_mail')."\\n\";\n".
	"		result = false;\n".
	"	} else if (CheckMail(document.newentry.gbook_email.value) == false) {\n".
	"		alerttext += \"- ".langString('error_mail')."\\n\";\n".
	"		result = false;\n".
	"	}\n".
	"	if (document.newentry.gbook_security.value == \"\") {\n".
	"		alerttext += \"- ".langString('error_captcha')."\\n\";\n".
	"		result = false;\n".
	"	}\n".
	"	if (document.newentry.gbook_message.value == \"\") {\n".
	"		alerttext += \"- ".langString('error_message')."\\n\";\n".
	"		result = false;\n".
	"	}\n".
	"	if (result == false) {\n".
	"		alert(alerttext);\n".
	"		return false;\n".
	"	}\n".
	"}\n".
	"function CheckMail(email) {\n".
	"//thx to http://www.quirksmode.org/js/mailcheck.html\n".
	"	var regex  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;".
	"	var rgx = new RegExp(regex);\n".
	"	return rgx.exec(email) ? true : false;\n".
	"}\n".
	"</script>\n";
$entryFormular .= $formChunk;
// end create new entry form

$allowedToPost = true;
if (isset($_SESSION[$gbookSessionID])) {
	$diffTime = time() - $_SESSION[$gbookSessionID];
	$allowedToPost = ($diffTime <= $repostProtection) ? false : true;
}

if ((isset($_POST['ce'])) && ($allowedToPost)) {
	$errorMessage = '';
	$abort = false;

	$fields = $etomite->getFormVars($method='POST', $prefix='gbook_', $trim=true, $REQUEST_METHOD);
	
	$errorMessage .= '<div class="error"><h3>'.langString('error_head').'</h3>';

	if (!isset($_POST['gbook_security']) || !$etomite->validCaptchaCode($_POST['gbook_security'])) {
		$abort = true;
		$errorMessage .= '<li>'.langString('error_captcha').'</li>';
	}

	if (strlen($fields['name']) == 0) {
		$abort = true;
		$errorMessage .= '<li>'.langString('error_name').'</li>';
	}

	if (!preg_match('/^[A-Z0-9._-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/i', $fields['email'])) {
		$abort = true;
		$errorMessage .= '<li>'.langString('error_mail').'</li>';
	}

	if (($fields['weburl'] != '') && (!preg_match('/^http?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+/i', $fields['weburl']))) {
		$fields['weburl'] = '';
	}

	if (strlen($fields['message']) == 0) {
		$abort = true;
		$errorMessage .= '<li>'.langString('error_message').'</li>';
	}

	$errorMessage .= '</div>';
	
	if ($abort == true) {
		$entryFormular .= $errorMessage;
	} else {
		$entryName = strip_tags($fields['name']);
		$entryEmail = strip_tags($fields['email']);
		$entryWeburl = strip_tags($fields['weburl']);
		$entryMessage = strip_tags($fields['message']);
		$entryMessage = nl2br($fields['message']);
		$userIP = $_SERVER['REMOTE_ADDR'];
		//create array for database access
		$newGbE = array();
		$newGbE['pagetitle'] = date(langString('dateTimeFormat'), time()) . ': ' . $entryName;
		$newGbE['type'] = 'document';
		$newGbE['longtitle'] = 'guestbookentry';
		$newGbE['description'] = "$entryName;$entryEmail;$entryWeburl;$userIP";
		$newGbE['published'] = 0;
		$newGbE['content'] = $entryMessage;
		$newGbE['richtext'] = 0;
		$newGbE['searchable'] = 0;
		$newGbE['cacheable'] = 0;
		$newGbE['parent'] = $gbookFolder;
		$newGbE['createdon'] = time();
		$dbQuery = $etomite->putIntTableRow($fields=$newGbE, $into='site_content');
		if ($dbQuery == true) {
			$redirectUrl = $etomite->makeURL($thxPageId);
			$gbookSid = $gbookSessionID;
			$_SESSION[$gbookSessionID] = time();
			$etomite->sendRedirect($redirectUrl);
		} else {
			$entryFormualr .= '<div class="error">'.langString('error_DBQuery').'</div>';
		}
	}
} else if ($allowedToPost == false) {
	$entryFormular = $etomite->putChunk($chunkAlreadyEntered);
}
// end create entry

// create entry view
$dbRs = $etomite->getIntTableRows($fields = '*', $from = "site_content", $where = 'parent="'.$gbookFolder.'" AND published="0" AND longtitle="guestbookentry" AND deleted="0"', $sort = 'createdon', $dir = 'DESC');
if ($dbRs == false) {
	$entriesView .= '<div class="gbook-noentries">'.langString('noEntriesFound').'</div>';
	$recordCount = 0;
} else {
	$start = isset($_GET['start']) ? $_GET['start'] : 0;
	$end = $start + $entriesPerPage;
	$entryChunk = $etomite->putChunk($chunkEntryDisplay);
	$recordCount = count($dbRs);
	for ($i = $start; $i != $end; $i++) {
		$dbRow = $dbRs[$i];
		if (!empty($dbRow)) {
			$thisEntry = "";
			$entryInfo = explode(';', $dbRow['description']);

			$entryWeburlDescription = $entryInfo[2];

			if (strlen($entryWeburlDescription) > $maxURLLength) {
				$entryWeburlDescription = substr($entryWeburlDescription, 0, $maxURLLength - 3) . '...';
			}

			$entryName = $entryInfo[0];
			$entryMail = $entryInfo[1];
			$entryWeburl = '<a href="'.$entryInfo[2].'" title="'.$entryInfo[2].'">'.$entryWeburlDescription.'</a>';
			$entryMessage = $dbRow['content'];
			$entryDateTime = date(langString('dateTimeFormat'), $dbRow['createdon']);
			$entryNumber = $recordCount - $i;
			$thisEntry = $entryChunk;

			$thisEntry = str_replace(array('%name%', '%mail%', '%weburl%', '%message%', '%datetime%', '%number%'), array($entryName, $entryMail, $entryWeburl, $entryMessage, $entryDateTime, $entryNumber), $thisEntry);

			$entriesView .= $thisEntry;
		}
	}
}
// end create entry view

// create page view
$pageCount = ceil($recordCount / $entriesPerPage);
$currentPage = (int)($start / $entriesPerPage + 1);
$nextPageStart = $start + $entriesPerPage;
$prevPageStart = $start - $entriesPerPage;
$firstPageStart = 0;
$thisPageUrl = $etomite->makeURL($etomite->documentObject['id']);
$nextPageText = langString('nextPage');
$prevPageText = langString('prevPage');
$firstPageText = langString('firstPage');
$thisPageUrl = $etomite->makeURL($etomite->documentObject['id']);
$nextPageLink = '<a class="nextPage" href="'.$thisPageUrl.'&start='.$nextPageStart.'" title="'.$nextPageText.'">'.$nextPageText.'</a>';
$prevPageLink = '<a class="prevPage" href="'.$thisPageUrl.'&start='.$prevPageStart.'" title="'.$prevPageText.'">'.$prevPageText.'</a>';
$firstPageLink = '<a class="firstPage" href="'.$thisPageUrl.'&start='.$firstPageStart.'" title="'.$firstPageText.'">'.$firstPageText.'</a>';
$pageNavigation = $etomite->putChunk($chunkPageNavigation);
$pageNavigation = str_replace('%entrycount%', $recordCount, $pageNavigation);
$pageNavigation = str_replace('%currentpage%', $currentPage, $pageNavigation);
$pageNavigation = str_replace('%pagecount%', $pageCount, $pageNavigation);

// first
if ((($pageCount == $currentPage) && ($recordCount < $entriesPerPage)) || ($recordCount < $entriesPerPage)) {
	$pageNavigation = '';
}
if (($pageCount > $currentPage) && ($currentPage == 1)) {
	$pageNavigation = str_replace(array('%nextpage%', '%prevpage%', '%firstpage%'), array($nextPageLink, '', ''), $pageNavigation);
}
// middle
if (($currentPage < $pageCount) && ($currentPage != 1)) {
	$pageNavigation = str_replace(array('%nextpage%', '%prevpage%', '%firstpage%'), array($nextPageLink, $prevPageLink, $firstPageLink), $pageNavigation);
}
// end
if (($currentPage == $pageCount) && ($currentPage != 1)) {
	$pageNavigation = str_replace(array('%nextpage%', '%prevpage%', '%firstpage%'), array('', $prevPageLink, $firstPageLink), $pageNavigation);
}
// end create page view

// create summary
$gbookSummary = $etomite->putChunk($chunkSummary);
$gbookSummary = str_replace(array('%entrycount%', '%currentpage%', '%pagecount%'), array($recordCount, $currentPage, $pageCount), $gbookSummary);
// end create summary

// adjust the output here:
// $entryFormular: outputs the formular to create a new entry
// $pageNavigation: outputs the navigation
// $gbookSummary: some statistics
// $entriesView: the entries
// each of the items can used more than only one time
$output .= $entryFormular;
$output .= $pageNavigation;
$output .= $gbookSummary;
$output .= $entriesView;
$output .= $gbookSummary;
$output .= $pageNavigation;

// do not remove!!!
return $output;

Užívateľov profilový obrázok
_rasel^
ETOMITE Admin
ETOMITE Admin
Príspevky: 1122
Dátum registrácie: Ut Sep 20, 2005 1:03 am
Bydlisko: Košice (SR)
Kontaktovať užívateľa:

Re: Guest book

Príspevok od užívateľa _rasel^ » St Aug 06, 2008 9:58 am

Treba nakonfigurovať prvý odstavec.
  • $gbookFolder - je parameter, ktorý definuje ID dokumentu, kde sa snippet používa,
  • $entriesPerPage - počet komentárov (príspevkov) na stránku,
  • $thxPageId - ID dokumentu na ktorý bude užívateľ presmerovaný po napísaní príspevku (napr. stránka s poďakovaním).
To je základná konfigurácia. Snippet je plne funkčný na webe, ktorý sa neukladá do cache. Na fóre Etomite.com je celá téma venovaná tomuto snippetu - sú tam veľmi dôležité informácie o bezpečnostných úpravách kódu. A ako postupovať pri inštalácií pri rôznych verziách Etomite. Ja by som si radšej vybral snippet Guestbook3, alebo Guestbook2.
..:: Etomite CMS → Rulezzz !.!.!. ::..

Užívateľov profilový obrázok
Marek Adamec
Medium Star
Medium Star
Príspevky: 246
Dátum registrácie: Pi Dec 28, 2007 7:58 pm
Bydlisko: Dubnica nad Váhom
Kontaktovať užívateľa:

Re: Guest book

Príspevok od užívateľa Marek Adamec » Št Aug 07, 2008 8:36 am

no nastavil som to tak ako si povedal a stale to nejde....

Kód: Vybrať všetko

// set variables here
//$gbookFolder: set to the folder where the entries should be stored and read from
$gbookFolder = isset($gbookFolder) ? $gbookFolder : 419;
//$entriesPerPage: set the number of entries per page
$entriesPerPage = isset($entriesPerPage) ? $entriesPerPage : 20;
//$thxPageId: set to the page id where the visitor should be redirected to after writing the entry
$thxPageId = isset($thxPageId) ? $thxPageId : 1;
//$rePostProtection: set to the seconds a visitor which just created an entry has to wait to create a new one
$repostProtection = 30;
//$minCaptchaLength: set to the minimal length of the captcha text
$minCaptchaLength = 6;
//$maxCaptchaLength: set to the maximal length of the captcha text
$maxCaptchaLength = 12;
//$maxURLLength: maximal length of an url before it is shortened, unit: chars
$maxURLLength = 25;
// you can adjust the output of the script below the line 257
keby som videl nahlady tych knih navstevnosti tak by bolo lepsie sa rozhodnut....:)
napr.:

Užívateľov profilový obrázok
Marek Adamec
Medium Star
Medium Star
Príspevky: 246
Dátum registrácie: Pi Dec 28, 2007 7:58 pm
Bydlisko: Dubnica nad Váhom
Kontaktovať užívateľa:

Re: Guest book

Príspevok od užívateľa Marek Adamec » Pi Aug 15, 2008 11:47 am

nemoze byt problem vtom ze mam etomite 0.6.1 ?

Užívateľov profilový obrázok
_rasel^
ETOMITE Admin
ETOMITE Admin
Príspevky: 1122
Dátum registrácie: Ut Sep 20, 2005 1:03 am
Bydlisko: Košice (SR)
Kontaktovať užívateľa:

Re: Guest book

Príspevok od užívateľa _rasel^ » Pi Aug 15, 2008 2:34 pm

Myslím, že z verziou Etomite to nemá až tak veľa spoločné. Skús vyskúšať iný snippet na knihu návštev...
..:: Etomite CMS → Rulezzz !.!.!. ::..

Užívateľov profilový obrázok
Marek Adamec
Medium Star
Medium Star
Príspevky: 246
Dátum registrácie: Pi Dec 28, 2007 7:58 pm
Bydlisko: Dubnica nad Váhom
Kontaktovať užívateľa:

Re: Guest book

Príspevok od užívateľa Marek Adamec » Pi Aug 15, 2008 8:35 pm

skusam tam dat tuto: http://www.etomite.com/browsesnippets.h ... category=9 GuestBook2 ale vyhadzuje mi to toto:

Fatal error: Cannot redeclare hyperlink() (previously declared in /DISK2/WWW/navrchol.sk/www/index.php(578) : eval()'d code:83) in /DISK2/WWW/navrchol.sk/www/index.php(578) : eval()'d code on line 87

neviem co tam moze byt zle apravene, asi tam treba nieco nastavit... ale neviem co

Napísať odpoveď