https://www.icyphoenix.com/viewtopic.php?f=35&t=1260
-----------------------------------
danicom
Mon 05 Mar, 2007 19:54

Error In News Counter
-----------------------------------
Hi, I have found a error in the news counter.
If you go to portal (in this site 4 ex.) and you read one news
http://www.icyphoenix.com/index.php?topic_id=1210
And the  counter have 244 views, if you reload the same page the counter don't change.
Or if you arrive directly to this link
http://www.icyphoenix.com/index.php?topic_id=1210
the views counter remains equal, but if you go to this link
http://www.icyphoenix.com/viewtopic.php?t=1210
(Basically its the same post, but not in portal) your view it's added to the counter.
The views counter don't work correctly. The problem it's the same for XS o Icy.
In my portal, for example, I use the option for show only, in portal, a maximum number of words, and you need click over "Read more" to read the entire article. And I receive many visits directly to the portal, and my visitors use the option read more, I have therefore false data in the views counter.

Thnks.
Daniel Comin
http://zm.nu
http://zm.nu/foro2

Running XS & pending upgrade to Ici


-----------------------------------
Mighty Gorgon
Thu 08 Mar, 2007 01:59

Re: Error In News Counter
-----------------------------------
The counter it is linked only to the viewtopic, not even to the news shown in portal... I don't think it is a bug, because I would consider a topic as viewed only when you can see the whole discussion... :roll:


-----------------------------------
Zuker
Thu 08 Mar, 2007 13:52

Re: Error In News Counter
-----------------------------------
:mricy: there is no bug


-----------------------------------
danicom
Thu 08 Mar, 2007 15:53

Re: Error In News Counter
-----------------------------------
[quote user="Mighty Gorgon" post="9732"]The counter it is linked only to the viewtopic, not even to the news shown in portal... I don't think it is a bug, because I would consider a topic as viewed only when you can see the whole discussion... :roll:[/quote]
Much people read the news in the portal, even the commentaries, are not obligatory to respond.
Under this link of course http://zm.nu/foro2/index.php?topic_id=1403
If I have the option to cut the news for show the complete article inside the portal the counter must contemplate those readings.
Two options for show the same news, one counter.


-----------------------------------
Mighty Gorgon
Sun 11 Mar, 2007 12:24

Re: Error In News Counter
-----------------------------------
[quote user="danicom" post="9769"][quote user="Mighty Gorgon" post="9732"]The counter it is linked only to the viewtopic, not even to the news shown in portal... I don't think it is a bug, because I would consider a topic as viewed only when you can see the whole discussion... :roll:[/quote]
Much people read the news in the portal, even the commentaries, are not obligatory to respond.
Under this link of course http://zm.nu/foro2/index.php?topic_id=1403
If I have the option to cut the news for show the complete article inside the portal the counter must contemplate those readings.
Two options for show the same news, one counter.[/quote]
Ok, when I have some free time I'll help you integrating this in portal.


-----------------------------------
danicom
Mon 12 Mar, 2007 17:50

Re: Error In News Counter
-----------------------------------
Ok Tnkks


-----------------------------------
Proclama
Thu 29 Mar, 2007 11:58

Re: Error In News Counter
-----------------------------------
Hi,
I try to work on this features but I'm not so expert with PHP…


So I do this work-around:

In file:  ./include/news.php
at line: 166

I replace the code with this:

[code linenumbers=false]//'READ_MORE_LINK' => ($show_abstract && $trimmed) ? '<a href="' . $this->config['news_base_url'] . PORTAL_MG . '?topic_id=' . $article['topic_id'] . '">' . $lang['Read_More'] . '</a>' : '',
'READ_MORE_LINK' => ($show_abstract && $trimmed) ? '<a href="' . $this->config['news_base_url'] . VIEWTOPIC_MG . '?t=' . $article['topic_id'] . '">' . $lang['Read_More'] . '</a>' : '',[/code]


So the link "READ_MORE_LINK" open the post in the forum (viewpost.php?t=XXX) instead the portal news (index.php?topic_id=XXX).

Is not the same but is a quickly temporary workaround...


If someone can tell me which is the code that increase the counter in the topic and which is the code to modify for the news, I try to work on this…


Thanks and sorry for my bad english,
Stefano.



[EDIT][color=red][b]Dimenticavo... se volete controllare sul sito in firma ho introdotto questa feature[/b][/color][/EDIT]


-----------------------------------
danicom
Thu 29 Mar, 2007 12:37

Re: Error In News Counter
-----------------------------------
Thnk you very much Proclama,
It's a  temporary solution. In Minerva this problem does not exist, I go to look inside Minerva to discover the posible solution. 

Thnks 
Daniel


-----------------------------------
danicom
Tue 31 Jul, 2007 09:50

Re: Error In News Counter
-----------------------------------
Any new?


-----------------------------------
danicom
Tue 25 Sep, 2007 12:08

Re: Error In News Counter
-----------------------------------
I MG, you have some free time?
I wait your news, or your indications, if you don't have more time, I need only the minimal instructions to start.
Thnks
Daniel


-----------------------------------
Mighty Gorgon
Tue 23 Oct, 2007 23:29

Re: Error In News Counter
-----------------------------------
Sorry, I totally forgot this.

You can do something like this:

[codeblock]if (!empty($_GET['topic_id']) && (intval($_GET['topic_id']) > 0))
{
	$topic_id_v = $_GET['topic_id'];
	$sql = "UPDATE " . TOPICS_TABLE . "
		SET topic_views = topic_views + 1
		WHERE topic_id = $topic_id_v";
	if ( !$db->sql_query($sql) )
	{
		message_die(GENERAL_ERROR, "Could not update topic views.", '', __LINE__, __FILE__, $sql);
	}
}[/codeblock]

And add it everywhere to your page_header.php.

Let me know if it is working fine.


-----------------------------------
danicom
Thu 25 Oct, 2007 19:12

Re: Error In News Counter
-----------------------------------
[size=14] [align=center]:thanks:  :thanks:  :thanks:  :thanks:  :thanks:
 :mryellow:  :mryellow:  :mryellow:
 Great!!!!
Thats works fine[/align]
Thnks[/size]


