Text Align and Quotes around tags

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Shoushan
Forum Newbie
Posts: 3
Joined: Sat Jul 19, 2008 1:16 pm

Text Align and Quotes around tags

Post by Shoushan »

I have been trying center this one piece of text but I keep getting different parse errors. Please help. I have an <h4> tag and I want to center align. It have something to do with the "" and the ; but where and how. Somewhere in lines 5,6, & 7....right. I want to center Categories text. The quotes are confusing and I'm new to php can someone explain why I can't just take out the quotes around the "<h4>"

Code: Select all

<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); ?>
 
<?php
[color=#FF4000]echo $vendor_store_desc."";[/color]
[color=#FF4000]echo "<h4>" .$VM_LANG->_('PHPSHOP_CATEGORIES')."</h4>";[/color]
[color=#FF8000]echo $categories; ?>[/color]
<div class="vmRecent">
<?php echo $recent_products; ?>
</div>
<?php
// Show Featured Products
if( $this->get_cfg( 'showFeatured', 1 )) {
    /* featuredproducts(random, no_of_products,category_based) no_of_products 0 = all else numeric amount
    edit featuredproduct.tpl.php to edit layout */
    echo $ps_product->featuredProducts(true,10,false);
}
// Show Latest Products
if( $this->get_cfg( 'showlatest', 1 )) {
    /* latestproducts(random, no_of_products,month_based,category_based) no_of_products 0 = all else numeric amount
    edit latestproduct.tpl.php to edit layout */
    ps_product::latestProducts(true,10,false,false);
}
?>
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

Re: Text Align and Quotes around tags

Post by susrisha »

try this please


Code: Select all

 
# echo $vendor_store_desc."";
# echo "<h4><center> $VM_LANG->_('PHPSHOP_CATEGORIES') </center></h4>";
# echo $categories; ?>
 
Shoushan
Forum Newbie
Posts: 3
Joined: Sat Jul 19, 2008 1:16 pm

Re: Text Align and Quotes around tags

Post by Shoushan »

That sort of works. It centers the text but the text doesn't say what it said before.

Before it says "Categories" When I put the <center> code in it says and centers
{PHPShop_Categories} from that line of code.

Am I trying to center the wrong line? The <h> tags effect that Categories text. Why wouldn't your <center> code just show and center Categories?
Attachments
screenshot.jpg
screenshot.jpg (70.17 KiB) Viewed 277 times
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

Re: Text Align and Quotes around tags

Post by susrisha »

it was showing so because it took 'PHPSHOP_CATEGORIES' as a constant and not as a variable..
Please try this code instead..This one should probably work..

Code: Select all

 
echo $vendor_store_desc."";
echo "<h4><center>";
echo  $VM_LANG->_('PHPSHOP_CATEGORIES') ;
echo "</center></h4>";
echo $categories; ?>
 
Post Reply