Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Ace_News questions

(Page 1 of 2)
> >
Quote Reply
Ace_News questions
 Hi Andy,

I've got some questions to do with your purchasable plugin Ace_News.

I see from your support sites blurb you mention its possible to use Acenews in Static mode.

Quote:
Dynamic mode (i.e page.cgi), although static mode can also be used, it requires page rebuild whenever you want the news to be updated.

How can i setup Acenews so it publishes static pages?


I've setup a test article im hoping to call from my sites homepage using the suggested method from the Read Me doc - example:

<%Plugins::Ace_News::Show_Article('category','Some%20Category','my_news_link')%>

Which returns the following error:

Error: Unable to load module: Plugins::Ace_News. Reason:
Error: No subroutine 'Plugins::Ace_News::Show_Article' in 'Plugins/Ace_News.pm',
Can't locate Plugins.pm in @INC (@INC contains: /home/virtual/site2/fst/var/www/cgi-bin/admin /usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i386-linux /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.6.1/i386-linux /usr/lib/perl5/vendor_perl/5.6.1 /usr/lib/perl5/vendor_perl .) at GT::Template::_call_func line 732.

thanks for your help,

Charlie Abbott



Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile

Quote Reply
Re: [Chas-a] Ace_News questions In reply to
Hi.

Quote:
How can i setup Acenews so it publishes static pages?

The same way you have it setup to run in static mode. Basically, all I am saying on that page, is that you will not get the most up-to-date news on static pages, until you do a rebuild. If you have a 'build' set to run via cron, then you shouldn't have a problem :)

Quote:
I've setup a test article im hoping to call from my sites homepage using the suggested method from the Read Me doc - example:

<%Plugins::Ace_News::Show_Article('category','Some%20Category','my_news_link')%>

Which returns the following error:

Sorry, it should be the following (note the extra 's' at the end);

Code:
<%Plugins::Ace_News::Show_Articles('category','Some%20Category','my_news_link')%>

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] Ace_News questions In reply to
Got it working cheers!

I see you dont need to uri encode the category names :-)

<%Plugins::Ace_News::Show_Articles('category','Some Category','my_news_link')%> Goin to start a new thread about getting AceNews working with Pagebuilder ;)



Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile

Quote Reply
Re: [Chas-a] Ace_News questions In reply to
Glad its working ;)

Quote:
Goin to start a new thread about getting AceNews working with Pagebuilder ;)

Afraid I don't have PageBuilder.

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] Ace_News questions In reply to
  
Np, i decided to manually enter a new Pagebuilder page each time a news article is added - that is ill do that if the next question is possible:

I can display the articles newest order first by adding this global:

<%Plugins::Ace_News::Show_Articles('category','Some Category')%>

and limit the amount showing to five using:

<%Plugins::Ace_News::Show_Articles('category','Some Category','5')%>

Which calls the news_tag_link.html template for each article:

<p><a href="
<%db_cgi_url%>/news.cgi?a=article&ID=<%TimeStmp%>"><strong><%Title%></strong></a><br />
<%Short%>
</p>

Is there a built in method for displaying a static version of the <%db_cgi_url%>/news.cgi?a=article&ID=<%TimeStmp%> link?

Im hoping to avoid using mod_rewrite or using the link above directly due to the load it will place on my sites dedicated server also cgi pages arn't indexed by search engines.

thanks,

Charlie




Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile

Last edited by:

Chas-a: Feb 16, 2004, 4:09 PM
Quote Reply
Re: [Chas-a] Ace_News questions In reply to
The 'core' of the script is already there. Due to the way I have structured the database, I would imagine its possible to make the news database into static pages.

If you would like a quote on doing this (or you may attempt it yourself), then please feel free to get in contact with me.

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] Ace_News questions In reply to
Hi Andy,

Good to chat with you on the phone yesterday, got a couple of questions for you to do with setting up SE firendly pages using Ace_News.

As mentioned above im using the <%Plugins::Ace_News::Show_Articles('category','Some Category','3')%> to display the 3 latest articles on my sites home page and site map.

Looking through the Show_Articles sub in Ace_News.pm I see the maximum articles I can display is 5, so i've updated this to 15:

my $limit = $_[2] || 15; #Line number 1477

What im hoping to do is call 15 articles per (pagebuilder) page using the plugin call (you dont need to know pagebuilder to understand how this works ;-):

<%Plugins::Ace_News::Show_Articles('category','Some Category','1,15')%> #to display latest articles 1>15

<%Plugins::Ace_News::Show_Articles('category','Some Category','16,15')%> <#to display latest articles 16>30

Should the Show_Articles call above to this code from Ace_News.pm:

$table->select_options('ORDER BY TimeStmp DESC',"LIMIT $limit"); #Line number 1527 in Ace_News.pm

The error im getting is the when i call 'category','Some Category','16,15' this displays article 1 only - any idea why this is happening as the MySQL code is correct or should accept page sets using this limit (16,15) ie. start at record 16 and display the next 15?


Also , I've come up with a hack to make this plugin search engine friendly using mod_rewrite for the article pages, example:

.htaccess:
Code:
RewriteEngine on
Options All
RewriteBase /
RewriteRule ^NonExistentArticlesFolder/([0-9]+)/?$ cgi-bin/news.cgi?a=article&ID=$1

Which results in url's looking like this:

someserver.com/NonExistentArticlesFolder/1077197299/

instead of:

someserver.com/cgi-bin/news.cgi?a=article&ID=1077197299

Where you able to find the time to change the referance to a standard table ID in the uneditable news.cgi file? (managed to add auto_increment primary key called NewsID to my sites lsql_News_Articles table).

As im hoping to referance the articles using:

someserver.com/NonExistentArticlesFolder/1/

someserver.com/NonExistentArticlesFolder/2/ etc.

or if you could detail a way I can edit the news.cgi file im happy to change the code myself :)


Thanks for your help with this Andy - I feel making this plugin more SE friendly should result in more sales :-D



Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile

Last edited by:

Chas-a: Feb 19, 2004, 7:52 AM
Quote Reply
Re: [Chas-a] Ace_News questions In reply to
Hi.

Quote:
$table->select_options('ORDER BY TimeStmp DESC',"LIMIT $limit"); #Line number 1527 in Ace_News.pm

The error im getting is the when i call 'category','Some Category','16,15' this displays article 1 only - any idea why this is happening as the MySQL code is correct or should accept page sets using this limit (16,15) ie. start at record 16 and display the next 15?

I think you would need it like this;

Code:
$table->select_options(,"LIMIT $limit",'ORDER BY TimeStmp DESC');

i.e the other way round (I think its sensative).

Thats quite a nice bit of mod_rewrite you have there. I'll put that up in the support area, if thats alright with you? Cool

I'm working on those changes for you, but its not simple :)

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] Ace_News questions In reply to

Good ol trial and error! got it working ;)

Changed the select like this:

$table->select_options("ORDER BY TimeStmp DESC LIMIT $limit, $page_amount");

and where $limit is set at the top:

my $limit = $_[2] || 5;

change to...

my $limit = $_[2] || 1;
$limit--;
my $page_amount = $_[5];

For some reason without taking 1 off $limit always calls the next record along? ie. without the
$limit--;
<%Plugins::Ace_News::Show_Articles('category','Some Category','1','','','15')%> returns article links 2 > 16

Anyway (fingers crossed) it seems to be working fine now ;-)


Quote:
Thats quite a nice bit of mod_rewrite you have there. I'll put that up in the support area, if thats alright with you? Cool

I'm working on those changes for you, but its not simple :)

Feel free to use it - there's also loads of rewrite examples and tips on Sitepoint.com or Google.

thanks for modifying the id referance for me!

cheers,

Charlie

Last edited by:

Chas-a: Feb 19, 2004, 1:54 PM
Quote Reply
Re: [Chas-a] Ace_News questions In reply to
Cool.

Quote:
thanks for modifying the id referance for me!

Before I start making this modification; are there any extra features that people want added? Its a hell of a job to do, without at least making another improvement :)

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] Ace_News questions In reply to
I see you can uninstall any plugin and edit all the files including .cgi files (as you would thru fileman).

Thanks all the same Andy, have made this change to the ID myself. :D



Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile

Quote Reply
Re: [Chas-a] Ace_News questions In reply to
No prob. Be sure to change it in the Ace_News.pm file (in /admin/Plugins) too, otherwise the admin side of things won't work Wink

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] Ace_News questions In reply to
Im using auto_increment for NewsID fella so no need.

Quote:
Its a hell of a job to do, without at least making another improvement :)

b.t.w Andy its not in the least bit a hell of a job ;) as the only change
to make someserver.com/news/1077197299/ to someserver.com/News/1/ etc. is one referance on line number 160 in news.cgi

From:

Code:
my $sth = $DB->table('News_Articles')->select( { TimeStmp => $IN->param('ID') } ) || die &error("$GT::SQL::error");

To:

Code:
my $sth = $DB->table('News_Articles')->select( { NewsID => $IN->param('ID') } ) || die &error("$GT::SQL::error");

Quote Reply
Re: [Chas-a] Ace_News questions In reply to
Whoops Blush I thought I had coded it in Ace_News.pm, and all the templates. I suppose that would only be if you wanted to modify the string they saw. Either way, I'm glad its working for you :)

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: [Chas-a] Ace_News questions In reply to
In Reply To:
Im using auto_increment for NewsID fella so no need.

Quote:
Its a hell of a job to do, without at least making another improvement :)

b.t.w Andy its not in the least bit a hell of a job ;) as the only change
to make someserver.com/news/1077197299/ to someserver.com/News/1/ etc. is one referance on line number 160 in news.cgi

From:

Code:
my $sth = $DB->table('News_Articles')->select( { TimeStmp => $IN->param('ID') } ) || die &error("$GT::SQL::error");

To:

Code:
my $sth = $DB->table('News_Articles')->select( { NewsID => $IN->param('ID') } ) || die &error("$GT::SQL::error");



Chas-a,
I'm trying to do the same thing with Ace news on my site. COUld you post a step by step of what you did.

Thanks
CCUnet
my Christian web
Quote Reply
Re: [ccunet] Ace_News questions In reply to
Yer NP I wont even charge ;-p


Have you already setup the news tables?



Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile

Quote Reply
Re: [Chas-a] Ace_News questions In reply to
Yep,
The plugin is installed and working.

ccunet
my Christian web
Quote Reply
Re: [ccunet] Ace_News questions In reply to
 Before you start this are the news file live and working on your site now?

Also if you've got an data in there you'll need to start from scratch so as the auto_increment works correctly.

Using PHPmyadmin click on the Properties for lsql_News_Articles, on the Add new field: add 1 at the beginning.

I called this NewsID - Type: int(11), Null: No, Extra: auto_increment and tick the Primary and Unique options - may throw an error first couple of times.

Then Uninstall the Ace_News plugin - you need to do this so any changes you make to the source code will stick if you ever need to uninstall - re-install again.

Then edit news.cgi and on line 160 make the following change:

Code:
from:
my $sth = $DB->table('News_Articles')->select( { TimeStmp => $IN->param('ID') } ) || die &error("$GT::SQL::error");

to:
my $sth = $DB->table('News_Articles')->select( { NewsID => $IN->param('ID') } ) || die &error("$GT::SQL::error");

Done :-D

Once you get your first news article in you'll be able to reference it with someserver.com/cgi-bin/news.cgi?a=article&ID=1 or using SE friendly URL's with .htaccess:

RewriteEngine on
Options All
RewriteBase /
RewriteRule ^some-folder-name/([0-9]+)/?$ cgi-bin/news.cgi?a=article&ID=$1

Let me know if you have any other questions.



Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile

Last edited by:

Chas-a: Apr 19, 2004, 6:41 AM
Quote Reply
Re: [Chas-a] Ace_News questions In reply to
No I don't have any live news just test items. I
my Christian web

Last edited by:

ccunet: Apr 19, 2004, 8:14 AM
Quote Reply
Re: [ccunet] Ace_News questions In reply to
 Cool - no need to worry about loosing or corrupting data then ;)

Let me know if you have any trouble with the details above.



Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile

Quote Reply
Re: [Chas-a] Ace_News questions In reply to
 Chas,
I got it set up as you instructed above. All seems to be working.
How did you integrate with pagebuilder?

ccunet
my Christian web

Last edited by:

ccunet: Apr 19, 2004, 8:15 AM
Quote Reply
Re: [ccunet] Ace_News questions In reply to
No need to ;) once you start populating the news pages: Plugins > Add Article

you'll be able to view them instantly using the correct path:

someserver.com/cgi-bin/news.cgi?a=article&ID=1

or with .htaccess -
someserver.com/some-folder-name/1/



Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile

Quote Reply
Re: [Chas-a] Ace_News questions In reply to
Hi Charlie. I've added a link to this post on our SQLWidgets site now....

http://www.sqlwidgets.com/...rces/Detailed/4.html

Just letting you know :)

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] Ace_News questions In reply to
Cheers Andy! Smile



Comedy Quotes - Glinks 3.3.0, PageBuilder, StaticURLtr, CAPTCHA, User_Edit_Profile

Quote Reply
Re: [Chas-a] Ace_News questions In reply to
In Reply To:
No need to ;) once you start populating the news pages: Plugins > Add Article

you'll be able to view them instantly using the correct path:

someserver.com/cgi-bin/news.cgi?a=article&ID=1

or with .htaccess -
someserver.com/some-folder-name/1/

Cool!
Thanks for all your help Chas!

ccunet
my Christian web
> >