| type-int-0.4: Type Level 2s- and 16s- Complement Integers | Contents | Index |
|
| Data.Type.Hex.Stage3 | | Portability | non-portable (MPTC, FD, TH, undecidable instances, missing constructors) | | Stability | experimental | | Maintainer | Edward Kmett<EMAIL_ADDRESS>|
|
|
|
| Description |
| Stage3: Define everything else. The juicier bits are then exposed via Data.Type.Hex
|
|
| Synopsis |
|
|
|
| Documentation |
|
| tSucc :: TSucc n m => n -> m |
|
| tPred :: TSucc n m => m -> n |
|
| class TNeg a b | a -> b, b -> a |
| | Instances | |
|
|
| tNeg :: TNeg a b => a -> b |
|
| class TIsPositive n b | n -> b |
| | Instances | |
|
|
| tIsPositive :: TIsPositive n b => n -> b |
|
| class TIsNegative n b | n -> b |
| | Instances | |
|
|
| tIsNegative :: TIsNegative n b => n -> b |
|
| class TIsZero n b | n -> b |
| | Instances | |
|
|
| tIsZero :: TIsZero n b => n -> b |
|
| tAddC' :: TAddC' a b c d => a -> b -> c -> d |
|
| tAddF' :: TAddC' a b F d => a -> b -> d |
|
| class TNF a b | a -> b |
| | Instances | |
|
|
| tNF :: TNF a b => a -> b |
|
| class TAdd' a b c | a b -> c |
| | Instances | |
|
|
| tAdd' :: TAdd' a b c => a -> b -> c |
|
| class TSub' a b c | a b -> c |
| | Instances | |
|
|
| tSub' :: TSub' a b c => a -> b -> c |
|
| class TAdd a b c | a b -> c, a c -> b, b c -> a |
| | Instances | |
|
|
| tAdd :: TAdd a b c => a -> b -> c |
|
| tSub :: TAdd a b c => c -> a -> b |
|
| hexT :: Integral a => a -> TypeQ |
| $(hexT n) returns the appropriate THex instance
|
|
| hexE :: Integral a => a -> ExpQ |
| $(hexE n) returns an undefined value of the appropriate THex instance
|
|
| class TMul a b c | a b -> c |
| A simple peasant multiplier. TODO: exploit 2s complement and reverse the worst cases
| | | Instances | | TMul a F F | | TNeg a b => TMul a T b | | TMul (D0 a1) b c => TMul a1 (D0 b) c | | (TMul (D0 a1) b c, TAdd' a1 c d) => TMul a1 (D1 b) d | | (TMul (D0 a1) b c, SHR1 H0 a1 a2, TAdd' a2 c d) => TMul a1 (D2 b) d | | (TMul (D0 a1) b c, SHR1 H0 a1 a2, TAdd' a1 a2 a3, TAdd' a3 c d) => TMul a1 (D3 b) d | | (TMul (D0 a1) b c, SHR1 H0 a1 a2, SHR1 H0 a2 a4, TAdd' a4 c d) => TMul a1 (D4 b) d | | (TMul (D0 a1) b c, SHR1 H0 a1 a2, SHR1 H0 a2 a4, TAdd' a1 a4 a5, TAdd' a5 c d) => TMul a1 (D5 b) d | | (TMul (D0 a1) b c, SHR1 H0 a1 a2, SHR1 H0 a2 a4, TAdd' a2 a4 a6, TAdd' a6 c d) => TMul a1 (D6 b) d | | (TMul (D0 a1) b c, SHR1 H0 a1 a2, SHR1 H0 a2 a4, TAdd' a2 a4 a6, TAdd' a1 a6 a7, TAdd' a7 c d) => TMul a1 (D7 b) d | | (TMul (D0 a1) b c, SHR1 H0 a1 a2, SHR1 H0 a2 a4, SHR1 H0 a4 a8, TAdd' a8 c d) => TMul a1 (D8 b) d | | (TMul (D0 a1) b c, SHR1 H0 a1 a2, SHR1 H0 a2 a4, SHR1 H0 a4 a8, TAdd' a1 a8 a9, TAdd' a9 c d) => TMul a1 (D9 b) d | | (TMul (D0 a1) b c, SHR1 H0 a1 a2, SHR1 H0 a2 a4, SHR1 H0 a4 a8, TAdd' a2 a8 aA, TAdd' aA c d) => TMul a1 (DA b) d | | (TMul (D0 a1) b c, SHR1 H0 a1 a2, SHR1 H0 a2 a4, SHR1 H0 a4 a8, TAdd' a2 a8 a0, TAdd' a1 a0 aB, TAdd' aB c d) => TMul a1 (DB b) d | | (TMul (D0 a1) b c, SHR1 H0 a1 a2, SHR1 H0 a2 a4, SHR1 H0 a4 a8, TAdd' a4 a8 aC, TAdd' aC c d) => TMul a1 (DC b) d | | (TMul (D0 a1) b c, SHR1 H0 a1 a2, SHR1 H0 a2 a4, SHR1 H0 a4 a8, TAdd' a4 a8 aC, TAdd' a1 aC aD, TAdd' aD c d) => TMul a1 (DD b) d | | (TMul (D0 a1) b c, SHR1 H0 a1 a2, SHR1 H0 a2 a4, SHR1 H0 a4 a8, TAdd' a4 a8 aC, TAdd' a2 aC aE, TAdd' aE c d) => TMul a1 (DE b) d | | (TMul (D0 a1) b c, SHR1 H0 a1 a2, SHR1 H0 a2 a4, SHR1 H0 a4 a8, TAdd' a4 a8 aC, TAdd' a2 aC aE, TAdd' a1 aE aF, TAdd' aF c d) => TMul a1 (DF b) d |
|
|
|
| tMul :: TMul a b c => a -> b -> c |
|
| class THex2Binary' a b | a -> b, b -> a |
| | Instances | |
|
|
| class THex2Binary a b | a -> b |
| | Instances | |
|
|
| tHex2Binary :: THex2Binary a b => a -> b |
|
| class TBinary2Hex a b | a -> b |
| | Instances | |
|
|
| tBinary2Hex :: TBinary2Hex a b => a -> b |
|
| class THexBinary a b | a -> b, b -> a |
| | Instances | |
|
|
| class TPow' a b c | a b -> c |
| peasant exponentiator with explicit binary exponent
| | | Instances | |
|
|
| class TPow a b c | a b -> c |
| peasant exponentiator
| | | Instances | |
|
|
| tPow :: TPow a b c => a -> b -> c |
|
| Produced by Haddock version 0.8 |


--- layout: post title: 'The AltNetBeers #8 is postponed until the second week of May' date: '2009-04-23T19:41:00.001+01:00' tags: [altnetbeers] modified_time: '2009-04-23T19:41:47.367+01:00' blogger_id: tag:blogger.com,1999:blog-4015568221071268916.post-4279503496752602315 comments: true blogger_orig_url: http://serialseb.blogspot.com/2009/04/altnetbeers-8-is-postponed-until-second.html ---
Because of the progressive.net workshops happening and the June event happing earlier in the month (and me not preparing early enough), I’m postponing the April edition to the second week of May.
Will announce the details as soon as I get all the dates secured.


Pizzeria.php
No description.
package |
|---|
1: <?php 2: 3: declare(strict_types=1); 4: 5: namespace Marios; 6: 7: /** 8: * Entrypoint for this pizza ordering application. 9: * 10: * This class provides an interface through which you can order pizza's and pasta's from Mario's Pizzeria. 11: * 12: * We have: 13: * - American pizzas 14: * - And real (italian) pizzas 15: * 16: * @link https://wwww.phpdoc.org 17: * @link https://docs.phpdoc.org docs 18: * 19: * @since 3.0 20: * @since 3.1 Does extra stuff 21: */ 22: final class Pizzeria implements \JsonSerializable 23: { 24: public function order(Pizza ...$pizzas): bool 25: { 26: return true; 27: } 28: 29: /** 30: * Places an order for a pizza. 31: * 32: * This is an example of a protected function with the static modifier whose parameters' type and return type is 33: * determined by the DocBlock and no type hints are given in the method signature. 34: * 35: * @param Pizza $pizza The specific pizza to place an order for. 36: * 37: * @return bool Whether the order succeeded 38: */ 39: protected static function doOrder($pizza) 40: { 41: return true; 42: } 43: 44: /** 45: * @deprecated This ordering method should no longer be used; it will always fail. 46: * 47: * @return false Demonstrate that 'false' is a valid return type in an DocBlock to indicate it won't just return any 48: * boolean; it will _always_ be false. 49: */ 50: private final function doOldOrder(): bool 51: { 52: return false; 53: } 54: 55: /** 56: * @inheritDoc 57: */ 58: public function jsonSerialize(): array 59: { 60: return []; 61: } 62: } 63:


|
libcoap
4.1.2
|
#include "coap_config.h"
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "mem.h"
#include "debug.h"
#include "pdu.h"
#include "option.h"
#include "uri.h"
Go to the source code of this file.
Data Structures | |
| struct | cnt_str |
Macros | |
| #define | ISEQUAL_CI(a, b) ((a) == (b) || (islower(b) && ((a) == ((b) - 0x20)))) |
| #define | hexchar_to_dec(c) |
Calculates decimal value from hexadecimal ASCII character given in c . More... | |
| #define | min(a, b) ((a) < (b) ? (a) : (b)) |
| #define | URI_DATA(uriobj) ((unsigned char *)(uriobj) + sizeof(coap_uri_t)) |
Typedefs | |
| typedef void(* | segment_handler_t) (unsigned char *, size_t, void *) |
Functions | |
| static unsigned char * | strnchr (unsigned char *s, size_t len, unsigned char c) |
| A length-safe version of strchr(). More... | |
| int | coap_split_uri (const unsigned char *str_var, size_t len, coap_uri_t *uri) |
| Parses a given string into URI components. More... | |
| static void | decode_segment (const unsigned char *seg, size_t length, unsigned char *buf) |
Decodes percent-encoded characters while copying the string seg of size length to buf . More... | |
| static int | check_segment (const unsigned char *s, size_t length) |
| Runs through the given path (or query) segment and checks if percent-encodings are correct. More... | |
| static int | make_decoded_option (const unsigned char *s, size_t length, unsigned char *buf, size_t buflen) |
Writes a coap option from given string s to buf . More... | |
| static int | dots (unsigned char *s, size_t len) |
Checks if path segment s consists of one or two dots. More... | |
| static size_t | coap_split_path_impl (const unsigned char *s, size_t length, segment_handler_t h, void *data) |
| Splits the given string into segments. More... | |
| static void | write_option (unsigned char *s, size_t len, void *data) |
| int | coap_split_path (const unsigned char *s, size_t length, unsigned char *buf, size_t *buflen) |
| Splits the given URI path into segments. More... | |
| int | coap_split_query (const unsigned char *s, size_t length, unsigned char *buf, size_t *buflen) |
| Splits the given URI query into segments. More... | |
| coap_uri_t * | coap_new_uri (const unsigned char *uri, unsigned int length) |
| Creates a new coap_uri_t object from the specified URI. More... | |
| coap_uri_t * | coap_clone_uri (const coap_uri_t *uri) |
| Clones the specified coap_uri_t object. More... | |
| static void | hash_segment (unsigned char *s, size_t len, void *data) |
| int | coap_hash_path (const unsigned char *path, size_t len, coap_key_t key) |
Calculates a hash over the given path and stores the result in key . More... | |
| #define hexchar_to_dec | ( | c | ) |
| #define ISEQUAL_CI | ( | a, | |
| b | |||
| ) | ((a) == (b) || (islower(b) && ((a) == ((b) - 0x20)))) |
| #define URI_DATA | ( | uriobj | ) | ((unsigned char *)(uriobj) + sizeof(coap_uri_t)) |
| typedef void(* segment_handler_t) (unsigned char *, size_t, void *) |
|
static |
| coap_uri_t* coap_clone_uri | ( | const coap_uri_t * | uri | ) |
Clones the specified coap_uri_t object.
Thie function allocates sufficient memory to hold the coap_uri_t structure and its contents. The object must be released with coap_free().
Definition at line 433 of file uri.c.
| int coap_hash_path | ( | const unsigned char * | path, |
| size_t | len, | ||
| coap_key_t | key | ||
| ) |
Calculates a hash over the given path and stores the result in key
.
This function returns 0
on error or 1
on success.
| path | The URI path to generate hash for. |
| len | The length of path . |
| key | The output buffer. |
1
if key
was set, 0
otherwise. Definition at line 483 of file uri.c.
| coap_uri_t* coap_new_uri | ( | const unsigned char * | uri, |
| unsigned int | length | ||
| ) |
Creates a new coap_uri_t object from the specified URI.
Returns the new object or NULL on error. The memory allocated by the new coap_uri_t must be released using coap_free().
| uri | The URI path to copy. |
| length | The length of uri. |
Definition at line 414 of file uri.c.
|
static |
Splits the given string into segments.
You should call one of the macros coap_split_path() or coap_split_query() instead.
| s | The URI string to be tokenized. |
| length | The length of s . |
| h | A handler that is called with every token. |
| data | Opaque data that is passed to h when called. |
s
. Definition at line 328 of file uri.c.
|
static |
Decodes percent-encoded characters while copying the string seg
of size length
to buf
.
The caller of this function must ensure that the percent-encodings are correct (i.e. the character '' is always followed by two hex digits. and that buf
provides sufficient space to hold the result. This function is supposed to be called by make_decoded_option() only.
| seg | The segment to decode and copy. |
| length | Length of seg . |
| buf | The result buffer. |
Definition at line 205 of file uri.c.
|
inlinestatic |
|
inlinestatic |
|
static |
Writes a coap option from given string s
to buf
.
s
should point to a (percent-encoded) path or query segment of a coap_uri_t object. The created option will have type 0
, and the length parameter will be set according to the size of the decoded string. On success, this function returns the option's size, or a value less than zero on error. This function must be called from coap_split_path_impl() only.
| s | The string to decode. |
| length | The size of the percent-encoded string s . |
| buf | The buffer to store the new coap option. |
| buflen | The maximum size of buf . |
-1
on error.Definition at line 266 of file uri.c.
|
inlinestatic |
A length-safe version of strchr().
This function returns a pointer to the first occurrence of c
in s
, or NULL
if not found.
| s | The string to search for c . |
| len | The length of s . |
| c | The character to search. |
c
, or NULL
if not found. Definition at line 37 of file uri.c.


As happy a man as any in the world, for the whole world seems to smile upon me!
Short Personal Summary
Birth Place: Honolulu, Hawaii
Siblings: One younger sister
Favorite Food: Pineapples
Primary Bucket List Goad: Visit the top fifty art museums in the world by the number of visitors: Currently 22 of 50 visited. Wikipedia List
Interests and Hobbies
Cooking: From Coq au Vin to fish stews
Reading: Mainly historical monographs i.e Barbara Tuchmans "A Distant Mirror"
Statement on Personal Aspirations
As with anything in life I find the sheer act of spontaneity is the key to keeping things interesting. While most people have usually a underlying common theme in their interests usually being either exposure through friends and family or their enviroment I find that interests having a eclectic nature is something onto its self. Thus in pursuing programming as a goal onto its self to me is a manifestation of pursuing my other interests simulatenously and made manifest.
Education
High School: Kaimuki High School Honolulu, Hawaii
University: University of Washington Seattle, Washington
Currently: Epicodus Portland, Oregon
Previous Work Experiences
Bon Marche Department Store: Bellevue, Washington
Federated/Macy's Department Store: Bellevue, Washington
Imagine Crafts: Redmond, Washington
Protection Technologies: Bellevue, Washington
Hawaiian Quilt Collection: Honolulu, Hawaii
"It is difficult to free fools from the chains they revere" The very words of wisdom I try to live by.


The Dialog facets
are non-visual components that provide an ability to pre-configure standard dialogs
windows in XML descriptor. Dialogs can be pre-configure via corresponding facets:
MessageDialogFacet
- corresponds to Dialogs#createMessageDialog
;OptionDialogFacet
- corresponds to Dialogs#createOptionDialog
;InputDialogFacet
- corresponds to Dialogs#createInputDialog
.Dialogs can be shown explicitly via corresponding method: show()
or subscribed to any action or button
by id:
onButton
- specifies the button id that triggers a dialog;onAction
- specifies the action id that triggers a dialog.


Model Portia Freeman Shares Her Little Black Book Of London
by Felicity CarterLondon based model, mum, girl crush and gal-about-town Portia Freeman has modelled for all the big hitters from Dolce & Gabbana, Emilia Wickstead, Fendi, and Mary Katrantzou to Céline, Marc Jacobs, Chanel, Louis Vuitton and Alexander McQueen. That’s an impressive list right here. She always finds her way back to London though, and she’s shared her little black book of the very best spots in town from the coziest pub in Highgate to the Larry King salon (cue awesome hair) in Kensington.
Shop: John Lewis
With so many amazing places to shop in Central London, I naturally gravitate towards John Lewis in Brent Cross for my more day to day essentials. This being because it’s not too far from where I live and sometimes (a lot of the time) I like to avoid the hustle and bustle of Central London. John Lewis to me has everything under one roof.
Address: John Lewis, Brent Cross Shopping Centre, Prince Charles Drive, NW4 3FL, www.johnlewis.com
Play: Trent Park Equestrian Centre
Recently I’ve rediscovered my love for horses. As a kid, I used to ride on the weekends and finding this gem so close to where I live has been amazing. It’s such a mind-clearing hobby which is perfect when you live in a city. The surroundings are lush and filled with plenty of space to go on satisfying hacks and the stables itself is great for any level rider. A wonderful selection of friendly horses this really is one of my fave places to ‘play’.
Trent Park Equestrian Centre, East Pole Farmhouse, Bramley Road, London, N14 4UW, www.trentpark.com
Stay: The Ned
I absolutely adore this hotel! I’ve stayed a number of times and each stay has been a totally different vibe. Whether it’s a romantic staycation or celebrating a big birthday this hotel really does cater for all. The variety of restaurants and bars - personal fave Cecconi's offering Northern Italian dishes, great if you’re a pasta lover like me or head there for the Sunday feast in the main hall, think Henry VIII style banquet, food and drink overflowing so it's the perfect excuse to check-in for the night. And not forgetting the rooftop overlooking the city whilst listening to great tunes and sipping on the best Frosé in London.
Address: The Ned, 27 Poultry, London, EC2R 8AJ, www.thened.com
Bar: Scarfes Bar
Scarfes Bar is where I head to if I decide to make a pitstop for a cheeky cocktail or two on my way home from dinner. Located in the oh so beautiful Rosewood Hotel, Holborn, this bar really is a great way to escape the loud noise of London's nightlife. The vibe is opulent, sexy with candlelight glimmering onto rich velvets and the dreamiest dark parquet floor. It’s a great spot that offers live music and gimmicky artwork of the Royal Family. Fave spot to sit - at the bar! It’s a great way to see the mixologists work their magic.
Address: Rosewood London, 252 High Holborn, Holborn, London WC1V 7EN, www.scarfesbar.com
Eat: Max’s Sandwich Shop
Yes, people, I said sandwich shop and you haven’t lived if you’ve not been to Max’s Sandwich Shop.  The vibe is low key, cozy and has the most amazing energy. With queues that wrap around the block, be sure to get here early! Oh, and did I mention that Max is an absolute legend! You’ll hear him bellowing hello before you’ve even reached the door!
Address: 19 Crouch Hill, Stroud Green, London N4 4AP, www.maxssandwichshop.com
Music: The Royal Albert Hall
For me The Royal Albert Hall really does have to be the best place in London to watch live performances. They host such a wide range of performances so it really does fit for all. The most recent gig we went to was to watch Star Wars whilst the orchestra played live and it certainly didn’t fail. Whether you’re going out and fancy dressing up for an evening treat or it's a casual day time affair, The Royal Albert Hall is always a hit in my opinion.
Address: Kensington Gore, South Kensington, London SW7 2AP, www.theroyalalberthall.com
Chill out: The Red Lion and Sun
Ok, so yes this is a pub and yes there have been evenings where we’ve headed home a little later than we had first anticipated (they have the best wine selection) but this gorgeous North London local of ours will always be a solid go-to for our Sunday chill.
It’s my favorite place to head for a Sunday roast and now we're rolling into the cozy winter months, the fire is always lit, papers/magazines at the ready, this place really does have the chill factor.
Address: 25 North Road, Highgate, London N6 4BE, www.theredlionandsun.com
Hair/beauty: Larry King Hair
The one and only place I’ll go to get my hair pimped and pruned is at Larry King's Salon, South Kensington.
Home to amazing colorists and stylists, you know you’re in safe hands. For the best blonde in town ask for Harriet Muldoon, she’s a boss babe!
Address: 34-36 Harrington Road, South Kensington London SW7 3ND, www.larryking.co.uk
Culture: Saatchi Gallery
Finding myself here a fair bit from time to time, the Kings Road having its own pockets of history and legendary tales from the years gone by I always find time to pop into the Saatchi Gallery.
It's the perfect place to see some fabulous and iconic artwork and perhaps check out the current exhibitions which can vary from futuristic VR to the present Tutankhamun it’s fun for all.
Address: Duke of York’s HQ, Kings Road, Chelsea, London SW3 4RY, www.saatchigallery.com
Landmark/building: Fitzrovia Chapel
There are so many amazing landmarks or buildings to choose from living in London but there’s nothing more than I love than stumbling upon hidden treasures and the Fitzrovia Chapel is exactly that. With its gold mosaic domes and calming energy, it’s such a great place to visit whether it’s to check out an exhibition or slip into a little meditation on one of their open days.
Address: 2 Pearson Square, Fitzrovia, London W1T 3BF, www.fitzroviachapel.org
Book/magazine store: Hatchards
Hatchards makes you feel like you’ve stepped into another era. With all of the history under one roof, not to mention that it's the oldest book store in the UK, the fact this is on my doorstep I definitely try to not take this for granted. You’ll find me here when I’ve got an hour to kill popping from meeting to meeting to escape central London’s hustle and bustle.
187 Picadilly, St James’s, London W1J 9LE, www.hatchards.co.uk
Fave Place: Hampstead Heath/Kenwood House
When I'm not doing all of the above you’ll find me walking my dog here. I love the healing energy Hampstead Heath holds. Great for a brisk power walk or a long lazy picnic in the summer months, this little slice of heaven in the city is the perfect place to clear the cobwebs away.
Address: Hampstead Lane, Highagte, London NW3 7JR


This was my first project collaborating with other beginner developers. We wanted to create an app that suggests cocktails based on the weather or a mood. enjoy!!
Employment Buddy is an application that lets you keep track of where you have applied to by dynamically screating and saving where you are in the hiring process. This is done by letting users create an account and saving that information in a database.

A time code quiz that gets your score and saves it to your local storage as a high score.


This samples demonstrate some of the feature of wicket-contrib-push
Since the communication mechanisms demonstrated int his examples showcase server initiated communication, it is recommended to open the same example in two browser windows, and see the interactions between them.
Click a link to view an example page.


The TGP page templates are the templates that control the appearance of the pages that TGPX generates which contain the links to your galleries and that your surfers will be viewing. This document will give you an overview of the custom functions and variables available in each of the directory templates.
Editing TGP Page Templates
To edit the TGP page templates access the TGP Pages > Edit Templates function from the control panel menu. This will display a page where you will be able to view and modify your TGP page templates. When you first access the TGP page template editing interface you will see a list of your defined TGP pages. You will need to select one of those pages and then click on the icon to load that template for editing. When you click on the icon the page will reload and you will now see the HTML and template code for this TGP page in a large text input box. There will also be a number of icons displayed across the top of the page, each of which is described below.
| Click on this icon to load the template for a page. When you click on this icon a selection box will appear that will allow you to choose which template you want to edit. Once you have selected the template you want to edit, click the to load that template. | |
| Click on this icon to refresh the currently loaded template. This is useful if you have used the search-and-replace function and need to update the template code with the new code that has been generated by the search-and-replace. | |
| Click on this icon to save the currently loaded template. You will be asked to confirm if you want to save your changes before they are actually saved. | |
| Click on this icon to save the currently loaded template and build the associated TGP page. You will be asked to confirm if you want to save your changes before they are actually saved and the page is built. This will run the standard Build function only on the currently loaded page. | |
| Click on this icon to save the currently loaded template with additional options. This function will allow you to save the template for more than one page and also optionally build the saved pages. When you click this icon, a selection box will appear that will allow you to select the pages that you want to save this template for. In the selection list you can hold down the ctrl key on your keyboard while you click each page name to select multiple pages at once. You can also check the 'Build these pages after save' box to have the selected pages built after the template has been saved. Once you have selected the pages to save this template for, click on the icon. | |
| Click on this icon to access the Search and Replace interface. |
TGPX allows you to make quick changes to your templates in bulk with the Search and Replace function. When you access the Search and Replace function a popup window will appear that will allow you to select the pages that you want to perform this action on, the code to search for in the template, and the replacement code to use. Multiple pages can be selected by holding down the shift or ctrl keys on your keyboard as you click on pages in the selection list. Once you have selected the pages and entered the search and replacement code, press the Search and Replace button to start the task. Once completed a message will appear at the top of the window letting you know how many replacements were made.
Custom Functions
In addition to the standard template functions, the directory templates have several custom functions available which allow you to display your categories and galleries. Each of those custom functions are described here.
-
{phpcode}
This function is different from the {php} function because it will output the PHP code to the actual TGP page so that the PHP code gets executed every
time someone views your TGP page. The code within a {php} function will be executed only when the page is being built and becomes a static part of the
generated TGP page.
{define}
-
name
globaldupes or pagedupes. This it the name of the value to set.
value
true or false. The value to assign to the named variable
The {define} template function should appear at the top of your template so that the values are defined before any {galleries} functions. Once you have set these values, it is no longer necessary to set them in the {galleries} function, although you can do that if you want to override the {define} setting.
{storeglobal}
-
name (required)
The name to use for the stored global value. This name will be used later with the {getglobal} template function to retrieve the data.
value (required)
The value to assign to the stored global value. This can be a template variable or a text string.
Any data that you store using this template function will only be available on TGP pages that are built after the page on which this function appears.
{getglobal}
-
name (required)
The name of the stored global value from which to retrieve the data. This must match the name attribute from a previous {storeglobal} template function.
var (required)
The template variable to which the data will be assigned.
galleries(optional, defaults to false)
true or false. If the data you are loading is stored galleries, set this value to true so that the software can mark them as being used on the page. For any other data, set this to false.
Any data that you store using this template function will only be available on TGP pages that are built after the page on which this function appears.
{ad}
-
order (optional, defaults to times_displayed, (unique_clicks/times_displayed) DESC)
The order in which advertisements will be pulled from the database. The following order options are available:
| times_displayed | The number of times the advertisements has been displayed |
| raw_clicks | The number of raw clicks the advertisement has received |
| unique_clicks | The number of unique clicks the advertisement has received |
| weight | The weight value assigned to the advertisement |
|
All of these values can be modified with DESC to sort in descending order instead of ascending order. Additionally, these values may be combined together to generate sub-sorting options. Here are a few examples: |
|
| raw_clicks DESC | Sort by the number of raw clicks on the advertisement, from most to least |
| weight DESC | Sort by the weight assigned to the advertisement, from largest to smallest |
| (unique_clicks/times_displayed) DESC | A productivity value taking into account the number of times the advertisement has been displayed and the number of unique clicks it has received. Ordered from most productive to least productive. |
weight (optional, defaults to any)
Use this option to specify what advertisement weights can be pulled for display. You can use any type of comparison operator here, followed by the weight value that you want to restrict. See the weight attribute of the {galleries} template function documentation for examples.
tags (optional)
Use this option to specify a boolean mode search term in the tags assigned to your advertisements. See the keywords attribute of the {galleries} template function documentation for examples.
globaldupes (optional, defaults false)
true or false. Use this option to specify whether or not advertisements which have already been displayed on other pages can be pulled for display again on this page. If you set this to true, repeats will be allowed. Setting this to false means that no repeats will be allowed.
pagedupes (optional, defaults false)
Use this option to specify whether or not advertisements which have already been displayed on this page can be pulled for display again on this page. If you set this to true, repeats will be allowed. Setting this to false means that no repeats will be allowed.
category (optional, defaults to MIXED)
Use this option to restrict which categories can be pulled from the database. If you want any category to be allowed, used the keyword MIXED. If you want a specific category to be pulled, list the category name exactly as it appears in the Manage Categories interface. You may also use a list of several categories by separating each category by a comma. See the category attribute of the {galleries} template function documentation for examples and more info.
MIXED has a special meaning on pages that have been assigned to a specific category. On those pages, only advertisements from the category to which the
page is assigned will be displayed. The software will automatically convert MIXED to the appropriate category!
{searches}
-
var (required)
The name of the template variable that the search data will be loaded into
amount (optional, defaults to all)
Specify a numerical value to limit the number of search terms that are pulled, or enter the text string all to have all search terms pulled
order (optional, defaults to searches DESC)
The order in which the searches will be displayed. The following order options are available:
| term | Sort alphabetically by the search term itself |
| searches | Sort numerically by the number of searches that have been executed for each term |
| date_last_search | Sort by the date that this term was most recently searched for |
|
All of these values can be modified with DESC to sort in descending order instead of ascending order. Additionally, these values may be combined together to generate sub-sorting options. Here are a few examples: |
|
| searches DESC | Sort by the number of searches that have been executed, from most to least |
| date_last_search DESC | Sort by the date that this term was most recently searched for, from newest to oldest |
| searches DESC, date_last_search DESC | Sort by the number of searches that have been executed, from most to least. If two search terms have the same number of searches, they will be sub-sorted by the date that this term was most recently searched for, from newest to oldest |
alphabetize (optional, defaults to false)
true or false. If this is set to true, the search terms will be alphabetized after having the order sorting option applied. If set to false, no alphabetizing will be applied. This is useful, for example, if you want to pull the to 50 most searched terms but display them alphabetized rather than in order of how many searches have been performed for each.
{pages}
-
var (required)
The name of the template variable that the page data will be loaded into
category (optional)
The category name or ID number of the category that you want to load pages for. If you leave this option out, all pages will be loaded. If you set this to 0, the pages assigned to display MIXED galleries will be loaded.
tags (optional)
Use this option to specify a boolean mode search term in the tags assigned to pages. Here are some examples:
-
tags=main
Pull pages that have the word main in their tag list
tags=movies videos
Pull pages that have either the word movies or videos in their tag list
tags=+movies +main
Pull pages that have both the word movies and main in their tag list
tags=movies -main
Pull pages that have the word movies but not the word main in their tag list
urlcontains (optional)
Use this option to specify a string that must appear in the page URL in order for it to be pulled. Here are some examples:
-
urlcontains=movies
Pull pages that have the string movies in the page URL
urlcontains=.shtml
Pull pages that have the string .shtml in the page URL (useful for pulling pages with a specific file extension)
amount (optional)
Specify a numerical value to limit the number of pages that are pulled.
{categories}
-
var (required)
The name of the template variable that the categories will be loaded into
order (optional, defaults to name)
The order in which the categories will be displayed. The following order options are available:
| name | Sort alphabetically by the category name |
| galleries |
Sort by the total number used and approved galleries in this category |
| used |
Sort by the total number used galleries in this category |
| clicks |
Sort by the total number of clicks that the used galleries in this category have received |
| build_counter |
Sort by total number of builds that the used galleries in this category have gone through |
| RAND() | Sort randomly |
|
All of these values can be modified with DESC to sort in descending order instead of ascending order. Additionally, these values may be combined together to generate sub-sorting options. Here are a few examples: |
|
| galleries DESC | Sort by number of used and approve galleries, from most to least |
| clicks DESC | Sort by the total number of clicks that the used galleries in this category have received, from most to least |
| clicks/build_counter DESC | This will generate an average productivity value for the galleries in this category and then sort the categories based on which has the highest average productivity, from most to least. |
amount (optional, defaults to all)
The maximum number of categories to load, or the string "all" if you want to load all categories
exclude (optional)
A comma separated list of category names to exclude from being selected
startswith (optional)
A single character or string that the category name must start with in order to be pulled for display
The select option is intended for advanced users who are comfortable writing MySQL queries and have a decent knowledge of the
TGPX database structure and internals.
select (optional)
Use this option to specify the exact SQL query that will be used to pull categories from the database. If you specify this option, it will override all of the other settings except the var setting.
{galleries}
-
var (required)
The name of the variable that the galleries will be loaded into. This variable name will be used later with a {foreach} template function to actually display the galleries.
fillvar (optional)
This setting can be used to pull filler galleries if a previous {galleries} section did not pull the full amount specified. Set this value to the variable name from the previous {galleries} directive. If that previous variable does not have at least the amount value you have specified in this {galleries} function, galleries will be pulled in this {galleries} section to fill in the empty spots from the previous galleries section. See the filler_galleries.txt example template for an example of using this option.
preview (optional, defaults to any)
true, false or any. Setting this to false will only allow galleries that do not have a preview thumbnail. Setting this to true will only allow galleries that have a preview thumbnail. Setting this to any will allow any gallery no matter if it has a preview thumbnail.
type (optional, defaults to submitted)
submitted, permanent or any. Setting this to submitted will allow only galleries of type Submitted to be pulled for display. Setting this to permanent will allow only galleries of type Permanent to be pulled for display. To display either permanent or submitted galleries use any.
format (optional, defaults to any)
pictures, movies or any. Setting this to pictures will allow only Picture galleries to be pulled for display. Setting this to movies will allow only Movies galleries to be pulled for display. Setting this to any will allow both Pictures and Movies galleries to be pulled for display.
category (optional, defaults to MIXED)
Use this option to restrict which categories can be pulled from the database. If you want any category to be allowed, used the keyword MIXED. If you want a specific category to be pulled, list the category name exactly as it appears in the Manage Categories interface. You may also use a list of several categories by separating each category by a comma. To exclude a category, prefix it's name with a - character. Here are some examples:
-
category=Hardcore
Pull only galleries in the Hardcore category
category=Hardcore,Fetish,Amateur
Pull only galleries in the Hardcore, Fetish, or Amateur categories
category=MIXED,-Fetish
Pull galleries from any category except the Fetish category
MIXED has a special meaning on pages that have been assigned to a specific category. On those pages, only galleries from the category to which the
page is assigned will be displayed. The software will automatically convert MIXED to the appropriate category!
amount (required)
Use this option to specify how many galleries to load into the specified variable.
sponsor (optional, defaults to any)
Set this to any or a specific sponsor name. Use this option to restrict which sponsors can be pulled for display. If you want any sponsor to be allowed, you can either leave this option out or set it to any. If you want a specific sponsor to be pulled for display, list the sponsor name exactly as it appears when you assigned it to one or more galleries. You may also use a list of several sponsors by separating each sponsor by a comma. To exclude a sponsor, prefix it's name with a - character. Here are some examples:
-
sponsor=PlatinumBucks
Pull only galleries from the sponsor PlatinumBucks
sponsor=PlatinumBucks,EasyCash,MakinMoney
Pull only galleries from the PlatinumBucks, EasyCash, or MakinMoney sponsors
any,-EasyCash
Pull galleries from any sponsor except the EasyCash sponsor
Use this option to specify what gallery weights can be pulled for display. You can use any type of comparison operator here, followed by the weight value that you want to restrict. Below are all of the comparison options you can use. Note that you are not restricted to using 10, that is only there as an example. You can use any valid weight value in it's place.
-
weight="= 10"
Pull galleries that have a weight of exactly 10
weight="!= 10"
Pull galleries that have a weight which is anything except 10
weight="> 10"
Pull galleries that have a weight greater than 10
weight="< 10"
Pull galleries that have a weight less than 10
weight=">= 10"
Pull galleries that have a weight greater than or equal to 10
weight="<= 10"
Pull galleries that have a weight less than or equal to 10
previewsize (optional, only takes affect when the preview attribute is set to true)
Use this option to restrict the dimensions of preview thumbnails that will be pulled for display. This value must be in WIDTHxHEIGHT format. Here are some examples:
-
previewsize=100x100
Pull galleries that have a preview thumbnail of size 100 width and 100 height
previewsize=120x150
Pull galleries that have a preview thumbnail of size 120 width and 150 height
true or false. Use this option to specify whether or not galleries which have already been displayed on other pages can be pulled for display again on this page. This setting will override the globaldupes setting of the {define} function. If you set this to true, repeats will be allowed. Setting this to false means that no repeats will be allowed.
pagedupes (optional, defaults to the pagedupes setting of the {define} directive)
Use this option to specify whether or not galleries which have already been displayed on this page can be pulled for display again on this page. This setting will override the pagedupes setting of the {define} directive. If you set this to true, repeats will be allowed. Setting this to false means that no repeats will be allowed.
order (optional, defaults to date_approved)
Use this option to specify how you want the galleries sorted when they are pulled from the database. This sorting method will be used for Build With New type builds. All of the available sorting options are described below.
| tx_galleries.gallery_id | The gallery's assigned ID number |
| weight | The gallery's assigned weight |
| clicks | The number of clicks the gallery has received (must have click tracking enabled) |
| thumbnails | The number of thumbnails on the gallery |
| date_added | The date and time that the gallery was added to the database |
| date_approved | The date and time that the gallery was approved |
| date_displayed | The date and time that the gallery was selected for display |
| times_selected | The number of times the gallery has been selected from the approved queue for display |
| used_counter | A counter that increments for all galleries that are used during a page build. |
| build_counter | A counter that increments for all Used and Holding galleries each time a page build is done. |
| RAND() | Sort randomly |
|
All of these values can be modified with DESC to sort in descending order instead of ascending order. Additionally, these values may be combined together to generate sub-sorting options. Here are a few examples: |
|
| clicks DESC | Sort by number of clicks each gallery has received, from most clicked to least clicked |
| date_displayed DESC | Sort by the date and time the gallery was selected for display, from newest to oldest |
| DATE(date_displayed) DESC, clicks DESC | Sort by the date the gallery was selected for display, then by the number of clicks the gallery has received. Galleries with the same display date will be grouped together with the most clicked galleries in each date at the top of their associated date group. |
| clicks/used_counter DESC | This will generate a productivity value for each gallery and sort the galleries from highest productivity to lowest productivity |
| weight * RAND() DESC | This will sort galleries by their assigned weight multiplied by a random number. Galleries with a larger weight will have a better chance of being displayed before galleries that have a lower weight. |
reorder (optional, defaults to date_displayed DESC, date_approved)
Use this option to specify how you want the galleries sorted when they are pulled from the database. This sorting method will be used for Build type builds. All of the available sorting options are the same as those you can use for the order option and are described above.
minage (optional)
Use this to specify the minimum age of galleries that can be pulled for display. If you are using this value, it should be a non-negative integer. For example, setting this to 1 means that the gallery must be at least one day old to be pulled for display. Valid values start from 0 for today and continue upwards: 1 for yesterday, 2 for 2 days ago, etc.
maxage (optional)
Use this to specify the maximum age of galleries that can be pulled for display. If you are using this value, it should be a non-negative integer. For example, setting this to 5 means that the gallery must be at most 5 days old to be pulled for display. Valid values start from 0 for today and continue upwards: 1 for yesterday, 2 for 2 days ago, etc.
age (optional)
Use this value to specify an exact age of galleries that can be pulled for display. If you are using this value, it should be a non-negative integer. For example, setting this to 2 means that the gallery must be exactly 2 days old to be pulled for display. Valid values start from 0 for today and continue upwards: 1 for yesterday, 2 for 2 days ago, etc. This option cannot be used if you are using the maxage or minage options
getnew (optional, defaults to true)
true or false. Use this value to specify if new galleries should be pulled for display. When this value is set to true, galleries with Approved status will be pulled for display when a Build With New type of build is done. When this value is set to false, galleries that have previously been selected for display from Approved status will be pulled for display.
allowused (optional, defaults to true)
true or false. Use this value to specify if previously used galleries should be allowed in this section even when the getnew option is set to true and a Build With New type of build is being executed. When this value is set to true, previously used galleries will be pulled for display if there are not enough Approved galleries available to meet the amount requirement when a Build With New type of build is done.
description (optional, defaults to false)
true or false. Use this value to specify if galleries must have a description to be pulled for display. Set this value to true to require that every gallery pulled for display have a defined description, or false if a description is not required.
keywords (optional)
Use this option to specify a boolean mode search term in the keywords assigned to a gallery.  This works exactly like the keywords option but searches in the gallery tags instead.
partner (optional)
Use this option to specify a partner account username whose galleries can appear in this section. If you use this option, only galleries from the specified partner account can be pulled for display in this section.
The select and reselect options are intended for advanced users who are comfortable writing MySQL queries and have a decent knowledge of the
TGPX database structure and internals.
select (optional)
Use this option to specify the exact SQL query that will be used to pull galleries from the database during a Build With New type of build. If you specify this option, it will override all of the other settings except the var and reselect settings.
reselect (optional)
Use this option to specify the exact SQL query that will be used to pull galleries from the database during a Build type of build. If you specify this option, it will override all of the other settings except the var and reselect settings.
{intermix}
The {intermix} function has three attributes which must be set:
-
var
The variable name that the mixed arrays will be assigned to. The two original arrays will remain unchanged, while the results of this function will be stored in the variable you specify for this attribute. You can then use the {foreach} template function to loop over the contents of the array generated by this function.
from
The names of two array variables separated by a comma.
location
This will specify how the two arrays should be intermixed. There are four possible values you can use for this setting:
-
location=end
Using the end random will append the contents of the second array to the end of the first array.
location=random
Using the keyword random will randomly put items from the second array into the first array, while still maintaining the order of both arrays.
location=+5
Using + followed by a number will put items from the second array into the first array at a consistent interval. Using +5 as an example would put one item from the second array after every 5th item of the first array.
location=5,10,15
Using a comma separated list of numbers will put items from the second array into the first array at the exact positions you specify.
Template Variables
The following section will describe all of the available template variables you can use on your TGP page templates
-
Global Variables For Use Anywhere in Your TGP Page Template
Values defined by the General Settings interface
{$config.install_url} - TGPX installation URL
{$config.preview_url} - The thumbnail URL setting
{$config.from_email} - E-mail Address setting
{$config.from_email_name} - E-mail Name setting
{$config.date_format} - Date Format setting
{$config.time_format} - Time Format setting
{$config.timezone} - Timezone setting
{$config.dec_point} - Decimal Point setting
{$config.thousands_sep} - Thousands Separator setting
Other values
{$total_galleries} - The total number of galleries in the database
{$total_thumbnails} - The total number of thumbnails in the database
{$total_categories} - The total number of categories in the database
{$page_category.name} - The name of the current page's category
{$page_category.category_id} - The ID of the current page's category
{$page_galleries} - The number of galleries linked to from the current page
{$page_thumbnails} - The number of thumbnails on the galleries linked to from the current page {$this_page.page_id} - The ID number of the page being built
{$this_page.page_url} - The full URL of the page being built
{$this_page.tags} - The tags assigned to the page being built
Gallery Data Variables
When you use the {galleries} function to load some galleries into a variable, you will be able to loop over that variable using the {foreach} function. Inside that {foreach} function you will be able to access the values for each gallery. Assuming you use the name $gallery for the var attribute of the {foreach} function, those available values are:
Remember, you may not always be using the $gallery prefix to access the gallery data. The specific value you use will
depend on the var attribute of the {foreach} function that is being used to loop over the array. For example, if you use
this {foreach} function:
{foreach var=$gal from=$galleries}
You would need to replace $gallery in each of the below values with $gal
{foreach var=$gal from=$galleries}
You would need to replace $gallery in each of the below values with $gal
{$gallery.gallery_id} - The gallery's ID number
{$gallery.gallery_url} - The gallery URL
{$gallery.description} - The gallery description
{$gallery.keywords} - The keywords assigned to the gallery
{$gallery.thumbnails} - The number of thumbnails that appear on the gallery
{$gallery.email} - The e-mail address associated with the gallery
{$gallery.nickname} - The name/nickname associated with the gallery
{$gallery.weight} - The gallery's assigned weight
{$gallery.clicks} - The number of clicks the gallery has received
{$gallery.submit_ip} - The IP address of the gallery submitter
{$gallery.gallery_ip} - The IP address of the gallery itself
{$gallery.type} - The type of gallery, either submitted or permanent
{$gallery.format} - The format of the gallery, either pictures or movies
{$gallery.date} - The date and time that the gallery was selected for display
{$gallery.partner} - The username of the partner account that submitted the gallery
{$gallery.has_recip} - A flag to indicate if the gallery has a reciprocal link to your site; 1 for yes, 0 for no
{$gallery.has_preview} - A flag to indicate if the gallery has one or more preview thumbnails; 1 for yes, 0 for no
{$gallery.times_selected} - The number of times the gallery has been selected for display from approved status
{$gallery.used_counter} - The number of times the gallery has been used during a build
{$gallery.build_counter} - The number of builds that have occurred since the gallery was selected for display
{$gallery.tags} - The tags assigned to the gallery
{$gallery.category} - The category name that this gallery is assigned to
{$gallery.categories} - All of the categories assigned to this gallery (array value, available only on MIXED pages)
{$gallery.icons} - An array of icons assigned to the gallery
{$gallery.preview_url} - The full URL to the preview thumbnail for this gallery, if it has one
{$gallery.preview_width} - The width of the preview thumbnail, if it has one
{$gallery.preview_height} - The width of the preview thumbnail, if it has one
{$gallery.report_url} - The full URL to the report.php script to report this gallery as broken, cheating
{$gallery.sponsor} - The name of the sponsor assigned to this gallery
{$gallery.sponsor_url} - The URL of the sponsor assigned to this gallery
In addition to these default values, all of your user defined gallery fields will be available from this template value as well. So, for example, if you create a user defined field with the name icq_number you can access this value using {$gallery.icq_number}
Category Values
When you use the {categories} function to load some categories into a variable, you will be able to loop over that variable using the {foreach} function. Inside that {foreach} function you will be able to access the values for each category. Assuming you use the name $category for the var attribute of the {foreach} function, those available values are:
Remember, you may not always be using the $category prefix to access the category data. The specific value you use will
depend on the var attribute of the {foreach} function that is being used to loop over the array. For example, if you use
this {foreach} function:
{foreach var=$cat from=$categories}
You would need to replace $category in each of the below values with $cat
{foreach var=$cat from=$categories}
You would need to replace $category in each of the below values with $cat
{$category.name} - The name of this category
{$category.galleries} - The total number of used and approved galleries in this category
{$category.used} - The total number of used galleries in this category as of the last build
{$category.clicks} - The total click count for the galleries in this category
{$category.build_counter} - The total build_counter value for all galleries in this category
{$category.page_url} - The URL to the first page in this category (the page with the lowest build number assigned to this category)
Page Values
When you use the {pages} function to load some pages into a variable, you will be able to loop over that variable using the {foreach} function. Inside that {foreach} function you will be able to access the values for each page. Assuming you use the name $page for the var attribute of the {foreach} function, those available values are:
Remember, you may not always be using the $page prefix to access the page data. The specific value you use will
depend on the var attribute of the {foreach} function that is being used to loop over the array. For example, if you use
this {foreach} function:
{foreach var=$p from=$pages}
You would need to replace $page in each of the below values with $p
{foreach var=$p from=$pages}
You would need to replace $page in each of the below values with $p
{$page.page_url} - The full URL to the page
{$page.name} - The name of the category this page is assigned to (this will be empty for MIXED pages)
Search Values
When you use the {searches} function to load search terms into a variable, you will be able to loop over that variable using the {foreach} function. Inside that {foreach} function you will be able to access the values for each search term. Assuming you use the name $search for the var attribute of the {foreach} function, those available values are:
Remember, you may not always be using the $search prefix to access the search data. The specific value you use will
depend on the var attribute of the {foreach} function that is being used to loop over the array. For example, if you use
this {foreach} function:
{foreach var=$s from=$searches}
You would need to replace $search in each of the below values with $s
{foreach var=$s from=$searches}
You would need to replace $search in each of the below values with $s
{$search.term} - The search term
{$search.searches} - The number of searches done for this term
{$search.font_size} - The font size (in percent) to use for the search term (useful for tag clouds)
%%Powered_By%%
Removing or making the powered by link invisible to surfers is a violation of the software license agreement and will result in license termination.
The powered by link can only be removed if you have purchased the link removal license.
This is a special template value which does not conform to the standard format. It is not necessary to enclose this template value in curly braces. This will control where the Powered By TGPX link appears on your pages. If you remove this template value, the powered by link will automatically be placed on your page before the closing </body> tag.