1
kiwian
Need some help in patching MyReviews module
  • 2009/1/10 11:35

  • kiwian

  • Just popping in

  • Posts: 3

  • Since: 2008/11/15


Hi Friends, Happy New Year !!!

I need some guidance in patching the layout and appeal of following 2 pages in MyReviews Module.


a) index.php &
b) viewcat.php

How can i change the font color of the the count shown inside brackets.

As in the example shown in picture attached below, i want the display of posting counting to be like (43)instead of (43)

I guess for index.php file, we need to change the following line

href="".XOOPS_URL."/modules/myReviews/viewcat.php?cid=".$myrow['cid'].""><b>$title</b></a>&nbsp;($totaldownload)<br>";


When i tried to change
($totaldownload)
to
(<font color 'red'>$totaldownload</font>)
i am getting an error.

can some one tell me how to fix this. Thanking you everyone in advance.


Resized Image

2
stefan88
Re: Need some help in patching MyReviews module
  • 2009/1/10 12:53

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


Hi,

what version of the module is that?

how about:

Quote:
echo"<a href=\"".XOOPS_URL."/modules/myReviews/viewcat.php?cid=".$myrow['cid']."\"><b>".$title."</b></a>&nbsp;(<font color = \"red\">".$totaldownload."</font>)<br />";
..

3
kiwian
Re: Need some help in patching MyReviews module
  • 2009/1/11 7:00

  • kiwian

  • Just popping in

  • Posts: 3

  • Since: 2008/11/15


Hi stefan88 , Thanks a lot for your timely and quick reply. It did work perfect.

The version of MyReview is 2.19 and runnin on XOOPS 2.3.2b

The myReviews module i use as in the picture above is same version ,but slightly modified to display subcategories in 2 columns and to display upto 25 subcategories in index page.

Here is a picture of the new result (with color changes to post count). Hi Stefan88, can u tell me is there a way i can add count of subcategory total in main (as shown in the blue font in the picture below).

I tried changing the following lines of viewcat.php

echo "<table width='100%' cellspacing='1' cellpadding='2' border='0' class='bg3'><tr><td>n";
$pathstring "<a href='index.php'>"._MD_MAIN."</a>&nbsp;>&nbsp;";
$nicepath $mytree->getNicePathFromId($cid"title""viewcat.php?op=");
$pathstring .= $nicepath;
echo 
"<b>".$pathstring."</b>";



to

$totaldownload getTotalItems($myrow['cid'], 1);

echo 
"<table width='100%' cellspacing='1' cellpadding='2' border='0' class='bg3'><tr><td>n";
$pathstring "<a href='index.php'>"._MD_MAIN."</a>&nbsp;>&nbsp;";
$nicepath $mytree->getNicePathFromId($cid"title""viewcat.php?op=");
$pathstring .= $nicepath;
echo 
"<b>".$pathstring."</b>"&nbsp;.$totaldownload.;



But, the result is showing the entire posting count (the whole database count) instead of the count from selected subcategory (Further in every sub levels we browse, it is showing the overal total posting count).

I am not familiar with php, but still exploring to figure this out. When u have time, Can you tell me how to fetch the count of posting from an active sub category selected in viewcat.php page. (So it appear on the blue line position in the picture below )

Thanking everyone and XOOPS once again.


Resized Image


4
trabis
Re: Need some help in patching MyReviews module
  • 2009/1/11 13:21

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


I'm not sure how your file looks like but try this:

$totaldownload 0;
$arr = array();
$arr $mytree->getFirstChild($myrow['cid'], "title");
foreach(
$arr as $ele){
        
$totaldownload += getTotalItems($ele['cid'], 1);
}

echo 
"<table width='100%' cellspacing='1' cellpadding='2' border='0' class='bg3'><tr><td>n";
$pathstring "<a href='index.php'>"._MD_MAIN."</a>&nbsp;>&nbsp;";
$nicepath $mytree->getNicePathFromId($cid"title""viewcat.php?op=");
$pathstring .= $nicepath;
echo 
"<b>".$pathstring."</b>&nbsp;".$totaldownload;

Login

Who's Online

182 user(s) are online (103 user(s) are browsing Support Forums)


Members: 0


Guests: 182


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits