Navigation

Pligg Support

I created a free module (total_story_views) for pligg CMS to show the number of story views in the line under the story title right after the time published. it has two callbacks to functions in the module:
1. To add the story ID to a newly created table “story_views”, every time a story is viewed.
2. To get the total views of each story from the “Story_views” table to print in the story summary.

The module (total_story_views) includes the following files (attached in a zip file):
1. total_story_views_init.php, where the pages to include are listed and the module_add_action to answer the callbacks, and module_add_action_tpl to display the result of the callbacks.
2. total_story_views_install.php (information about the module)
3. total_story_views_main.php, where the two callback functions reside.
4. total_story_views_settings.php (settings of the paths to the location of the module, the template folder and language files)
5. Language file. I made sure that language files are detected automatically by the config file, because I named them lang_english, lang_french, etc. and the define statement picks up the file according to the language chosen during installation or even when it is changed back and forth.

define('total_story_views_lang_conf', "/modules/total_story_views/lang_" . pligg_language . ".conf");

I tested it many times and here is the result:
• The callback from the story.php file to insert the ID in the story_view table is working
• The callback to get the total views of each story ID from the story_views table is partially working:
i. It gets the totals (I echoed them within the function to check)
ii. However, it is not inserting the $main_smarty variable in the template file at all. I tried every possible solution and process of elimination to pin point why but to no avail!

The table creation, callback placements, changes to the link_summary.tpl and defining the table are explained in the readme file within the zipped module.

Could anyone shed a light on this problem? Thank you in advance!

Possible Answers

    The one in this post does not work.

    Get the good module from Chuckroast

    http://pligg.com/downloads/module/story-counter/

    | Posted 34 days ago | Permalink | Hide Replies

    i'm checked with two versions. but can not work

    | Posted 34 days ago | Permalink | Hide Replies

Who Upvoted this Story

Pligg.com's Support area is where you can ask questions and get answers. Just getting started with the Support area? This section describes tips for participating.

Submitting a Question or Comment

By taking a minute to research previous posts you may receive an answer much faster than waiting for a response to a new question. Begin by searching the support section for an answer. Sometimes you may even want to extend your search to the entire pligg.com domain.

If you are unable to find a relevant answer, submit a new question or comment here. Please provide a detailed description and, when necessary, debugging information such as your server environment (a link to a <?php phypinfo(); ?> .php page would be very helpful), your web browser, and any steps necessary to reproduce your issue.

Submitting an Answer

If you have an answer or useful response that you would like to add to a post, you can submit it as a comment which other users will then vote on. Answers are sorted by most popular to least, allowing the best information to climb to the top of the page.

Please read and vote for existing answers before submitting your own, as there may already be an acceptable answer provided. You can use the "Reply" link found within an answer to submit a response to it, in case you want to expand or comment on someone else's contribution.

Including Files or Code

Sometimes it is necessary for you to attach a file or include a snippet of code for others to reference in your response. In most cases, you can .zip up files and attach them to a question or answer using Pligg's file manager. At times though this may fail, and in these circumstances we recommend using a third party host. Below we are including a list of recommended websites where you can share easily share file uploads (or snippets of code) through the web.