HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Items a member has downloaded

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#65474 (In Topic #14042)
Avatar

Community saint

I'm creating a theme for a site based on downloads.

On the main site page, if it's at all possible, I would like to have (if the user is logged in) a text stating something on the lines of xx items I've downloaded. xx of course would be the total number of downloads they've accessed. Then I would like to have I've downloaded a link to what they have downloaded.

If anyone can help me script this, I would be grateful. :wub:

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#65557
Avatar

Community saint

I found the section that I would like for the I've downloaded link. All I need to know is how to implement the below into a separate page all on its own so the member can see what they already downloaded.

Located: /site/index.php?page=points&type=member&id=##

Points spent

Member has spent 40 points on the following purchases:

Sort by, Smallest first Date Sort by, Largest firstSort by, Smallest first Amount Sort by, Largest firstFromToReason
Tue 2:41 AM20Downloads SubmitterMemberDownloaded item 1
Tue 1:46 AM20Downloads SubmitterMemberDownloaded item 2


Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#65558
Avatar

There's no feature for this right now.
But if you make a sources_custom/miniblocks/whatever.php:

Code

echo number_format($GLOBALS['SITE_DB']->query_value('download_logging','COUNT(*)',array('the_user'=>get_member())));
and then use that whatever block, it should work.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#65565
Avatar

Community saint

Thanks Chris. That worked perfect so the member can see the count of how many downloads they accessed.

For now, maybe just creating a link to their points page will do also…

However…

I noticed only admins can see the "Points Spent". Is there a way in the POINTS_SCREEN.tpl to allow the members to also see what they downloaded?

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#65566
Avatar

There's a permission, view_charge_log. But actually I notice now people can't see their own charge log without that permission, we'll get that changed.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#65569
Avatar

Community saint

Got it. Thanks again.  :thumbs:

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#65846
Avatar

Community saint

Chris,

Is there a way to call this block in a .tpl file? I want to use it in my HEADER.tpl

Chris Graham said

There's no feature for this right now.
But if you make a sources_custom/miniblocks/whatever.php:

Code

echo number_format($GLOBALS['SITE_DB']->query_value('download_logging','COUNT(*)',array('the_user'=>get_member())));
and then use that whatever block, it should work.

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#65847
Avatar

Community saint

I tried this:

Code

{$BLOCK,block=downloads_count}

downloads_count is the name of block

But, it just shows the whole code in the I put it. :(

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#65848
Avatar

Interesting it worked at all. You need to put "<?php" at the start of the file.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#65869
Avatar

Community saint

What a bad blonde (or brunette) moment… I actually originally had the "<?php" statement. That's how it worked before when I tested it through comcode. Not sure when or why I got rid of it. All working good now. Thanks!

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#65870
Avatar

Community saint

May be a dumb question, but what's the link to one's own points profile? …

i.e. - "/site/index.php?page=points&type=member&id=##"

I want to add a link in the header.tpl so when someone clicks on it, they go to their own respective points page.

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#65873
Avatar

{$PAGE_LINK,site:points:member:id:{$USER}}


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#65884
Avatar

Community saint

Chris,

For some reason it is trying to send me to:

/site/index.php?page=points&type=member&id=id

The last id isn't showing up as the member's.

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#65886
Avatar

Whoops, remove "id:" from what I wrote.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#65903
Avatar

Community saint

This was a go! Thank you. Works great now!  :thumbs:

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: