Jump to content


how to change text in captcha code..


  • You cannot reply to this topic
9 replies to this topic

#1 pard1

    Etomite Forum Newbie

  • Member
  • 9 posts

Posted 27 April 2009 - 07:12 AM

How to change text in captcha code.. or make personally captcha in etomite ?

please help.

regard - pardi

#2 Dean

    Loves Etomite Forums!

  • Admin
  • 4,745 posts
  • Gender:Male

Posted 27 April 2009 - 08:45 AM

Log into the manager, then click the configuration link - on one of the tabs in there is where you choose the captcha words..

#3 pard1

    Etomite Forum Newbie

  • Member
  • 9 posts

Posted 28 April 2009 - 03:14 AM

ok, thanks DeanC.. I didn't pay attention for the configuration link.. :D

I have any question, how to change captcha size..? I need captcha size smaller :blush:

#4 Dean

    Loves Etomite Forums!

  • Admin
  • 4,745 posts
  • Gender:Male

Posted 28 April 2009 - 10:09 AM

you can't sorry

#5 pard1

    Etomite Forum Newbie

  • Member
  • 9 posts

Posted 29 April 2009 - 08:36 AM

Hello, i want to ask again..

my snippet not work, and view

Quote

Resource id #11 {/rs11} 2 {username}
i don't know why is happen..? i want to parse data and get record count.

this my snippet :

$etomite->rs1 = $etomite->getIntTableRows
 (
   $fields="*",
   $from="active_users",
   $where="",
   $sort="",
   $dir="",
   $limit="",
   $push=false,
   $addPrefix=true
 );
 
 $output = $etomite->parseChunk(
   "teknikku",
   array(
	 'rs11'=>$etomite->rs1
   )
 );

my chunk :

<?php global $etomite; $m = $etomite->recordCount($etomite->rs1); ?>
<table>

  {rs11}
  <tr>
	<td>{username}</td>
  </tr>
  {/rs11}
  <tr>
	  <?php echo $m;?>
  </tr>
<?// here is where the $rs2 loop ends ?>
</table>

call in my template :

[!teknikku!]


please help.. :)

#6 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,505 posts
  • Gender:Male

Posted 29 April 2009 - 12:54 PM

You are looking for $count = $etomite->recordCount($etomite->rs1); to get the record count of the query for a standard MySQL result set... You can also send the value in your parseChunk() call... But there is an easier way if you don't need an "active chunk" which requires embedded PHP...

The example code below should work... By getting and sending the $count in the parseChunk() call we can forego having to reference the $etomite object in the chunk itself... Switching $push=true allows us to send a multi-dimensional array in parseChunk() which doesn't support MySQL result set pointers in v1.1 but is planned for the v1.2 release...

rs1 = $etomite->getIntTableRows
   (
	 $fields="*",
	 $from="active_users",
	 $where="",
	 $sort="",
	 $dir="",
	 $limit="",
	 $push=true,
	 $addPrefix=true
   );
   
  $count = count(rs1);
   $output = $etomite->parseChunk(
	 "teknikku",
	 array(
	   'rs11'=>$etomite->rs1,
	   'count'=>$count
	 )
   );

<table>
	{rs11}
	<tr>
	  <td>{username}</td>
	</tr>
	{/rs11}
	<tr>
		<td>{count}</td>
	</tr>
  </table>

Part of your problem is that you were trying to mix disparate data abstraction and parseChunk concepts... See my site for tutorials on the different methods which are referred to as templating for lack of another term at the time...

#7 pard1

    Etomite Forum Newbie

  • Member
  • 9 posts

Posted 30 April 2009 - 02:34 AM

I still learn from your site ralph.. and another site tutorial about etomite. :)

i try your code, but count not same with total record in database? i have 2 record, why result count is 1..

rs1 = $etomite->getIntTableRows
	(
	  $fields="*",
	  $from="active_users",
	  $where="",
	  $sort="",
	  $dir="",
	  $limit="",
	  $push=true,
	  $addPrefix=true
	);
	
   $count = count(rs1);
	$output = $etomite->parseChunk(
	  "teknikku",
	  array(
		'rs11'=>$etomite->rs1,
		'count'=>$count
	  )
	);

<table>
	 {rs11}
	 <tr>
	   <td>{username}</td>
	 </tr>
	 {/rs11}
	 <tr>
		 <td>{count}</td>
	 </tr>
   </table>


#8 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,505 posts
  • Gender:Male

Posted 30 April 2009 - 01:23 PM

Ok... We're talking about two totally different queries here... There are several methods to get the total number of rows in a database table... Here is one of the simplest... There are other methods...

Example #1
$rs = $etomite->dbQuery("SELECT * FROM <your_table_name_here>");
 $count = $etomite->recordCount($rs);
This will return the total number of rows in the table... This is a straight query, without a WHERE clause, so it won't work for things like calculating the number of published Etomite documents - it only counts raw data, which is what you will want most of the time...

Example #2
$rs = $etomite->dbQuery("SELECT * FROM {$etomite->db}site_content WHERE `published`=1 AND `deleted`=0 AND `showinmenu`=1");
 $count = $etomite->recordCount($rs);
This query should return the total number of documents that you are serving to your visitors, as long as your menu is set to use the same WHERE clause...

Hope this helps, if you haven't already found yur solution...

#9 Ralph

    Loves Etomite Forums!

  • Admin
  • 6,505 posts
  • Gender:Male

Posted 30 April 2009 - 02:42 PM

Here is another method of finding the total number of rows when using a LIMIT clause in a query, such as when using pagination... The count is calulated before the LIMIT filter is applied... This method uses a MySQL internal constant and an internal function... By placing the SQL_CALC_FOUND_ROWS internal constant into the query we are able to grab the count of the total number of rows that fit our main query criteria... A second query which includes the FOUND_ROWS() MySQL function doesn't actually perform a query on the data itself, it only grabs the number stored in SQL_CALC_FOUND_ROWS, so this second query is completed faster... It should be noted, however, that using SQL_CALC_FOUND_ROWS can make the initial query slower depending on the rest of your query criteria... Whether inex optimization would help performance or not is debatable...

In the example below $rs will only hold a maximum of 10 rows while $count will hold the total number of rows that met the WHERE criteria... You can then use $count for your pagination link calculations...

$rs = $etomite->dbQuery("
SELECT SQL_CALC_FOUND_ROWS * 
FROM {$etomite->db}site_content 
WHERE `published`=1 
AND `deleted`=0 
AND `showinmenu`=1 
LIMIT 10
");

$rsCountSQL = $etomite->dbQuery("SELECT FOUND_ROWS()");
$rsCountRow = $etomite->fetchRow($rsCountSQL);
$rsCount = $rsCountRow['FOUND_ROWS()']; /* total number of rows that met our query criteria */


#10 pard1

    Etomite Forum Newbie

  • Member
  • 9 posts

Posted 01 May 2009 - 07:30 AM

thanks Ralph. :D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users