Add an imageref to oxReview

We will add a column to the oxreview:

1.) add a DB column to the oxreviews DB table:

ALTER TABLE `oxreviews` ADD COLUMN `OXIMAGEREF` varchar(255) NOT NULL AFTER `OXRATING`

2.) we need to overload core/oxreview.php, to do so

create a file inside modules/htr_oxreviews.php

containing: &lt;?php class htr_oxreview extends htr_oxreview_parent {

public function save {      if ($sReviewImageRef = trim( ( string ) oxConfig::getParameter( 'rvw_imgref', true ) ) ){ $this-&gt;oxreviews__oximageref    = new oxField( $sReviewImageRef, oxField::T_RAW ); $this-&gt;_aFieldNames['oximageref'] = 0; }      parent::save; }

} ?&gt; Explanation:

class htr_oxreview extends htr_oxreview_parent

references the admin Modules settings, in which we will add:

oxreview =&gt; modules/htr_oxreview

so OXID does know that htr_oxreview_parent is oxreview, which we want to overload.

in there we overload the save method to save also the new oximageref.

for that we lookup a POST variable 'rvw_imgref' and assign it to $dReviewImageRef

for our new DB column we set the according class var $this-&gt;oxreviews_oximageref and

add this new field to $this-&gt;_aFieldNames

finally we call the parents save method to save all, also make sure future update to the review system will not harm us.

To have the POST Var we will need to add a field to the review.tpl inside the tpl folder e.g. out/basic/tpl/review.tpl

in there we look for the textarea (&lt;textarea cols="102" rows="15" name="rvw_txt" class="fullsize"&gt;&lt;/textarea&gt;&lt;br&gt;)

and add the line

&lt;input type="input" name="rvw_imgref"&gt;