Jump to content


Subcategories for the Reviews


12 replies to this topic

#1 byoskop

  • Members
  • 17 posts
  • Germany

Posted 14 December 2005 - 01:48 PM

It is a mod for the Reviews Modul, after adding of these files, it is possible to make subcategories in the Reviews modules. The installation and to create subcategories is very easy. It works fine, but i have there two problems.
The first one is, when you go on the Revies index.php page, then you can see, that the last entry, everywhere is the same. But under the maincategory, the last Entries are works fine. I don't know why???
Here you can see it:
Reviews Mainpage
The other problem, i think it will be the same, but it is on the Site Stats Block on the Index.php of the mkportal. It will not count all the reviews which i wrote. And also i don't know why?

I have not wrote these mod, it had make a good friend, but he is in the last time ill, and i can not ask him, because his problem is very strange.

There are also 3 PHP files, and these files must only overwrite.
index.php and tpl_reviews.php in the modules/ reviews folder
and the ad_reviews.php in the admin folder

I hope here can anyone help me

Thanks a lot

#2 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 16 December 2005 - 11:59 AM

There are many problems with the modification code. I will not have time to troubleshoot this until Monday. Categories are very complicated and it will take me some time because I am no php expert.

I can see immediately that this code is bad...
  if (!$lastentry)
	  $lastentry = $entry['title'];
  if(!$lastentry) {
	  if ($count >0)
	$lastentry = $entry2['name'];
  }
And this code is meaningless...
if (!$count==0){
	$entry2 = $DB->fetch_row($query2);
	if ($entry2['id']>$maxid){
		$lastentry = $entry2['title'];
		$maxid = $entry2['id'];
	}
	unset($entry2);
	  }
$maxid is not going to work. Categories do not work that way in MKPortal.


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#3 byoskop

  • Members
  • 17 posts
  • Germany

Posted 17 December 2005 - 06:59 AM

Hi Visible,
Thanks for your help. It is good to know you ;-)
Well you have time how much you need.
Thank you very much!!!

#4 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 31 January 2006 - 02:47 AM

Edit July 7, 2006-

NOTE TO READERS: Please note that the instructions posted below are not a complete hack. They are actually a "hack of a hack". byoskop provided me with additional code which I do not now have a copy of. Please do not try to install this hack It really only helps byoskop.
-------------------------------


OK byoskop, I think I have the correct code...

You need to start over with a new mkportal/modules/reviews/index.php. You are using an old M1.0 file. You need to start over with a M1.1 Rc1 file since that is the version of MKPortal you are using.


FIND (in function reviews_show):
	$query = $DB->query( "SELECT id FROM mkp_reviews_sections");
REPLACE WITH:
	//$query = $DB->query( "SELECT id FROM mkp_reviews_sections");
	//Subcats hack
	$query = $DB->query( "SELECT id FROM mkp_reviews_sections WHERE father = '0'");
FIND:
	$query = $DB->query( "SELECT id, title, description, position FROM mkp_reviews_sections  $order LIMIT $start, $per_page");
REPLACE WITH:
	//$query = $DB->query( "SELECT id, title, description, position FROM mkp_reviews_sections  $order LIMIT $start, $per_page");
	//Subcats hack
	$query = $DB->query( "SELECT id, title, description, position FROM mkp_reviews_sections WHERE father = '0' $order LIMIT $start, $per_page");
FIND:
		$query1 = $DB->query("SELECT title FROM mkp_reviews where id_cat = '$idevento' and validate = '1' ORDER BY `id` DESC");
ADD ABOVE:
		//Subcats hack
		$query1 = $DB->query("SELECT id FROM mkp_reviews_sections WHERE father = '$idevento' ORDER BY `id`");
		$countsub = $DB->get_num_rows($query1);
		while( $row1 = $DB->fetch_row($query1) ) {
			$idce = $row1['id'];
			$query2 = $DB->query("SELECT id, title FROM mkp_reviews where id_cat = '$idce' AND validate = '1' ORDER BY `id` DESC");
			$count = $count + $DB->get_num_rows($query2);
			$entry2 = $DB->fetch_row($query2);
		}
		//end Subcats Hack
FIND:
		$lastentry = $entry['title'];
ADD BELOW:
		//Subcats hack
		if(!$lastentry) {
			$lastentry = $entry2['name'];
		}
FIND:
		$content .= $this->tpl->row_main_category_content($name, $descrizione, $count, $lastentry, $link);
REPLACE WITH:
		//$content .= $this->tpl->row_main_category_content($name, $descrizione, $count, $lastentry, $link);
		//Subcats hack
		$content .= $this->tpl->row_main_category_content($name, $descrizione, $count, $lastentry, $link, $countsub);
FIND (in function section_view):
		$navbar .= "-><a href="#">$even</a>";
		  $maintit = $even;
REPLACE WITH:
		//Subcats Hack
		$navfather = $this->retrieve_father($idev);
		if($navfather[1]) {
			$navbar .= "-><a href="index.php?ind=downloads&op=section_view&idev=$navfather[0]">$navfather[1]</a>";
		}
		//end Subcats hack

		$navbar .= "-><a href="#">$even</a>";
		  $maintit = $even;

		//Subcats Hack
		$query = $DB->query("SELECT id, title, description, position FROM mkp_reviews_sections WHERE father = '$idev'  ORDER by 'position'");
		$cecksub = mysql_num_rows ($query);
		if($cecksub) {
			$content = $this->tpl->row_main_category();
			while( $row = $DB->fetch_row($query) ) {
			$idevento = $row['id'];
			$query1 = $DB->query("SELECT id FROM mkp_reviews_sections WHERE father = '$idevento'");
			$countsub = $DB->get_num_rows($query1);
			$evento = $row['title'];
			$descrizione = $row['description'];
			$query1 = $DB->query("SELECT title FROM mkp_reviews where id_cat = $idevento AND validate = '1' ORDER BY `id` DESC");
			$entry = $DB->fetch_row($query1);
			$lastentry = $entry['title'];
			$count = $DB->get_num_rows($query1);
			$name ="<a href="index.php?ind=reviews&op=section_view&idev=$idevento">$evento</a>";
			$link = "<a href="index.php?ind=reviews&op=section_view&idev=$idevento"><img src="$mklib->images/category.gif" border="0" alt="" /></a>";
			$content .= $this->tpl->row_main_category_content($name, $descrizione, $count, $lastentry, $link, $countsub);
			}
		}
		//end Subcats hack
FIND (in function edit_file):
			<td>{$mklib->lang['re_section']}</td>
ADD BELOW:
			<td>{$mklib->lang['re_subcat']}</td>
FIND (in function row_select_event):
			$query = $DB->query( "SELECT id, title FROM mkp_reviews_sections ORDER BY `id` DESC");
			while( $row = $DB->fetch_row($query) ) {
				$idevento = $row['id'];
				$evento = $row['title'];
				$cselect.= "<option value="$idevento">$evento</option>n";
				$cselects.= "<option value="$idevento">$evento</option>n";
REPLACE WITH:
			//$query = $DB->query( "SELECT id, title FROM mkp_reviews_sections ORDER BY `id` DESC");
			//Subcats hack
			$query = $DB->query( "SELECT id, title, father FROM mkp_reviews_sections ORDER BY `id`");
			while( $row = $DB->fetch_row($query) ) {
				$idevento = $row['id'];
				$evento = $row['title'];
				//$cselect.= "<option value="$idevento">$evento</option>n";
				//$cselects.= "<option value="$idevento">$evento</option>n";

				//Subcats hack
				$father = $row['father'];
				if(!$listall[$idevento]) {
					$cselect.= "<option value="$idevento">$evento</option>n";
				}
				$listall[$idevento] = 1;
				$query1 = $DB->query( "SELECT id, title, father FROM mkp_reviews_sections where father = '$idevento' ORDER BY `id`");
				while( $row2 = mysql_fetch_array($query1) ) {
					$idevento = $row2['id'];
					$evento = $row2['title'];
					if(!$listall[$idevento]) {
						$cselect.= "<option value="$idevento">- $evento</option>n";
					}
					$listall[$idevento] = 1;
				}
				//end Subcats hack
Hopefully that will fix the issues for you

-=DKC=-.


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#5 byoskop

  • Members
  • 17 posts
  • Germany

Posted 01 February 2006 - 10:45 AM

Hi visible,
I have tested your modified hack and i can say only that it works GREAT!!!
I have not find a mistake. He counted also normaly and the last entry's are wright.
Thank you very, very much for your help. For me, here is the best support ever of IPB and mkportal!!!

I have also another new ideas, but, i will come with them another time, i hope you have not so much complication about the hack?


Thanks a lot & Best wishes

b

#6 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 01 February 2006 - 12:27 PM

byoskop said:

Hi visible,
I have tested your modified hack and i can say only that it works GREAT!!!
I have not find a mistake. He counted also normaly and the last entry's are wright.
Thank you very, very much for your help. For me, here is the best support ever of IPB and mkportal!!!

I have also another new ideas, but, i will come with them another time, i hope you have not so much complication about the hack?


Thanks a lot & Best wishes

b
I am happy it works for you. Honestly, your friend did a good job coding the hack. I used most of his code. The main change was to the section that I said was bad in my earlier post.


Does the Site Stats Block work now? I think the problem with Site Stats was that the way stats are counted changed from M1.0 to M1.1.

-=DKC=-


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#7 byoskop

  • Members
  • 17 posts
  • Germany

Posted 04 February 2006 - 07:02 AM

hi visible
Sorry for my late answer.
Yes, the Site Stats Block works with the review section without mistakes.
After adding a new review, the counter has take the right number.
Thank you very much

cu

b

#8 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 04 February 2006 - 12:06 PM

byoskop said:

Yes, the Site Stats Block works with the review section without mistakes.
After adding a new review, the counter has take the right number.
Great. Thanks for the reply. B)


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#9 draghetto

  • Members
  • 6 posts

Posted 15 April 2006 - 09:16 PM

i have a error with mkportal 1.1 rc1

ERROR: Database error.
Cannot execute the query: SELECT id FROM mkp_reviews_sections WHERE father = '0'
MySql Error returned: Unknown column 'father' in 'where clause'
MySql Error code: 1054


Why??

#10 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 17 April 2006 - 09:28 AM

Sorry draghetto, I was helping byoskop fix an existing hack on this topic. The hack included database queries but I do not have the complete hack code or queries.

If I still have the hack installed on my test board I will try to post the database queries later.


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard

#11 draghetto

  • Members
  • 6 posts

Posted 17 April 2006 - 10:11 AM

visiblesoul said:

Sorry draghetto, I was helping byoskop fix an existing hack on this topic. The hack included database queries but I do not have the complete hack code or queries.

If I still have the hack installed on my test board I will try to post the database queries later.
ok, thank you :(....

#12 golgoth

  • Members
  • 4 posts

Posted 06 July 2006 - 03:21 AM

I have the same "father" problem here :D

Any hint?

#13 visiblesoul

  • Administrators
  • 551 posts
  • Location:Earth
  • Texas

Posted 06 July 2006 - 09:00 AM

golgoth said:

I have the same "father" problem here :D

Any hint?
Hello golgoth-

It would be best if you begin a new topic and describe your issue in detail. I will help if I can.

-=DKC=-


Please note that I offer free support on this forum in my free time. Depending on how much work I have backlogged it may take me a week or more to answer questions. I am not ignoring you. I answer everyone but please be patient. Thanks.

Disclaimer: All forum posts, including code examples, on this forum are offered for free in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Use code examples at your own risk.

"If at first you don't succeed, keep on suckin' til you do succeed." -Curly Howard





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users