Gossamer Forum
Home : Products : Gossamer Links : Discussions :

unknown tag

Quote Reply
unknown tag
i installed e-mail before you validate a link and i inculded in the e-mail the tag <%ID%>
but the e-mail is sent fine except i'm getting an Unknown Tag: 'ID'

do i need to define it in global?

if so how?
Quote Reply
Re: [theguy] unknown tag In reply to
i want to add a tag for <%ID%> in the e-mail sent but i keep getting unknown tag instead

where should i define it to make it work?

please someone help me, i know it's very simple
Quote Reply
Re: [theguy] unknown tag In reply to
Hi,

Try adding this to the email template, to see what tags are available;

Code:
<%if Username eq "test_user"%>
<%GT::Template::dump%>
<%endif%>

(then add a link from the user "test_user", so only you see the debug info).

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] unknown tag In reply to
here is what i got

Available Variables
CatLinks.CategoryID
1
Category
Test
Contact_Email

Contact_Name
waleed
Description
test
Email

Name

Newsletter
Yes
ReceiveMail
Yes
Status
Registered
Title
test
Username
waleed
Validation
0
add_system_fields
$VAR = {
    'isChanged' => 'No',
    'Rating' => '0',
    'Hits' => '0',
    'Votes' => '0',
    'isPopular' => 'No',
    'isNew' => 'No',
    'Status' => '0'
};

admin_email_add
1
admin_email_mod
1
bans
$VAR = [];

build_auto_validate
2
build_category_columns
2
build_category_sort
Name
build_category_table
border=0 width="100%"
build_category_yahoo
1
build_cool_gb
1
build_detailed
1
build_dir_per
0777
build_directory_field

build_extension
.html
build_file_per
0666
build_index
index.html
build_links_per_page
25
build_new_cutoff
500
build_new_gb
1
build_pop_cutoff
0.01
build_search_gb
1
build_sort_order_category
isNew DESC,isPopular DESC,Title
build_sort_order_cool
Title
build_sort_order_new
Add_Date DESC,Title
build_sort_order_search
score
build_sort_order_search_cat
score
build_span_pages
1
build_use_backup
0
compress
1
d
1
date_days_long
$VAR = [
    'Sunday',
    'Monday',
    'Tuesday',
    'Wednesday',
    'Thursday',
    'Friday',
    'Saturday'
];

date_days_short
$VAR = [
    'Sun',
    'Mon',
    'Tue',
    'Wed',
    'Thu',
    'Fri',
    'Sat'
];

date_db_format
%yyyy%-%mm%-%dd%
date_long_format
%dddd%, %mmmm% %dd% %yyyy%
date_month_long
$VAR = [
    'January',
    'February',
    'March',
    'April',
    'May',
    'June',
    'July',
    'August',
    'September',
    'October',
    'November',
    'December'
];

date_month_short
$VAR = [
    'Jan',
    'Feb',
    'Mar',
    'Apr',
    'May',
    'Jun',
    'Jul',
    'Aug',
    'Sep',
    'Oct',
    'Nov',
    'Dec'
];

date_offset
0
date_user_format
%ddd% %mmm% %dd% %yyyy%
db_gen_category_list
1
db_hit_expire
2
db_mail_path
/usr/sbin/sendmail
db_rate_expire
2


please note i removed my e-mail so i don't get alot of spam
Quote Reply
Re: [theguy] unknown tag In reply to
Hi,

Mmm.. odd. There should be either <%ID%> or <%LinkID%> in there somewhere :/ Which template are you looking in? (just to make sure :))

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] unknown tag In reply to
links sql 2.0 default templates
Quote Reply
Re: [theguy] unknown tag In reply to
Sorry, I mean't which actual template :P i.e email-val.txt?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] unknown tag In reply to
it's

add-email-pre.txt

a template for one of your plugins
Quote Reply
Re: [theguy] unknown tag In reply to
Mmm.. which plugin? I don't recognise that email template =) (been out of sync recently with them a lot, due to family commitments :()

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] unknown tag In reply to
SendEmailAfterAdd

Description:
Heres a freebie little plugin. Basically, it sends out an email to the person who just submitted a link (to Contact_Email). This is a feature missing in 2.x versions, but it *may* (or may not) have been added in 3.x (I havn't checked it out too much yet).
Quote Reply
Re: [theguy] unknown tag In reply to
Aaaah.. I get you now <G> (was a while since I wrote that :P)

In /admin/Plugins/SendEmailAfterAdd.pm, find;

Code:
%$newIN = map { $_ => $IN->param($_) } $IN->param;

..and add below it;

Code:
$newIN->{ID} = $DB->table('CatLinks')->select( ['MAX(LinkID)'] )->fetchrow;


So it looks like;

Code:
%$newIN = map { $_ => $IN->param($_) } $IN->param;
$newIN->{ID} = $DB->table('CatLinks')->select( ['MAX(LinkID)'] )->fetchrow;

Hopefully will work =) (nb: untested)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] unknown tag In reply to
thankyou! it did work !
Quote Reply
Re: [theguy] unknown tag In reply to
Cool

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] unknown tag In reply to
i noticed it's got a bug:

when someone submit a new link and forget to fill a required field like the title the e-mail is sent to him anyway

is there a way to fix this?

p.s. thanks andy for your help, expect a gift from me this christmass
Quote Reply
Re: [theguy] unknown tag In reply to
Andy needs to make sure he makes the plugin uses a POST hook instead of a PRE hook so the plugin doesn't activate on an error.

Adrian

Last edited by:

brewt: Jul 31, 2006, 1:13 PM
Quote Reply
Re: [brewt] unknown tag In reply to
it looks like Andy is too busy to see this:

can you take a look at SendEmailAfterAdd.pm

and tell me what changes needed to fix this:


# ==================================================================
# Plugins::SendEmailAfterAdd - Auto Generated Program Module
#
# Plugins::SendEmailAfterAdd
# Author : Andy Newby (Ultranerds)
# Version : 1
# Updated : Tue Feb 15 08:29:24 2005
#
# ==================================================================
#

package Plugins::SendEmailAfterAdd;
# ==================================================================

use strict;
use GT::Base;
use GT::Plugins qw/STOP CONTINUE/;
use Links qw/$CFG $IN $DB $USER/;
use GT::Template;

# Inherit from base class for debug and error methods
@Plugins::SendEmailAfterAdd::ISA = qw(GT::Base);

# Your code begins here! Good Luck!


# PLUGIN HOOKS
# ===================================================================


sub user_add_link {
# -----------------------------------------------------------------------------
# This subroutine will be called whenever the hook 'user_add_link' is run. You
# should call GT::Plugins->action(STOP) if you don't want the regular
# 'user_add_link' code to run, otherwise the code will continue as normal.
#
my (@args) = @_;

my $newIN;
%$newIN = map { $_ => $IN->param($_) } $IN->param;
$newIN->{ID} = $DB->table('CatLinks')->select( ['MAX(LinkID)'] )->fetchrow;
$newIN->{Category} = get_cat($IN->param('CatLinks.CategoryID'));
my $message = GT::Template->parse( 'add-email-pre.txt', { %$newIN, %$USER, %$CFG }, { compress => 0 } );

my $support_email = $CFG->{db_admin_email};
my $subject = "AICCSA 2007 Submission Received...";

require GT::Mail;
$GT::Mail::error ||= ''; # Silence -w
GT::Mail->send (
smtp => $CFG->{db_smtp_server},
sendmail => $CFG->{db_mail_path},
from => $support_email,
subject => $subject,
to => $IN->param('Contact_Email'),
msg => $message,
debug => $Links::DEBUG
) or Links::fatal ("Unable to send mail: $GT::Mail::error");

return @args;
}

sub get_cat {
my $catid = $_[0];
my $cat = $DB->table('Category')->get($catid);
return $cat->{Full_Name};
}

# Always end with a 1.
1;
Quote Reply
Re: [brewt] unknown tag In reply to
how can i edit a post in this forum? is it possible?
Quote Reply
Re: [theguy] unknown tag In reply to
an"edit" link appears in the top right corner of your post for the first hour after you submitted your reply.

Philip
------------------
Limecat is not pleased.
Quote Reply
Re: [fuzzy logic] unknown tag In reply to
what if i want to edit an old message
Quote Reply
Re: [theguy] unknown tag In reply to
You can't. There is a limit on how long you have before your message is set in stone. Only administrators and moderators can edit posts after the time limit.

Philip
------------------
Limecat is not pleased.
Quote Reply
Re: [fuzzy logic] unknown tag In reply to
thanks

i just send tham an e-mail asking them to do it for me
Quote Reply
Re: [theguy] unknown tag In reply to
anyone can help me here?

how to fix this bug?
Quote Reply
Re: [theguy] unknown tag In reply to
You just need to check your tags for input and print the error as noted...

example...

if (!$IN->param('subject') || !$IN->param('to') || !$IN->param('from') ... etc ) {

return $error("You must enter in all the required fields")...

}

I'm haven't gone through the plugin to see exactly how errors are handled, but something like that should work...

Hope this helps,

- Jonathan