TinyPortal

Development => Support => Topic started by: DonaldDasher on September 15, 2008, 06:33:32 PM

Title: Article Page Numbers question
Post by: DonaldDasher on September 15, 2008, 06:33:32 PM
Is it possible to re-number article pages? A number of pages simply don't exist and it would be really nice to be able to re-number articles to fill in the gaps.
Title: Re: Article Page Numbers question
Post by: G6Cad on September 15, 2008, 06:42:36 PM
At this time no, the article get a number in the DB and that is stuck with it. If you remove an article, that number will still be marked as used and not filled with another article.

Im not sure if it's possible to make some sort of dc call to make what you need, have to let IchBin or Bloc answer that one.
But the option you ask for is not available as it is now.
Title: Re: Article Page Numbers question
Post by: Ianedres on September 15, 2008, 07:16:37 PM
If you were to renumber the articles, then any pages with hard-coded links (my personal site uses quite a few) would require site-wide updating to the new numbers.

While it would be an moderate undertaking (solely speaking within the TP system), it would wreak havoc to such navigational link menus (outside of TP), and might would affect search engine results also.
Title: Re: Article Page Numbers question
Post by: DonaldDasher on September 15, 2008, 07:19:45 PM
I only have two articles so far, and there numbers are page=7 and 8. I'd like the first article page to be numbered 1, which I feel would make more sense.
Title: Re: Article Page Numbers question
Post by: Ianedres on September 15, 2008, 07:25:15 PM
Why not use the query title option and name (versus numbering) the article?

Your site can refer to it by 'page=info' instead of 'page=7'...

That way, you can have a permanent link by name for such articles. After a while, you may have over 300+ articles and numbers won't be easily to remember, whereas names such as 'info', 'contact', and so forth will.
Title: Re: Article Page Numbers question
Post by: DonaldDasher on September 15, 2008, 07:30:34 PM
Thanks, that sounds perfect - I wasn't aware I could do this - Is this option in the article's settings?
Title: Re: Article Page Numbers question
Post by: Ken. on September 15, 2008, 07:53:23 PM
When you build or edit your article look for "Query title:" directly under your "Title"
Title: Re: Article Page Numbers question
Post by: Ianedres on September 15, 2008, 07:53:34 PM
The query title will appear below the article's title, but only after you save the article first.

Don't use spaces, as this may cause problems in browsers and/or search engines. I substitute the underscore for spaces when naming the query title.

Good luck with TinyPortal! It is the small features like this one that makes it so flexible.
Title: Re: Article Page Numbers question
Post by: DonaldDasher on September 15, 2008, 07:56:29 PM
Thanks guys. I'm liking SMF/TP more and more.

Another I site I am in the process of building uses vBulletin and vbDrupal. It's interesting comparing the two.
Title: Re: Article Page Numbers question
Post by: DonaldDasher on September 15, 2008, 08:13:26 PM
I've now re-named the articles, but an  "articles" block (http://www.tinyportal.net/index.php/topic,26017.msg208172.html#msg208172) I created still uses the old numbering. Can this be fixed?
Title: Re: Article Page Numbers question
Post by: Ianedres on September 15, 2008, 08:26:03 PM
With full credit to JPDeni... I modified that code to link using the query title; if not set, it will use the page id.

global $db_prefix, $scripturl, $user_info;

$query = db_query(
    "SELECT subject, id, date, shortname
     FROM {$db_prefix}tp_articles
     WHERE approved = 1
     ORDER BY date DESC
     LIMIT 10", __FILE__, __LINE__);

while ($row = mysql_fetch_assoc($query))
{
  if(empty($row['shortname'])) $row['shortname'] = $row['id'];

  echo '<a href="' . $scripturl . '?page=' . $row['shortname'] . '">' . $row['subject'] . '</a> ' . timeformat($row['date'], $user_info['time_format']) . '<br />';
}
Title: Re: Article Page Numbers question
Post by: DonaldDasher on September 15, 2008, 08:28:29 PM
You are a true gent! ;)
Title: Re: Article Page Numbers question
Post by: Ianedres on September 15, 2008, 08:52:53 PM
Trying to earn my badge here on TP...  ;)

Glad you're liking TP. You should be able to see the power and flexibility that it has already, plus, I like to think, a great support staff too.

Again, good luck with TP.
Title: Re: Article Page Numbers question
Post by: DonaldDasher on September 15, 2008, 08:55:52 PM
I was saying just now to the guy I run my site with what excellent and super fast support you guys offer. :)
Title: Re: Article Page Numbers question
Post by: Ianedres on September 15, 2008, 09:01:44 PM
Well, there are times when replies don't come so fast, as we all volunteer our time and have real-life factors to account for...

But thanks for letting others know about TP and the support you've received.  :D
Title: Re: Article Page Numbers question
Post by: DonaldDasher on September 15, 2008, 09:03:46 PM
My pleasure. I've learned a lot in the few weeks I've been posting here.
Title: Re: Article Page Numbers question
Post by: JPDeni on September 15, 2008, 10:54:42 PM
Oops. I guess I didn't read the second page. I changed the code over in the original topic.