2 sam2kb Aug 27, 2009 02:26

great! That did the trick. Thanks!
I don´t know what to think about.
I´ve been for a month trying to to show in my articles some fields (including the new ones... varchar and double) and, some of them work and others no.
For instance, excerpt, priority and, of course, title, author....
But I tried with these brand new fields and don´t work in my skins.
Could you show me, please, the part of the code where you put the fields and work?
I used it in the skin's item_content_inc.php file, like so:
<?php if( !empty( $Item->varchar1 ) ) { ?>
<a href="<?php echo $Item->varchar1;?>">
Thanks! I´ll try it. Just in case! In which skin?
A custom one I developed for a site, but it should work in any skin.
At last, I find out the way: I used to add the field in this way
$Item->varchar1
, as I added others ones.
But, I tried coding in a "new" way::oops: :oops: :oops:
echo $Item->varchar1
It works.....
Uf!!! Thank you!!!!!!!!!!!!!!!!!1
This is the best i could've come up with..pretty satisfactory, except the fact that i couldnt somehow use an autoincrement but wrote the numbers manually so the code grows a little long:
<?php //make sure the field is not empyy
if( !empty( $Item->double1 ) )
{
$field_name = $Blog->get_setting('custom_double'.'1');
//display custom field name
echo ''.$field_name.':';
//display custom field value
echo $Item->double1;
} ?>
<?php
if( !empty( $Item->double2 ) )
{
$field_name = $Blog->get_setting('custom_double'.'2');
//display custom field name
echo ''.$field_name.':';
//display custom field value
echo $Item->double2;
} ?>
<?php
if( !empty( $Item->double3 ) )
{
$field_name = $Blog->get_setting('custom_double'.'3');
//display custom field name
echo ''.$field_name.':';
//display custom field value
echo $Item->double3;
} ?>
<?php
if( !empty( $Item->double4 ) )
{
$field_name = $Blog->get_setting('custom_double'.'4');
//display custom field name
echo ''.$field_name.':';
//display custom field value
echo $Item->double4;
} ?>
<?php
if( !empty( $Item->double5 ) )
{
$field_name = $Blog->get_setting('custom_double'.'5');
//display custom field name
echo ''.$field_name.':';
//display custom field value
echo $Item->double5;
} ?>
<?php
for( $i = 1; $i < 5; $i++ )
{
$var = 'double'.$i;
if( !empty( $Item->$var ) )
{
$field_name = $Blog->get_setting('custom_double'.$i);
//display custom field name
echo ''.$field_name.':';
//display custom field value
echo $Item->$var;
}
}
?>
;)
¥
yeah that is genius, i am just learning, so thanks for the tip but keep your effort belittling winks to yerself P:
:D
¥
-_-
why arent you on irc anyway |-|
edit: even this: 88| has its own smiley but this: -_- does not ? i mean come on wtf is this : 88|
Cos I forgot to start it :p
¥
fair enough
Try this
$Item->varchar1
$Item->double3