create custom fileds in Article Manager of joomla 1.5 - php

I am beginner in joomla so For some customization in joomla's core files i am getting troubles.
what i want:- I want to add check box in article detail page.by using this option i will get the value that the current article should be "Latest or not".
what i done:-i added the extra 1 field of Boolean type in jos_content. and create a check box on article edit form.i create the check box in following code administrator/components/com_content/admin.content.html.php
<td>
<label>
<?php echo JText::_( 'Latest News' ); ?>
</label>
</td>
<td>
<?php echo $lists['latestnews']; ?>
</td>
My Question:- how can i add this field value and update in database?
i found to create such things for joomla 1.6,1.7.but the file structure of joomla 1.5 is very different to other versions.
Please help me out..Thanks in advance.

You need to edit controler and tables which saves the data into database names must be something with article!

Related

The description is not prominent by default; however, some themes may show it

I'm using the latest wp version. When I go to edit a category to add descriptions specifically for each category, there is a note that says, "The description is not prominent by default, however some themes may show it."
My theme does not show it. What code do I need to make this visible/prominent? And where would I insert it?
You're looking for category_description().
<?php echo category_description(); ?>
As for where to add it, that's way too broad of a question. We would have no way of knowing without looking at your theme template system.
To display the category, we want to echo it:
<?php echo category_description();?>
And you would basically treat this as if it is text (because that's what it outputs).
So lets say you have a <div> that you want it displayed within in your theme....
<div class="your-container">
<?php echo category_description();?>
</div>
And there ya have it!
Wordpress Codex:
https://codex.wordpress.org/Function_Reference/category_description

Creating Wordpress Slider Post Filter Options

I'm creating a slider for my Wordpress theme and I want to create some options on the admin interface to filter posts by category, tag, random or most recent. I'm also developing a theme's options page based on a tutorial as well and to call these options I'm using: <?php echo get_option('category_name'); ?>. So now what I'm trying to do with this code I just referred is to create some filter options in order to change the posts displayed on the Slider on the Admin interface. Here's the relevant code to show posts on the slider:
<?php
$carouselPosts = new WP_Query();
$carouselPosts->query('showposts=12');
?>
<?php while ($carouselPosts->have_posts()) : $carouselPosts->the_post(); ?>
And here's how I'm creating the theme admin options page:
<p><strong>Display by category, write the category name:</strong><br />
<input type="text" name="category_name" size="45" value="<?php echo get_option('category_name'); ?>" />
</p>
Now, I don't know much of php, I really don't and I know that this isn't the right way to do it, but what I'm trying to do is create something like this:
$carouselPosts->query('category_name=<?php echo get_option('category_name'); ?>&showposts=12');
As I said I know this is not the right way to do it, but it is the easier way to explain what I'm trying to accomplish here. Here's the link of the slider tutorial if it is helpful: Tutorial Link
Actually, it's pretty close. Use:
$carouselPosts->query('category_name=' . get_option('category_name') . '&showposts=12');
You use <?php ?> only when you are trying to insert PHP into HTML. Otherwise, you can just use the PHP as-is.

implement wp-editor in a wordpress page

i create a new plugin .When the plugin is installed then a new link namely exam description setting will be come under the settings bar of wordpress dashboard. It have a text field for exam name & text area for exam description. When i give the corresponding data then it will be saved in new db created by my plugin. Db structure is e_id(int),e_name(varchar),e_des(text).So now my need is to use wp-editor *instead of* using text area .Is there any method to implement it.?
The function wp_editor is your answer (https://codex.wordpress.org/Function_Reference/wp_editor).
<?php
wp_editor($e_des, 'editor_' . $e_id, array(
'textarea_name' => 'editor_' . $e_id
));
?>

Wordpress custom field - show image

I am creating a menu for an Indian restaurant, The Curry Lounge. I want to show the vegetarian symbol next to the title (as shown) if it is actually a vegetarian dish.
I have tried to look for a way to do this in custom fields but have had no luck in doing so. I have created a custom field within one of my posts and called it "hass_veg" and in the menu_page_template of my theme I have the following code where I want it to be placed:
<?php if ( $hass_veg <> 'Y' ) { ?>
<img src="http://www.tesco.com/wine/UIAssets/I/Sites/Retail/Wine/Online/Product/IsVegetarian.gif" alt="Vegetarian" height="30" width="30">
<?php } ?>
I have deduced that when I put the "Y" in, the image appears on the page.
Can anyone help me at all?
In your stylesheet:
.cufon-canvas{
background: url('path_to_your_image_goes_here');
}
Or whatever class name you choose to give the div next to the vegetarian items. I'd add the image in the stylesheet so you (and others) don't have to dig through the php to change it.

Joomla! Unable to edit modules PHP codes

I'm quite new to Joomla! as well as PHP.
Currently i'm developing a Joomla! site using Joomla! Version 1.5.14.
I have downloaded and installed VirtueMart 1.1.3 on my site and now i want to edit the registration fields for the VirtueMart Module.
I went to C:\xampp\htdocs\mysite\modules\mod_virtuemart and opened up the mod_virtuemart PHP script.
I only see these codes for the registration part:
<?php endif; ?>
<?php if( $mosConfig_allowUserRegistration == '1' ) : ?>
<tr>
<td colspan="2">
<?php echo $VM_LANG->_('NO_ACCOUNT'); ?>
<a href="<?php $sess->purl( SECUREURL.'index.php?option=com_virtuemart&page=mysite.registration' ); ?>">
<?php echo $VM_LANG->_('CREATE_ACCOUNT'); ?>
</a>
</td>
</tr>
<?php endif; ?>
But i'm unable to find the few lines of codes for the registration fields (For the user to key in).
Examples: Email, company name, title, first name, last name, etc... (with the text boxes beside them)
Hope you get what i mean.
Now i want to add in some more fields for registration, such as 'Position in company', etc..
Can anyone tell me specifically where to find those codes so that i can edit them?
As per my knowledge you should do it from admin panel. Joomla provide custom settings of fields for virtuemart user registration.
You also can refer below link for that.
http://virtuemart.net/documentation/User_Manual/User_Registration_Fields.html
I think this would be helpful to you.
Let me know if anything new you get.
Thanks.

Categories