PEAK XOOPS - how to implement gticket2 in englishin japanese

how to implement gticket2

  • You cannot open a new topic into this forum
  • Guests cannot post into this forum
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/4 3:53
krobi  ¾åÅùʼ From: Austria  Posts: 38
hey gijoe,

could you explain me how i can make a gticket2 and how i can check this in an php.

for example - when i have xoopsform, or html code and so on.

would be really nice.
Votes:2 Average:10.00
Previous post - Next post | Parent - Children.1 .2 | Posted on 2006/5/4 6:00
GIJOE  ÀèǤ·³Áâ   Posts: 4110
hi krobi.

It is not so easy to explain how to use a library

gticket2 is almost the same as gticket.

- include_once it
- add hidden into your form
- add check() into your transaction


form side with XoopsForm:
	$form = new XoopsThemeForm( ... );
	$GLOBALS['xoopsGTicket']->addTicketXoopsFormElement( $form , __LINE__ , 1800 , '(your area name)' ) ;

form side with plain HTML:
	$xoopsGTicket->getTicketHtml( __LINE__ , 1800 , '(your area name)' )


transaction side:
	if ( ! $xoopsGTicket->check( true , '(your area name)' ) ) {
		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
	}
If an error occurs in cheking the ticket, "repost form" is displayed automatically.

If you don't want to display "repost form", call check() like this.
	if ( ! $xoopsGTicket->check( true , '(your area name)' , false ) ) {
		redirect_header(XOOPS_URL.'/',3,$xoopsGTicket->getErrors());
	}

Votes:0 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/4 9:11
krobi  ¾åÅùʼ From: Austria  Posts: 38
thank you very much for explaining.

its a great help.

your gticket works with every xoops version or do a xoops user need a specific xoops version? or does i have to look at anything when i use the gticket? (like xoops version compatibility or so on)
Votes:1 Average:0.00
Previous post - Next post | Parent - No child | Posted on 2006/5/6 3:09
GIJOE  ÀèǤ·³Áâ   Posts: 4110
Quote:
krobi wrote:
your gticket works with every xoops version or do a xoops user need a specific xoops version? or does i have to look at anything when i use the gticket? (like xoops version compatibility or so on)

As gticket2 is just a ticket/token class, you -developper- can use it in your module with any version of XOOPS.

And I shall support any XOOPS from xoops.org, xoopscube.jp etc.

Votes:0 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/13 7:37
krobi  ¾åÅùʼ From: Austria  Posts: 38
hey gijoe,

i'am wondering what this "'(your area name)'" exaclty do and mean.

in my opinion i tell the ticket that he has a special name and the check should have the same name, but for what? what is sense of that exaclty?

i have tried it with and without the "'(your area name)'" and it works always.

and i have a second question, how can a add a gticket2 to a xoops_confirm?
Votes:0 Average:0.00
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/14 4:28
GIJOE  ÀèǤ·³Áâ   Posts: 4110
hi krobi.

Quote:
i'am wondering what this "'(your area name)'" exaclty do and mean.
"area" means purpose of the ticket.

eg)
Even if you buy the ticket for japan-brasil in the heat, you cannot watch the final germany-brasil

Quote:
i have tried it with and without the "'(your area name)'" and it works always.
"gticket" checks loosely like this.

deep referer ok && area ok -> ok
deep referer ok && area ng -> ok
deep referer ng && area ok -> ok
deep referer ng && area ng -> ng

Because "deep referer" and "area" have almost the same effect.

If you issue a ticket with the area of "myblocksadmin" and you check the area is "mytplsadmin", "area" will be NG.

But if you send right referer, the total result of the check will be OK.

Quote:
and i have a second question, how can a add a gticket2 to a xoops_confirm?
I don't think it is necessary to add gticket2 into xoops_confirm.
In the latest version of xoops, "xoops_confirm" has a ticket from XOOPS core.

The advantages of using gticket2 in your module:
(1) independence of core versions (XOOPS 2.0/2.2, XOOPS Cube, Oreteki, MOX etc)
(2) auto repost form

If your module have textarea for long text, (2) will be the big advantage

Votes:2 Average:5.00
Previous post - Next post | Parent - Children.1 | Posted on 2006/5/18 6:45
krobi  ¾åÅùʼ From: Austria  Posts: 38
hey gijoe,

i have successfully added your ticket to a xoops_confirm.

its good when you have a confirm message, for deleting entries for example, here is what i have done:

you have to add a function to you gtickets.php
Quote:
// get only the form value back for example its good for using it in a xoops_confirm -> Done by PD Coding Team
function getTicketHTMLValue ( $salt = '' , $timeout = 1800 , $area = '' )
{
return $this->issue( $salt , $timeout , $area ) ;
}

then you can make a xoops_confirm message like this:

Quote:
xoops_confirm(array('XOOPS_G_TICKET' => $xoopsGTicket->getTicketHTMLValue(__LINE__ , 1800 , '(your area name)')), 'index.php', _AM_PDD_FILE_REALLYDELETEDTHIS . "message", _DELETE, false);
Votes:12 Average:5.00
Previous post - Next post | Parent - No child | Posted on 2006/5/19 18:16
GIJOE  ÀèǤ·³Áâ   Posts: 4110
hi krobi.

You can find existet codes in myblocksadmin.php etc.

		xoops_confirm( array( 'op' => 'delete_ok' ) + $GLOBALS['xoopsGTicket']->getTicketArray( __LINE__ , 1800 , 'myblocksadmin' ) , (action) , (message) ) ;

Operator '+' is useful for array in this situation.
Votes:12 Average:5.00

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!