ArticleTrader.com
  

 Main Menu

  Home
  Member Login
  Forum
  Submit Article
  RSS Feeds
  Contact Us
  About

 Services

  Article Distribution
  Link Building

 Tools

  ArticleMS
  Directory Tracker

 Categories

  Automotive
  Business
  Computers
  Entertainment
  Finance
  Food
  Health
  Home and Family
  Internet
  Legal
  Science
  Self Improvement
  Shopping
  Society
  Sports
  Technology
  Travel
  Writing





























 
Welcome! ( Login | Register )
» ArticleTrader Forums » ArticleMS » Support » Article ID in url
Members Search Help

Pages: << prev 1 next >>
Article ID in url
This member is currently offline articlefinder
Member


Member Level

Group: Members
Posts: 41
Joined: Jun 21, 2007

Go to the bottom of the page Go to the top of the page

Hey,
I want to have the Article ID include in the URL - is it possible?
(mayby I have to modify some PHP funktions)

Google News wants a Number in the URL - That`s the reason.

Thank you  for any help


Posted Jun 29, 2009, 9:06 am
This member is currently offline Latona
Pool


Member Level

Group: Members
Posts: 579
Joined: Jul 16, 2006

Go to the bottom of the page Go to the top of the page

I am not sure if someone has done this before or not, but it is something I thought had already been done (or at least suggested).

The core code may need to be modified - where it is generating the article url... it would need the article_id to be called to generate the url rather than just the article_urltitle

I have not tested this and I'm sure an experienced coder/programmer will correct me, but I think it is in the core bit (there may be other bits that need added as well)

Code:
In core.php file

$Article->urltitle = $articlerow['article_urltitle'];
$Article->view = array();
$Article->view_encoded = array();

$Article->url = $Article->Category->url.$Article->urltitle.'.'.$this->settings['url_extension'];


That looks to be where the article url is generated... and to get the article id in there you would need to alter that piece of code and add article_id into it somewhere :)

Here is my attempt to get the ball rolling:

Code:
$Article->url = $Article->Category->url.$Article->id.$Article->urltitle.'.'.$this->settings['url_extension'];


It would be great if that was all that was required, but I am sure a programmer will be able to present the right solution.

Posted Jul 5, 2009, 3:25 pm
This member is currently offline Latona
Pool


Member Level

Group: Members
Posts: 579
Joined: Jul 16, 2006

Go to the bottom of the page Go to the top of the page

It would be nice if a programmer was able to give a definitive answer on how to achieve this in urls... it may have other possible uses other than to maybe show up in google news...

Posted Jul 15, 2009, 5:04 am
This member is currently offline pka5s
Newbie


Member Level

Group: Members
Posts: 21
Joined: Jun 7, 2008

Go to the bottom of the page Go to the top of the page

I need it urgently, Please help.

Posted Jul 30, 2009, 6:56 pm
This member is currently offline Dejavu
Administrator


Member Level

Group: Administrators
Posts: 706
Joined: Jan 5, 2006

Go to the bottom of the page Go to the top of the page

how do you want the url to look finally?  something like yoursite.com/category/article-12.html ?
.........................
Directory Tracker
Article Distribution

Posted Jul 30, 2009, 10:15 pm
This member is currently offline Latona
Pool


Member Level

Group: Members
Posts: 579
Joined: Jul 16, 2006

Go to the bottom of the page Go to the top of the page

Dejavu said:
how do you want the url to look finally?  something like yoursite.com/category/article-12.html ?


From what I have seen, some people have the article_ID at the start of the url and some have it at the end... so maybe showing how to do it for both types would be the most effective way.

For example, ezinearticles.com includes the article ID at the end of the url title while helium.com includes the article_id at the start of the title. In the case of helium, the article_ID is used to display that article (even if the title is changed at a later date).

So, the 3 options that would cover everyones requests would likely be:

1. yoursite.com/category/article-title.html (the default option)
2. yoursite.com/category/article-title-12.html (article_id at end of title)
3. yoursite.com/category/12-article-title.html (article_is at the start of the title)

Posted Jul 31, 2009, 9:38 am
This member is currently offline Dejavu
Administrator


Member Level

Group: Administrators
Posts: 706
Joined: Jan 5, 2006

Go to the bottom of the page Go to the top of the page

Here is one way to do this (it will only work in the latest ArticleMS, and only apply to newly submitted articles)
Under settings, go to Article submission settings, and in the custom settings part (the bottom) paste the following code:
it will put the id at the end, but you can easily switch it to be at the start.

PHP:
if ($this->module == 'submit'){
  $q_id $this->db->fetch("SELECT MAX(article_id) AS max_id FROM {$this->pre}articles LIMIT 1");
  $Article->urltitle $Article->urltitle '-' . ($q_id['max_id'] + 1);
}
.........................
Directory Tracker
Article Distribution

Last edited Jul 31, 2009, 5:02 pm by Dejavu
Posted Jul 31, 2009, 5:02 pm
This member is currently offline articlefinder
Member


Member Level

Group: Members
Posts: 41
Joined: Jun 21, 2007

Go to the bottom of the page Go to the top of the page

--dejavu-- it works fine ;-)
Thank You for your help. - Now I will try to get my articles in Google News (maybe I will get more traffic)
I have still a few small problems with articletrader, but somehow I like the program

Posted Aug 1, 2009, 7:07 am
This member is currently offline pka5s
Newbie


Member Level

Group: Members
Posts: 21
Joined: Jun 7, 2008

Go to the bottom of the page Go to the top of the page

Thanks,
It works good enough for me
This code is so useful for some users with other languages.

Posted Aug 9, 2009, 5:21 am
Pages:<< prev 1 next >>

Nov 22, 2009, 3:36 pm

  

0.023s