fix word-break problem in chinese at entry form

Phoca Guestbook - creating guestbooks in Joomla! CMS
abokuo
Phoca Member
Phoca Member
Posts: 26
Joined: 28 May 2010, 12:17

fix word-break problem in chinese at entry form

Post by abokuo »

Hello:
I found the way that fix word-break problem in chinese at entry form, please edit
"\components\com_phocaguestbook\views\phocaguestbook\tmpl\default.php",
than find line 244 to line 314, see:

Code: Select all

		.'<td><strong>'.JText::_('Title').':</strong></td>'
		.'<td colspan="3">'
		.'<input type="text" name="title" id="pgbtitle" value="'. $this->formdata->title .'" size="32" maxlength="200" class="pgbinput" /></td>'
		.'</tr>';
	}
		
	if ((int)$this->tmpl['display_name_form'] > 0){
		echo '<tr>'
		.'<td><strong>'.JText::_('Name').': </strong></td>'
		.'<td colspan="3">'
		.'<input type="text" name="pgusername" id="pgbusername" value="'.$this->formdata->username .'" size="32" maxlength="100" class="pgbinput" /></td>'
		.'</tr>';
	}
		
	if ((int)$this->tmpl['display_email_form'] > 0){
		echo '<tr>'
		.'<td><strong>'.JText::_('Email').': </strong></td>'
		.'<td colspan="3">'
		.'<input type="text" name="email" id="pgbemail" value="'.$this->formdata->email .'" size="32" maxlength="100" class="pgbinput" /></td>'
		.'</tr>';
	}
	
	if ((int)$this->tmpl['display_website_form'] > 0){
		echo '<tr>'
		.'<td><strong>'.JText::_('Website').': </strong></td>'
		.'<td colspan="3">'
		.'<input type="text" name="website" id="pgbwebsite" value="'.$this->formdata->website .'" size="32" maxlength="100" class="pgbinput" /></td>'
		.'</tr>';
	}
	
	if ((int)$this->tmpl['display_content_form'] > 0){
		echo '<tr>'
		.'<td><strong>'.JText::_('Content').': </strong></td>'
		.'<td colspan="3">'.$this->tmpl['editor'].'</td>'
		.'</tr>';
	}
		
	if ((int)$this->tmpl['enable_captcha'] > 0) {
	
		// Server side checking CAPTCHA 
		echo $this->tmpl['errmsg_captcha'];
		//-- Server side checking CAPTCHA
			
		// Set fix height because of pane slider
		$imageHeight = 'style="height:105px"';
		
		echo '<tr>'
		.'<td><strong>'. JText::_('Image Verification').': </strong></td>'		
		.'<td align="left" valign="middle" '.$imageHeight . '>';
		
		if ($this->tmpl['captcha_method'] == 0) {
			echo '<img src="'. JRoute::_('index.php?option=com_phocaguestbook&view=phocaguestbooki&id='.$this->id.'&Itemid='.JRequest::getVar('Itemid', 0, '', 'int').'&phocasid='. md5(uniqid(time()))).'" alt="'.JText::_('Captcha Image').'" id="phocacaptcha" />';
		} else {
			echo JHTML::_( 'image.site','index.php?option=com_phocaguestbook&view=phocaguestbooki&id='.$this->id.'&Itemid='.JRequest::getVar('Itemid', 0, '', 'int').'&phocasid='. md5(uniqid(time())), '', '','',JText::_('Captcha Image'), array('id' => 'phocacaptcha'));
		}
		echo '</td>';
				
		echo '<td align="left" valign="middle">'
		.'<input type="text" id="pgbcaptcha" name="captcha" size="6" maxlength="6" class="pgbinput" /></td>';
				
		echo '<td align="center" valign="middle">';
		//Remove because of IE6 - href="javascript:void(0)" onclick="javascript:reloadCaptcha();"
		echo '<a href="javascript:reloadCaptcha();" title="'. JText::_('Reload Image').'" >'
		. JHTML::_( 'image.site', 'components/com_phocaguestbook/assets/images/icon-reload.gif', '', '','',JText::_('Reload Image'))
		.'</a></td>';

		echo '</tr>';
	}
		
	echo '<tr>'
	.'<td>&nbsp;</td>'
replace with:

Code: Select all

		.'<td><nobr><strong>'.JText::_('Title').':</strong></nobr></td>'
		.'<td colspan="3">'
		.'<input type="text" name="title" id="pgbtitle" value="'. $this->formdata->title .'" size="32" maxlength="200" class="pgbinput" /></td>'
		.'</tr>';
	}
		
	if ((int)$this->tmpl['display_name_form'] > 0){
		echo '<tr>'
		.'<td><nobr><strong>'.JText::_('Name').': </strong></nobr></td>'
		.'<td colspan="3">'
		.'<input type="text" name="pgusername" id="pgbusername" value="'.$this->formdata->username .'" size="32" maxlength="100" class="pgbinput" /></td>'
		.'</tr>';
	}
		
	if ((int)$this->tmpl['display_email_form'] > 0){
		echo '<tr>'
		.'<td><nobr><strong>'.JText::_('Email').': </strong></nobr></td>'
		.'<td colspan="3">'
		.'<input type="text" name="email" id="pgbemail" value="'.$this->formdata->email .'" size="32" maxlength="100" class="pgbinput" /></td>'
		.'</tr>';
	}
	
	if ((int)$this->tmpl['display_website_form'] > 0){
		echo '<tr>'
		.'<td><nobr><strong>'.JText::_('Website').': </strong></nobr></td>'
		.'<td colspan="3">'
		.'<input type="text" name="website" id="pgbwebsite" value="'.$this->formdata->website .'" size="32" maxlength="100" class="pgbinput" /></td>'
		.'</tr>';
	}
	
	if ((int)$this->tmpl['display_content_form'] > 0){
		echo '<tr>'
		.'<td><nobr><strong>'.JText::_('Content').': </strong></nobr></td>'
		.'<td colspan="3">'.$this->tmpl['editor'].'</td>'
		.'</tr>';
	}
		
	if ((int)$this->tmpl['enable_captcha'] > 0) {
	
		// Server side checking CAPTCHA 
		echo $this->tmpl['errmsg_captcha'];
		//-- Server side checking CAPTCHA
			
		// Set fix height because of pane slider
		$imageHeight = 'style="height:105px"';
		
		echo '<tr>'
		.'<td><nobr><strong>'. JText::_('Image Verification').': </strong></nobr></td>'		
		.'<td align="left" valign="middle" '.$imageHeight . '>';
		
		if ($this->tmpl['captcha_method'] == 0) {
			echo '<img src="'. JRoute::_('index.php?option=com_phocaguestbook&view=phocaguestbooki&id='.$this->id.'&Itemid='.JRequest::getVar('Itemid', 0, '', 'int').'&phocasid='. md5(uniqid(time()))).'" alt="'.JText::_('Captcha Image').'" id="phocacaptcha" />';
		} else {
			echo JHTML::_( 'image.site','index.php?option=com_phocaguestbook&view=phocaguestbooki&id='.$this->id.'&Itemid='.JRequest::getVar('Itemid', 0, '', 'int').'&phocasid='. md5(uniqid(time())), '', '','',JText::_('Captcha Image'), array('id' => 'phocacaptcha'));
		}
		echo '</td>';
				
		echo '<td align="left" valign="middle">'
		.'<input type="text" id="pgbcaptcha" name="captcha" size="6" maxlength="6" class="pgbinput" /></td>';
				
		echo '<td align="center" valign="middle">';
		//Remove because of IE6 - href="javascript:void(0)" onclick="javascript:reloadCaptcha();"
		echo '<a href="javascript:reloadCaptcha();" title="'. JText::_('Reload Image').'" >'
		. JHTML::_( 'image.site', 'components/com_phocaguestbook/assets/images/icon-reload.gif', '', '','',JText::_('Reload Image'))
		.'</a></td>';

		echo '</tr>';
	}
		
	echo '<tr>'
	.'<td><nobr>&nbsp;</nobr></td>'
hope it will be useful. :)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48739
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: fix word-break problem in chinese at entry form

Post by Jan »

Hi, thank you for the guide.

Jan
If you find Phoca extensions useful, please support the project
Post Reply