More wapka functions5

Link on existing site (URL tags):

If you want to create a link on existing site from your WAP create new link and write command :site-ID: instead of URL. Use site ID as ID, where you want to direct the link (Site ID is written at the bottom of every site in admin mode).
Example: If you want to make link on home page: :site-0: (Home page has always Site ID 0)
If you want to create link on previous site, instead of site ID insert character <
Example: site-<:
This way you can put link with text "back" with URL ":site-<:"
on every page (also to autocontent). If you want to create link which will switch WAP1/WAP2 version insert as site ID character w
Example: (:site-w:)

If you want to create link on existing forum or chat use tags :forum-ID: or :chat-ID:
Example::forum-1:

If you want to create link on registration site use tag instead of URL: :reg:. After registration will be user redirected on same site as registration link is. If you want to redirect user on other site use tag :reg-SiteID:. Example: :reg-0:

If you want to create link on sites for logged users settings use this tag instead of link URL:
:usr-FNC

Variable FNC can have this values:
pass
- site to change password
set
- site to change settings
profile
- site to change user profile
myprofile
- view own user profile
logout
- site to logout logged user
prcom
- site with profile comments
popup
- pop-up messages
menu
- menu site (:=:)

TIP:
You can use tag :usr-FNC: in this form: :usr-FNC-SiteID:
Example: :usr-profile-0: - user will be redirected to the homepage when he edit his profile

If you want to display site with user friends, use URL tag: :friends:
:friends-new:
- site with new friends requests
:friends-act:
- site with list of users, for whose I am friend
:friends-ref:
- site with refused users

TIP:
if you want to use URL tag in xHTML/WML code use tag :url-URLTAG:
Example:
<a href=":url-site-0:">Home Page</a> 
===============================================

Transfer values via URL and paging tags:

For transfer values via URL you can use tag :get-VARIABLE:
This tag has 3 optional options:
1. You can set default value: :get-VARIABLE(DEFAULT):. Default value will be used, if no value is transfered via URL
2. For numerical values use format: :geti-VARIABLE:
3. For values, which should be used in URL use format: :getu-VARIABLE:, this tag transform all special chars to URL correct characters. For example: Hello world -> Hello%20world
4. For allowed values use format :get-VARIABLE(DEFAULT)[ALLOWED_VALUES]:,every value is separated by ";", see Example 3 for more info.
5. If you wanna transfer values via POST method use format: :getp-VARIABLE: (Variable transfered via POST method has also format get-VARIABLE=VALUE, not post-VARIABLE=VALUE !).

Variable transfered in URL has format: get-VARIABLE=VALUE
Example 1:
In your homepage add this xHTML code:
<a href="index.xhtml?get-test=Wapka.Mobi">Display text</a>
:get-test:

This code displays link Display text and if user click this link, text Wapka.Mobi will be displayed under this link. Instead of tag :get-test: will be displayed text, which is located in URL as VALUE of get-test variable (get-TEST=WAPKA.MOBI)
Example 2:
<form method="get" action="index.xhtml">
Insert your name:
<input type="text" name="get-hello" />
<input type="submit" value="Display name" /></form>
:get-hello(no name):

This code is displaying form, where if user insert his name and confirm, this name is displayed under the form. Default value is no name if user insert blank name or when form is displayed first time.
Example 3: this code is displaying select menu with list of files from selected directory.
<form method="get" action="index.xhtml">
<select name="get-directory">
<option value="1 2">ALL</option>
<option value="1">pictures</option>
<option value="2">videos</option>
</select>
<input type="submit" value="display files" /></form>
:filelist: d=:get-directory(1 2)[1 2;1;2]: :: %lname% :: <br/> :/filelist:

As you can see, in this example was used :get: tag with ALLOWED_VALUES (:get-directory(1 2)[1 2;1;2]:), to set allowed values is very important in this case, because hacker can edit URL and change parameters of your :filelist: tag:
index.xhtml?get-directory=1,credit=100000. With this URL is generated list of files from directory ID 1 and every download is increasing 100000 credits for user! But if you use :get: tag with defined allowed values and transfered value is not found in this definition, then is used default value.

Paging tag: This tag is useful as additive for elective tags, this tag is generatig numbers with links.
Syntax:
:paging:PARAMETERS::FORMAT:/paging:
PARAMETERS has following format:
parameter1=value, parameter2=value, parameter3=value
Available parameters:
n - actual page number
m - maximum count of sites
u - form of URL (available variables: %n%,%ext% [%ext% = wml or xhtml or html])
Default FORMAT:
%first%.%prev%.%next%.%last%..%n%.%n%.%n%.%n%.%n%..%nlast%
FORMAT is not mandatory, use blank character if you wanna use this default FORMAT.
Example 1:
:paging:n=:geti-n(1):, m=10, u=index.xhtml?get-n=%n%:admin-hash-amp: :: :/paging:
This tag is generating 10 links:
1.<.>.>>..1.2.3.4.5..10
!IMPORTANT: Is very important to use tag :geti-...: in this case, because user can edit variable get-n in URL and change your code! For example user use URL index.xhtml?get-n=1,m=100 and generate 100 sites instead of 10!
Example 2
This is example of real use of electrive tag, get and paging tag.
:userstats: l=6, s=:geti-number(1): :: %name% :: <br/> :/userstats:<br/>
:paging: n=:geti-number(1):, m=10, u=site_10.%ext%?get-number=%n% :: %prev%-%n%-%n%-%n%-%next% :/paging:

The code above displays list of 6 registered users and under this list are 5 links:
John
Mark
Emma
Steve
Frank
Linda
<-1-2-3->

As s parameter of :userstats: tag is used tag :get: with variable name number and default value 1
In this case is again VERY IMPORTANT to use tag :geti-number: instead of :get-number: because hacker can replace URL from get-number=1 to get-number=1,d=fa or add other parameters and change your elective tag. Tag :geti-...: displays value 0 if detect string instead of integer value

TIP: parameter m can be calculated automatically if you use elective tag first (:userstats: or :filelist:) and then :paging: tag without m parameter. In this case is possible to use variable %tnlast% in paging FORMAT, this variable displays text of the last page (hidden m parameter).

12 comments:

  1. I want Site URL With Name Ex-/site_dj_mp3.xHTML instead of site_1.xHTML .. How done it???

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. 1. go to the page you would like to name dj_mp3 then scrolldown to ::EDIT SITE (#) :: >>under settings click 'change title' >> in the first box type the TITLE for that page next box type dj_mp3 then click edit site

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Pls i want to code 2go arena generator via wapka using wapka variable pls help how can i do dat,email me on WISDOMNWOKOLO1@GMAIL.COM

    ReplyDelete
  6. What is wapka site id ???????????

    ReplyDelete
  7. What is wapka site id ???????????

    ReplyDelete
  8. How to add wapka page url in variables example :url-site-876: after its not working and url like this cinemavilla/:url-site-876: do you how to solve this issue?

    ReplyDelete
  9. Report Traffic situation, Weather & Emergency around youEnter your comment...

    ReplyDelete