Members: 16,996
Threads: 38,867
Posts: 159,477
Online: 42

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse

Go Back   Mambers.com > Development > Development Discussions

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 14.11.2005, 08:22   #1 (permalink)
Baby Mamber
 
Join Date: Oct 2005
Posts: 24
row1 is on a distinguished road
Default Component problem, works on mambo but not joomla 1.03

Hi,
Im developing a review component in mambo and i assumed it would work in joomla, so i decided to test it out and well...it doesn't.
Currently on the admin section it shows a list of current reviews, you can click on a review to edit it, this works in mambo but not in joomla, in joomla the review form doesn't get populated.

the below code shows the list of reviews available for edit:
PHP Code:
  # Do the main database query
  
$database->setQuery"SELECT * FROM #__simplereview_review ORDER BY reviewID" );
  
$rows $database->loadObjectList();
  if (
$database->getErrorNum()) {
    echo 
$database->stderr();
    return 
false;
  }

  
HTML_Simple_Review_Review::displayReviews$option$rows ); 
PHP Code:
    function displayReviews( $option, &$rows ) {
     ?>
      <script language="javascript" type="text/javascript">
      function submitbutton(pressbutton) {
        var form = document.adminForm;
        if (pressbutton == "cancel") {
          submitform( pressbutton );
          return;
        }
        submitform( pressbutton );
      }
      </script>
      <form action="index2.php" method="post" name="adminForm">
      <table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist">
       <tr>
        <th width="20"><input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($rows); ?>);" /></th>
        <th class="title" width="25%">Review Titles</th>
        <th class="title">Created By</th>
        <th class="title" width="25%">Score</th>
        <th width="25%">Published</th>
       </tr>
      <?php
        $k 
0;
        for(
$i=0$i count$rows ); $i++) {
        
$row $rows[$i];
       
?>
        <tr class="<?php echo "row$k"?>">
         <td><center><input type="checkbox" id="cb<?php echo $i;?>" name="id[]" value="<?php echo $row->reviewID?>" onclick="isChecked(this.checked);" /></center></td>
         <td><a href="#editReview" onclick="return listItemTask('cb<?php echo $i;?>','editReview')">
         <?php
          
echo "$row->title1";
          if(
$row->title2 !='')
            {
                echo 
"-$row->title2";
            }
          if(
$row->title3 !='')
            {
                echo 
"-$row->title3";
            }
          
?>
          </a></td>
          <td>
          <?php echo $row->createdBy?>
          </td>
          <td>
          <?php echo $row->score?>
          </td>
         <td align="center">
          <?php
           
if ($row->published == "1")
           {
             echo 
"<img src='images/tick.png' border='0' />";
           }
           else
           {
             echo 
"<img src='images/publish_x.png' border='0' />";
           }
          
?>
         </td>
         <?php $k $k?>
        </tr>
      <?php ?>
      <input type="hidden" name="option" value="<?php echo $option?>" />
      <input type="hidden" name="task" value="" />
      <input type="hidden" name="boxchecked" value="0" />
      </form>
     <?php
   
}
this generates links which look somethign like this:
http://site.com/administrator/index2...ews#editReview

the link then goes to this:
PHP Code:
  case "editReview":
    editReview( $option, $id[0] );
    break;
...
...
...
function editReview( $option, $uid ) {
  global $database;
  $row = new mosSimple_Review_Review( $database );
  $row->load( $uid );

  HTML_Simple_Review_Review::editReview( $option, $row );
}

//HTML_Simple_Review_Review
function editReview( $option, &$row ) {
HTML_Simple_Review_Review::genReviewSubmitScript();
        HTML_Simple_Review_Review::genNewReviewForm($option, $row);
     }

    function genNewReviewForm($option,&$row)
    {

     ?>
     <form action="index2.php" method="post" name="adminForm" id="adminForm" class="adminForm">
    <table border="0" cellpadding="3" cellspacing="0">
     <tr>
     <td>
      Category:
     </td>
     <td>
        <?php HTML_Simple_Review_Review::genReviewSelectList($row->categoryID);?>
     </td>
     </tr>

      <tr>
      <td>Score(*): </td>
      <td><input type="text" size="20" maxsize="20" name="score" value="<?php echo $row->score?>"/></td>
     </tr>

     <tr>
      <td>Title 1(*): </td>
      <td><input type="text" size="30" maxsize="30" name="title1" value="<?php echo $row->title1?>" /></td>
     </tr>

     <tr>
      <td>Title 2: </td>
      <td><input type="text" size="30" maxsize="30" name="title2" value="<?php echo $row->title2?>"  /></td>
     </tr>

     <tr>
      <td>Title 3: </td>
      <td><input type="text" size="30" maxsize="30" name="title3" value="<?php echo $row->title3?>" /></td>
     </tr>


      <tr>
      <td>Review(*): </td>
      <td><textarea  name="content" cols="70" rows="20"><?php echo $row->content?></textarea></td>
     </tr>
    </table>


    <input type="hidden" name="reviewID" value="<?php echo $row->reviewID?>" />
    <input type="hidden" name="option" value="<?php echo $option?>" />
    <input type="hidden" name="task" value="" />
    </form>
     <?php

    
}
any help would be greatly appreciated
__________________
http://row1.info
row1 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Joomla vs Mambo bigjules Joomla! 1.0.x General Talk 4 11.04.2007 09:24
Migrating from Mambo 4.5.1 to Joomla 1.1.0 igonot Joomla! 1.0.x 'How Do I' Questions 2 28.10.2005 04:29
Problem with the back-link in the events component janwin Mambo 4.5.1 'How Do I' Questions 2 16.12.2004 15:34
Mambo a IE 6.0 problem ranczo Jak to zrobic 9 19.10.2004 21:46
Mamsites for Future Mambo (5.0 maybe) labanex Mambo 5.0 Wishlist 4 03.09.2004 22:22


All times are GMT +2. The time now is 06:32.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.