Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-18-2008, 09:12 AM
Banned
Pligg Version: 9.8.
Pligg Template: Custom
 
Join Date: Feb 2007
Location: Canada
Posts: 849
Thanks: 74
Thanked 49 Times in 45 Posts
Source URL count

Ok, what I am trying to do is display a number next to the url of each story, the number will indicate the number of entries that have been submitted from that particular base URL.

For example, if www.domain.com has 6 things submitted:
www.domain.com/post1
www.domain.com/post2
www.domain.com/post3
www.domain.com/post4
www.domain.com/post5
www.domain.com/post6

I want to display a number next to the www.domain.com (6 entries) like this.

I have come with an sql query:

Code:
SELECT count(*) as cnt, link_url from pligg_links GROUP BY link_url
I then attempted to add this to libs/smartyvariables.php:

Code:
// link count
$urlcount = $db->get_results('SELECT count(*) as cnt, link_url from pligg_links' . ' GROUP BY link_url ');
$main_smarty->assign('urlcount', $urlcount);
then in link_summary.tpl:

Code:
{if $pagename eq "story"}

{if $url_short eq "http://" OR $url_short eq "://" OR $url_short eq "1"}
{$title_short}
{else}
<a href="{$story_url}">{$title_short}{
$urlcount
}</a>

{/if}

{else}
<a href="{$story_url}" onclick="sendClickedValue({$link_id},{$link_shakebox_index});">{$title_short}</a>
{/if}
{/if}
but nothing shows up. Obviously ihave missed something.

In phpMyAdmin, after I run the query I get:



Perhaps between all of us we can get this working.

Geoserv.
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 10:53 AM
Constant Pligger
Pligg Version: 9.9
Pligg Template: yget mod
 
Join Date: Oct 2007
Posts: 199
Thanks: 4
Thanked 3 Times in 2 Posts
interesting
__________________
www.cubaleo.net
Reply With Quote
  #3 (permalink)  
Old 04-20-2008, 05:09 PM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,071
Thanks: 53
Thanked 25 Times in 23 Posts
It would be great to use this numbers for some sort of source tag could.
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
[Mod] Category Count - Final Geoserv Modification Tutorials 24 04-21-2008 09:10 PM
Packt Publishing Open Source CMS 2007 Winners Yankidank Off-topic 1 11-03-2007 06:50 AM
Licensing tbronson Wiki Articles 0 10-27-2007 11:55 PM
Count Out Hits canadaka Modification Tutorials 6 04-03-2007 07:27 PM
Pligg seems to break source links with ampersands jackdaw Bug Report 4 04-25-2006 05:32 AM


Search Engine Friendly URLs by vBSEO 3.2.0