PhpBB/Mambo Comments

This is where article comments will be kept.

Postby Bi4a » Fri May 20, 05 10:19am

well not really clear for me ;(

so my newsflashes id is 3

and i have 4 more categories

Global News - id is 1
Releases - id is 68
Artists - id is 69
Events - id is 70

i need to comment only on 4 above categories - not on newsflash (so id number 3 should be deleted from the list of comment items, or smth like this)
so what should i change to make it work?

should i change this line
Code: Select all
$itemidvar = mosGetParam ( $_REQUEST, 'Itemid', "");

to
Code: Select all
$itemidvar = mosGetParam ( $_REQUEST, 'Itemid', "1,68,69,70");
Bi4a
 

Postby Bi4a » Fri May 20, 05 10:35am

i was a bit wrong in the post above
here is the correct variant

Global News - id is 1 ; itemid is 47
Releases - id is 68 ; itemid is 42
Artists - id is 69 ; itemid is 43
Events - id is 70 ; itemid is 44

what should i change to make comments avai;lable only to these categories?
Bi4a
New
New
 
Posts: 9
Joined: Mon Nov 10, 08 3:31am

Postby Bi4a » Fri May 20, 05 10:47am

well i get it. but still doesn't work
here's my line
Code: Select all
if ( $optionvar == "com_content" && $idvar != 3 ) {


news flashid is 3 but it's still allowing to comment them

ps- sorry for spamming here :(
Bi4a
New
New
 
Posts: 9
Joined: Mon Nov 10, 08 3:31am

Postby Chris » Fri May 20, 05 3:28pm

I can't think right now, as I'm exhausted from work, but did you MosGetParam $idvar and $Itemidvar before the "if" line? I believe in the original code, the variable is filled after the "if" statement, so of course $idvar will not equal 3, because it's not equal to anything.

I'll look into this more in a few hours after a nap.
I'm the Chris Boylan who runs Chris Boylan dot com. So there.
User avatar
Chris
Site Admin
Site Admin
 
Posts: 312
Joined: Tue Nov 18, 03 1:56am
Location: Gillette, NJ

Postby Bi4a » Fri May 20, 05 5:00pm

so, here is my part of code
where and what should i change

Code: Select all
         // displays Table of Contents
         HTML_content::TOC( $row );
      $optionvar = mosGetParam( $_REQUEST, 'option', "" ); 
      if ( $optionvar == "com_content" && $Itemidvar != 3 ) {
      $itemidvar = mosGetParam ( $_REQUEST, 'Itemid', "");
      $idvar = mosGetParam ( $_REQUEST, 'id', "");
      $taskvar = mosGetParam ( $_REQUEST, 'task', "");
      $thread_id = GetMessage($row->id, 5, 62, "$row->title", "Прочитать статью на Сайте.".$row->text, 0, 62);

$commentcount = 0;
if ($thread_id = GetThread("$idvar")) {
$thread = phpbb_fetch_topics($thread_id);
$commentcount += ($thread?$thread[0]['topic_replies']:0);
}

$viewcomment = "".$commentcount . " Comments. View All Comment".($commentcount != 1?'s':'') . "";

$postcomment = "Post a comment";
$row->text = $row->text.$viewcomment.$postcomment;
         } else
      {
      }
Bi4a
New
New
 
Posts: 9
Joined: Mon Nov 10, 08 3:31am

Postby Chris » Fri May 20, 05 9:46pm

// displays Table of Contents
HTML_content::TOC( $row );
$optionvar = mosGetParam( $_REQUEST, 'option', "" );
$itemidvar = mosGetParam ( $_REQUEST, 'Itemid', "");
if ( $optionvar == "com_content" && $Itemidvar != 3 ) {
$idvar = mosGetParam ( $_REQUEST, 'id', "");
$taskvar = mosGetParam ( $_REQUEST, 'task', "");
$thread_id = GetMessage($row->id, 5, 62, "$row->title", "Прочитать статью на Сайте.".$row->text, 0, 62);

$commentcount = 0;
if ($thread_id = GetThread("$idvar")) {
$thread = phpbb_fetch_topics($thread_id);
$commentcount += ($thread?$thread[0]['topic_replies']:0);
}

$viewcomment = "".$commentcount . " Comments. View All Comment".($commentcount != 1?'s':'') . "";

$postcomment = "Post a comment";
$row->text = $row->text.$viewcomment.$postcomment;
} else
{
}

You have to move the bolded line above the if statement.

In order to evaluate if $Itemidvar is not equal to 3, you have to give $Itemidvar its value.

I did so after the if statement originally because that way it wouldn't have to do the work unless I wanted comments on the page. If you are putting comments on the page under the condition that one of the variables is or is not a certain value, you have to give the variable its value before you check it, or above the if statement.

Make sense?
I'm the Chris Boylan who runs Chris Boylan dot com. So there.
User avatar
Chris
Site Admin
Site Admin
 
Posts: 312
Joined: Tue Nov 18, 03 1:56am
Location: Gillette, NJ

Postby Bi4a » Sat May 21, 05 4:21pm

due to i know almost nothing about php I GODDAMN cannot get it :(
sorry, i try to understand - but seems like i can't

here's my code
can you show me one more time what to change ?

i'v added the line in bold into my code before if statement, but nothing works again ;/

// displays Table of Contents
HTML_content::TOC( $row );
$optionvar = mosGetParam( $_REQUEST, 'option', "" );
$itemidvar = mosGetParam ( $_REQUEST, 'Itemid', "");
if ( $optionvar == "com_content" && $Itemidvar != 3 ) {
$itemidvar = mosGetParam ( $_REQUEST, 'Itemid', "");
$idvar = mosGetParam ( $_REQUEST, 'id', "");
$taskvar = mosGetParam ( $_REQUEST, 'task', "");
$thread_id = GetMessage($row->id, 5, 62, "$row->title", "Прочитать статью на Сайте.".$row->text, 0, 62);

$commentcount = 0;
if ($thread_id = GetThread("$idvar")) {
$thread = phpbb_fetch_topics($thread_id);
$commentcount += ($thread?$thread[0]['topic_replies']:0);
}

$viewcomment = "".$commentcount . " Comments. View All Comment".($commentcount != 1?'s':'') . "";

$postcomment = "Post a comment";
$row->text = $row->text.$viewcomment.$postcomment;
} else
{
}
Bi4a
New
New
 
Posts: 9
Joined: Mon Nov 10, 08 3:31am

Postby Chris » Sat May 21, 05 6:58pm

I didn'd notice it the first time, but $itemidvar should not be capitalized.

It should be
Code: Select all
if ( $optionvar == "com_content" && $itemidvar != 3 ) {

and not
Code: Select all
if ( $optionvar == "com_content" && $Itemidvar != 3 ) {


The "i" should be lower case because before you ask the script about $Itemidvar, it is never declared. Only $itemidvar is declared.

Also, but unrelated, you can remove the second
Code: Select all
 $itemidvar = mosGetParam ( $_REQUEST, 'Itemid', "");

It will work if it's there, it's just redundant.

That should handle it.
I'm the Chris Boylan who runs Chris Boylan dot com. So there.
User avatar
Chris
Site Admin
Site Admin
 
Posts: 312
Joined: Tue Nov 18, 03 1:56am
Location: Gillette, NJ

Postby Bi4a » Sun May 22, 05 5:28pm

and again - changed the I not to be capitalised - and it's still allowing to comment newsflashes
here's my code :(

Code: Select all
// displays Table of Contents
HTML_content::TOC( $row );
$optionvar = mosGetParam( $_REQUEST, 'option', "" );
$itemidvar = mosGetParam ( $_REQUEST, 'Itemid', "");
if ( $optionvar == "com_content" && $itemidvar != 3 ) { 
      $idvar = mosGetParam ( $_REQUEST, 'id', "");
      $taskvar = mosGetParam ( $_REQUEST, 'task', "");
      $thread_id = GetMessage($row->id, 5, 62, "$row->title", "Прочитать статью на Сайте.".$row->text, 0, 62);

$commentcount = 0;
if ($thread_id = GetThread("$idvar")) {
$thread = phpbb_fetch_topics($thread_id);
$commentcount += ($thread?$thread[0]['topic_replies']:0);
}

$viewcomment = "".$commentcount . " Comments. View All Comment".($commentcount != 1?'s':'') . "";

$postcomment = "Post a comment";
$row->text = $row->text.$viewcomment.$postcomment;
         } else
      {
      }
Bi4a
New
New
 
Posts: 9
Joined: Mon Nov 10, 08 3:31am

Postby Chris » Sun May 22, 05 7:33pm

Can you give me the URL of your site? If I poke around, it might help me figure out why this isn't working.

Also, do you want comment links in the little newsflash box or just when you pull up the newsflash as its own page?
I'm the Chris Boylan who runs Chris Boylan dot com. So there.
User avatar
Chris
Site Admin
Site Admin
 
Posts: 312
Joined: Tue Nov 18, 03 1:56am
Location: Gillette, NJ

Postby Bi4a » Thu May 26, 05 4:44am

here's the url to my site
www.tranceaddict.lv

as you see on frontpage there are no signs of your comments even beyond newsflash. It's ok
but when you push the read more button under each news (http://www.tranceaddict.lv/index.php?op ... 6&Itemid=1) you see 0 Comments. View All Comments
Post a comment
buttons appears not only at the bottom of the news but also at the bottom of newsflash. i don't need that.
hope you can fix that
thanks ahead
Bi4a
New
New
 
Posts: 9
Joined: Mon Nov 10, 08 3:31am

Postby Chris » Thu May 26, 05 7:48pm

Before I investigate further, I just wanted to give you a heads up - when i tried to register for your forum, I got this error:
Code: Select all
Error geting users post stat

DEBUG MODE

SQL Error : 1054 Unknown column 'u.user_id' in 'where clause'

SELECT ug.user_id, g.group_id as g_id, g.group_name , u.user_posts, g.group_count FROM phpbb_groups g, mos_users u LEFT JOIN phpbb_user_group ug ON g.group_id=ug.group_id AND ug.user_id=250 WHERE u.user_id=250 AND ug.user_id is NULL AND g.group_count=0 AND g.group_single_user=0 AND g.group_moderator250

Line : 645
File : /export/storage1/hooligan/tranceaddict
/www/components/com_forum/includes/usercp_register.php


I believe this is because u.user_id is suppoesd to be u.id - If I am correct, in the tim-online.nl Mambo/PhpBB component, all calls and MySQL queries for the user id # are to the Mambo named "id" and not the PhpBB named "user_id".

Just a heads up. I'm looking for an answer to the other question now.

P.S. My login now works, however.
Last edited by Chris on Thu Oct 20, 05 1:52am, edited 1 time in total.
I'm the Chris Boylan who runs Chris Boylan dot com. So there.
User avatar
Chris
Site Admin
Site Admin
 
Posts: 312
Joined: Tue Nov 18, 03 1:56am
Location: Gillette, NJ

Postby Chris » Thu May 26, 05 8:56pm

Alright, so this doesn't work the way it should when the task is blogcategory. I'll have to rewrite a portion of it, which won't happen until early next week. I don't have any content viewed in blogcategory, so I had no idea until now.

Also, there appears to be a few errors in your forum, not just in the registration page. When I click on a link, all hell breaks loose, but I can still read the thread.
I'm the Chris Boylan who runs Chris Boylan dot com. So there.
User avatar
Chris
Site Admin
Site Admin
 
Posts: 312
Joined: Tue Nov 18, 03 1:56am
Location: Gillette, NJ

Postby Bi4a » Fri May 27, 05 4:56am

well thanks for the tips, i'll correct them. i aften make modifications to my board, so maybe i forgot to change a part o f the code (change to u.id) thanks for that. and what about the link? which link do you click on?
Bi4a
New
New
 
Posts: 9
Joined: Mon Nov 10, 08 3:31am

Postby Bi4a » Mon May 30, 05 6:40am

Chris wrote:Alright, so this doesn't work the way it should when the task is blogcategory. I'll have to rewrite a portion of it, which won't happen until early next week. I don't have any content viewed in blogcategory, so I had no idea until now.


Okey. i'll wait for that!
Bi4a
New
New
 
Posts: 9
Joined: Mon Nov 10, 08 3:31am

PreviousNext

Return to Comments for Chris Boylan .com articles

Who is online

Users browsing this forum: No registered users and 0 guests

cron