Welcome to Geeklog, Anonymous Tuesday, December 10 2024 @ 10:57 pm EST
Geeklog Forums
Newsletter plugin
Status: offline
suprsidr
Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
I'm developing a Newsletter plugin for GL 1.5.x
I'm having strange results with globals.
for instance mysql_install.php
the {$_TABLES['newsletter']} gets totally ignored as if its blank. But that is exactly how every stock plugin does it.
if I replace {$_TABLES['newsletter']} with gl_newsletter install goes fine until other globals get ignored.
Throughout the entire plugin it seems $_CONF and $_USER and $_TABLES.... are all being ignored.
any ideas?
whitespaces???
-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
I'm having strange results with globals.
for instance mysql_install.php
Text Formatted Code
$_SQL[] = "CREATE TABLE {$_TABLES['newsletter']} (.....the {$_TABLES['newsletter']} gets totally ignored as if its blank. But that is exactly how every stock plugin does it.
if I replace {$_TABLES['newsletter']} with gl_newsletter install goes fine until other globals get ignored.
Throughout the entire plugin it seems $_CONF and $_USER and $_TABLES.... are all being ignored.
any ideas?
whitespaces???
-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
21
16
Quote
Status: offline
jmucchiello
Forum User
Full Member
Registered: 08/29/05
Posts: 985
Where did you put the code to setup the table?
$_TABLES['yourtable'] = $_DB_table_prefix . 'yourtable';
It should be in your functions.inc near the top. (It use to go in the config.php but that's not really correct in 1.5 and up.) Don't model your plugin against the built-in plugins. The built-in plugins aren't really standalone plugins. Core Geeklog helps them with their initial install and upgrades.
I'm not really sure what is a good model as there aren't any popular plugins with config class support yet. I'm sure an update to the plugin how-to is somewhere on the todo list of one of the devs.
Oh, and, um, you do know about the "global" directive in PHP, right?
$_TABLES['yourtable'] = $_DB_table_prefix . 'yourtable';
It should be in your functions.inc near the top. (It use to go in the config.php but that's not really correct in 1.5 and up.) Don't model your plugin against the built-in plugins. The built-in plugins aren't really standalone plugins. Core Geeklog helps them with their initial install and upgrades.
I'm not really sure what is a good model as there aren't any popular plugins with config class support yet. I'm sure an update to the plugin how-to is somewhere on the todo list of one of the devs.
Oh, and, um, you do know about the "global" directive in PHP, right?
22
19
Quote
Status: offline
eg0master
Forum User
Regular Poster
Registered: 07/21/05
Posts: 73
Location:Stockholm
Quote by: suprsidr
Throughout the entire plugin it seems $_CONF and $_USER and $_TABLES.... are all being ignored.
Is this in functions? I'm guessing yes. Do you have a global directive in the beginning of your function telling your function that $_CONF etc are globals?
take a look at the functions in lib-common.php if you don't know what i mean. otherwise, please post an example of usage that does not work for you.
Geeklog Plugins: http://plugincms.com
20
20
Quote
Status: offline
suprsidr
Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
$_TABLES['yourtable'] = $_DB_table_prefix . 'yourtable';
Yup that fixed it.
Strangely I have this in my other plugins but somehow forgot it here
Thankfully I asked for help before I spent days on it.
Thanks guys
newsletter plugin coming soon.
-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
19
23
Quote
Status: offline
::Ben
Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
newsletter plugin coming soon.
-s[/p]
Hi Wayne,
Waiting for it
Thanks.
::Ben
P.S I'm also working on a "newsletter" plugin but I will call it ML (mailing liste) plugin.
I'm available to customise your themes or plugins for your Geeklog CMS
21
17
Quote
Status: offline
suprsidr
Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
Well, let me start off by saying ... my Newsletter plugin is a total rip-off of the staticpages plugin. Matter of fact its a total clone plus some added functionality.
I started off creating everything from scratch, then saying... hmm.. I could use that functionality, then... oh yeah that too.... ultimately I copied the entire staticpages plugin and added my needed functionality.
Thanks to Blaine, Dirk and Tony and any others who have contributed to this plugin
In retrospect it would have been easier to simply modify the SP plugin directly.
So with that said... I have a release.
It creates an extra table to hold simple email addresses - as GL's email functionality won't let you email someone if they have never logged-in as they don't technically exist until they do.
It creates a block phpblock_newsletter which holds the form (ajax, so no page refresh). There is also another block phpblock_newsletter_small which I added a variable to the header {newsletter_sm} in case you want to call it in the header maybe around the search???
Admin has all the abilities as the SP plugin along with the ability to "Send now", and manage subscribers.
I've added the proper "Having problems viewing this page? View it on our site....." and Unsubscribe links in the mailing.
I moved the templates to the theme as to allow per theme layouts.
Also an "Archive" link in the form.
I have a working demo.
But I need testers and constructive criticism.
-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
I started off creating everything from scratch, then saying... hmm.. I could use that functionality, then... oh yeah that too.... ultimately I copied the entire staticpages plugin and added my needed functionality.
Thanks to Blaine, Dirk and Tony and any others who have contributed to this plugin
In retrospect it would have been easier to simply modify the SP plugin directly.
So with that said... I have a release.
It creates an extra table to hold simple email addresses - as GL's email functionality won't let you email someone if they have never logged-in as they don't technically exist until they do.
It creates a block phpblock_newsletter which holds the form (ajax, so no page refresh). There is also another block phpblock_newsletter_small which I added a variable to the header {newsletter_sm} in case you want to call it in the header maybe around the search???
Admin has all the abilities as the SP plugin along with the ability to "Send now", and manage subscribers.
I've added the proper "Having problems viewing this page? View it on our site....." and Unsubscribe links in the mailing.
I moved the templates to the theme as to allow per theme layouts.
Also an "Archive" link in the form.
I have a working demo.
But I need testers and constructive criticism.
-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
17
16
Quote
Status: offline
::Ben
Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Hi Wayne,
I'm testing your alpha release.
Here are some points I noticed :
1 - When you submit twice an email the message is still "Thanks for signing up!".
2 - In the editor I can choose newsletter as a centerblock but I can't see this centerblock.
3 - Maybe will you add a link to unsubscribe in the block.
Thanks.
::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
I'm testing your alpha release.
Here are some points I noticed :
1 - When you submit twice an email the message is still "Thanks for signing up!".
2 - In the editor I can choose newsletter as a centerblock but I can't see this centerblock.
3 - Maybe will you add a link to unsubscribe in the block.
Thanks.
::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
16
17
Quote
Status: offline
suprsidr
Forum User
Full Member
Registered: 12/29/04
Posts: 555
Location:Champaign, Illinois
When you submit twice an email the message is still "Thanks for signing up!".
KISS (Keep It Simple Silly) - we just say thanks instead of saying "you already signed up silly"
In the editor I can choose newsletter as a centerblock but I can't see this centerblock.
Hmmm.. Never actually tried this functionality just assumed it would work, but will check into it.
Maybe will you add a link to unsubscribe in the block
Not my intention to put a point of negativity in plain sight. They technically only need to see this if they are in fact receiving the newsletter.
@samstone
I actually think SP would also be a perfect template to make a "Home Pages" plugin allowing each site member to have his/her own single page.
-s
FlashYourWeb and Your Gallery with the E2 XML Media Player for Gallery2 - http://www.flashyourweb.com
18
19
Quote
Status: offline
::Ben
Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
I actually think SP would also be a perfect template to make a "Home Pages" plugin allowing each site member to have his/her own single page.
+1
::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
18
22
Quote
All times are EST. The time is now 10:57 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content