How to Publish and Unpublished toolbar button work in Joomla.

1,634 views
Skip to first unread message

reansey

unread,
Sep 17, 2010, 4:35:30 AM9/17/10
to Joomla! General Development
Hello,

I was edit one component and I add two more toolbar Publish and
Unpublished in that component. But I do not know how to make it work
in that component. So please send me the instruction.

Prasit Gebsaap

unread,
Sep 17, 2010, 8:51:52 PM9/17/10
to joomla-de...@googlegroups.com
Hi,
 
First of all, you have to check that in database table of that component support Publish/Unpublish feature. It must have 'published' field. In Joomla!, a toolbar button has a task associated with, so in case of publish it may be 'publish' and unpublish is 'unpublish'. And this toolbars usually exists in list view and multiple items can be publish/unpublish in one click .
 
1. So first thing, please find the controller that will handle these tasks
2. Then add two functions named publish() and unpublish().
3. In those two functions, retreives the cid as array input. load Model and call its publishList(....) like this
 
    function publish() {
           $cid = JRequest::getVar('cid', array(), 'default', 'array');
 
           $model = & $this->getModel('ModelName');
           $model->publishList($cid, 1);
 
           $this->setRedirect(...URL..of calling view.....);
    }
 
   
    function publish() {
           $cid = JRequest::getVar('cid', array(), 'default', 'array');
 
           $model = & $this->getModel('ModelName');
           $model->publishList($cid, 0);
           $this->setRedirect(...URL..of calling view.....);
    }

And in the model, add function named publishList(...)
   
  function publishList($cid = array(), $publish = 1) {
         $user  =& JFactory::getUser();
         if (count( $cid ))
         {
             JArrayHelper::toInteger($cid);
             $cids = implode( ',', $cid );
             $query = 'UPDATE #__hrm_jobtitles'
                   . ' SET published = '.(int) $publish
                   . ' WHERE id IN ( '.$cids.' )'
                 . ' AND ( checked_out = 0 OR ( checked_out = '.(int) $user->get('id').' )' ;
                  $this->_db->setQuery( $query );
                if (!$this->_db->query()) {
                    $this->setError($this->_db->getErrorMsg());
                    return false;
                 }
           }
           return true;
 }
 
That is.
 

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.




--
Prasit Gebsaap
 
Nonthaburi, Thailand
 

reansey

unread,
Sep 20, 2010, 3:05:46 AM9/20/10
to Joomla! General Development
Really helpful. but i am still do not clear please show me with the
real component. I use com_bayon.
> On 17 September 2010 15:35, reansey <rean...@gmail.com> wrote:
>
>
>
> > Hello,
>
> > I was edit one component and I add two more toolbar Publish and
> > Unpublished in that component. But I do not know how to make it work
> > in that component. So please send me the instruction.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Joomla! General Development" group.
> > To post to this group, send an email to
> > joomla-de...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > joomla-dev-gene...@googlegroups.com<joomla-dev-general%2Bunsu...@googlegroups.com>
> > .

reansey

unread,
Sep 21, 2010, 1:54:15 AM9/21/10
to Joomla! General Development
Hello!

Please help me with function publish/unpublish
> > Nonthaburi, Thailandhttp://www.joomlant.com,http://www.joomlant.orghttp://ktdms.blogspot....

Prasit Gebsaap

unread,
Sep 21, 2010, 3:17:34 AM9/21/10
to joomla-de...@googlegroups.com
Hi,
I think I have provide clear example on how to do it. But if you not have any experience with Joomla! extension development, it may difficult to go on. If you want to do this on component, ok it is easier than backend. If com_bayon follows MVC pattern that it is a good news.
 
First of all, you have to find controller and view to implement this function.

To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.




--
Prasit Gebsaap
 

reansey

unread,
Sep 21, 2010, 4:15:08 AM9/21/10
to Joomla! General Development
Yes I am so young in Joomla. So y I am so difficult on this thing. can
you downloads that component and please add function publish/ publish
to show me.

On Sep 21, 2:17 pm, Prasit Gebsaap <prasit.gebs...@gmail.com> wrote:
> Hi,
> I think I have provide clear example on how to do it. But if you not have
> any experience with Joomla! extension development, it may difficult to go
> on. If you want to do this on component, ok it is easier than backend. If
> com_bayon follows MVC pattern that it is a good news.
>
> First of all, you have to find controller and view to implement this
> function.
>
> > <joomla-dev-general%2Bunsu...@googlegroups.com<joomla-dev-general%252Buns...@googlegroups.com>
>
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/joomla-dev-general?hl=en-GB.
>
> > > > --
> > > > Prasit Gebsaap
>
> > > > Nonthaburi, Thailandhttp://www.joomlant.com,http:/
> > /www.joomlant.orghttp://ktdms.blogspot....
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Joomla! General Development" group.
> > To post to this group, send an email to
> > joomla-de...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > joomla-dev-gene...@googlegroups.com<joomla-dev-general%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/joomla-dev-general?hl=en-GB.
>
> --
> Prasit Gebsaap
>
> Nonthaburi, Thailandhttp://www.joomlant.com,http://www.joomlant.orghttp://ktdms.blogspot.com,http://lowcost-it.blogspot,com

Prasit Gebsaap

unread,
Sep 21, 2010, 4:22:43 AM9/21/10
to joomla-de...@googlegroups.com
Where can I download this package. I found Web SVN using google but please direct me to the download link.

To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.




--
Prasit Gebsaap
 

reansey

unread,
Sep 22, 2010, 2:26:50 AM9/22/10
to Joomla! General Development
Ok please
http://khmertechno.com/downloads/software/com_bayon.zip

Back end: Menu pages


* Additional column publish/unpublish, admin will be able to
publish/upublish by click on image (tick/untick) in each row. Also add
publish/unpublish toolbar
* Additional field in detail page publish/unpublish

On Sep 21, 3:22 pm, Prasit Gebsaap <prasit.gebs...@gmail.com> wrote:
> Where can I download this package. I found Web SVN using google but please
> direct me to the download link.
>
> > > > <joomla-dev-general%2Bunsu...@googlegroups.com<joomla-dev-general%252Buns...@googlegroups.com>
> > <joomla-dev-general%252Buns...@googlegroups.com<joomla-dev-general%25252Bun...@googlegroups.com>
>
> > > > > > > .
> > > > > > > For more options, visit this group at
> > > > > > >http://groups.google.com/group/joomla-dev-general?hl=en-GB.
>
> > > > > > --
> > > > > > Prasit Gebsaap
>
> > > > > > Nonthaburi, Thailandhttp://www.joomlant.com,http:/
> > > > /www.joomlant.orghttp://ktdms.blogspot....
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Joomla! General Development" group.
> > > > To post to this group, send an email to
> > > > joomla-de...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > joomla-dev-gene...@googlegroups.com<joomla-dev-general%2Bunsu...@googlegroups.com>
> > <joomla-dev-general%2Bunsu...@googlegroups.com<joomla-dev-general%252Buns...@googlegroups.com>
>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/joomla-dev-general?hl=en-GB.
>
> > > --
> > > Prasit Gebsaap
>
> > > Nonthaburi, Thailandhttp://www.joomlant.com,http:/

reansey

unread,
Sep 22, 2010, 2:29:12 AM9/22/10
to Joomla! General Development
Or you can write like this
{
...
function publish()
{
...
// Code publish selected menupages
}
function unpublish()
{
...
// Code unpublish selected menupages
}
...
}

On Sep 21, 3:22 pm, Prasit Gebsaap <prasit.gebs...@gmail.com> wrote:
> Where can I download this package. I found Web SVN using google but please
> direct me to the download link.
>
> > > > <joomla-dev-general%2Bunsu...@googlegroups.com<joomla-dev-general%252Buns...@googlegroups.com>
> > <joomla-dev-general%252Buns...@googlegroups.com<joomla-dev-general%25252Bun...@googlegroups.com>
>
> > > > > > > .
> > > > > > > For more options, visit this group at
> > > > > > >http://groups.google.com/group/joomla-dev-general?hl=en-GB.
>
> > > > > > --
> > > > > > Prasit Gebsaap
>
> > > > > > Nonthaburi, Thailandhttp://www.joomlant.com,http:/
> > > > /www.joomlant.orghttp://ktdms.blogspot....
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Joomla! General Development" group.
> > > > To post to this group, send an email to
> > > > joomla-de...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > joomla-dev-gene...@googlegroups.com<joomla-dev-general%2Bunsu...@googlegroups.com>
> > <joomla-dev-general%2Bunsu...@googlegroups.com<joomla-dev-general%252Buns...@googlegroups.com>
>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/joomla-dev-general?hl=en-GB.
>
> > > --
> > > Prasit Gebsaap
>
> > > Nonthaburi, Thailandhttp://www.joomlant.com,http:/

Prasit Gebsaap

unread,
Sep 22, 2010, 3:41:27 AM9/22/10
to joomla-de...@googlegroups.com
This is just for example, I think I have a good explaination for you.
I have changed many files. Please compare using diff tool or something like that.
com_bayon_modified.zip

reansey

unread,
Sep 22, 2010, 4:07:36 AM9/22/10
to Joomla! General Development
Thank for your paying time to take care me if I have other problem I
will contact you more

On Sep 22, 2:41 pm, Prasit Gebsaap <prasit.gebs...@gmail.com> wrote:
> This is just for example, I think I have a good explaination for you.
> I have changed many files. Please compare using diff tool or something like
> that.
>
> Prasit Gebsaap
>
> Nonthaburi, Thailandhttp://www.joomlant.com,http://www.joomlant.orghttp://ktdms.blogspot.com,http://lowcost-it.blogspot,com
>
>  com_bayon_modified.zip
> 343KViewDownload

reansey

unread,
Sep 22, 2010, 4:53:52 AM9/22/10
to Joomla! General Development
Sorry! why it does not work when i install it?



On Sep 22, 3:07 pm, reansey <rean...@gmail.com> wrote:
> Thank for your paying time to take care me if I have other problem I
> will contact you more
>
> On Sep 22, 2:41 pm, Prasit Gebsaap <prasit.gebs...@gmail.com> wrote:
>
> > This is just for example, I think I have a good explaination for you.
> > I have changed many files. Please compare using diff tool or something like
> > that.
>
> > Prasit Gebsaap
>
> > Nonthaburi, Thailandhttp://www.joomlant.com,http://www.joomlant.orghttp://ktdms.blogspot....
>
> >  com_bayon_modified.zip
> > 343KViewDownload

reansey

unread,
Sep 22, 2010, 4:59:58 AM9/22/10
to Joomla! General Development
Can we it I use without Model? I want to use only in Controller. Can I
use like this?

On Sep 22, 3:07 pm, reansey <rean...@gmail.com> wrote:
> Thank for your paying time to take care me if I have other problem I
> will contact you more
>
> On Sep 22, 2:41 pm, Prasit Gebsaap <prasit.gebs...@gmail.com> wrote:
>
> > This is just for example, I think I have a good explaination for you.
> > I have changed many files. Please compare using diff tool or something like
> > that.
>
> > Prasit Gebsaap
>
> > Nonthaburi, Thailandhttp://www.joomlant.com,http://www.joomlant.orghttp://ktdms.blogspot....
>
> >  com_bayon_modified.zip
> > 343KViewDownload

Prasit Gebsaap

unread,
Sep 22, 2010, 7:59:56 AM9/22/10
to joomla-de...@googlegroups.com
Yes, you can.
1. First option, you do like what I do in a model what you will add SQL query in controller which not complies with MVC.
2. You can repeat on each id, load record using JTable, update its property. Then store it to database.
 
The second one you do not include SQL query in controller but performance is worse comparing to first method.

I did not test, on fresh installation. I Just install and then modify code. Then I copied files to package and sent it.
 
Please let me know if it not work,
 
 
> >  com_bayon_modified.zip
> > 343KViewDownload

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.




--

reansey

unread,
Sep 23, 2010, 12:52:04 AM9/23/10
to Joomla! General Development
Sorry can you show me how to do this because I am just beginning for
this. After you do this for me I think I will be improve. Sorry that
make you busy like this.

On Sep 22, 6:59 pm, Prasit Gebsaap <prasit.gebs...@gmail.com> wrote:
> Yes, you can.
> 1. First option, you do like what I do in a model what you will add SQL
> query in controller which not complies with MVC.
> 2. You can repeat on each id, load record using JTable, update its property.
> Then store it to database.
>
> The second one you do not include SQL query in controller but performance
> is worse comparing to first method.
>
> I did not test, on fresh installation. I Just install and then modify code.
> Then I copied files to package and sent it.
>
> Please let me know if it not work,
>
> On 22 September 2010 15:59, reansey <rean...@gmail.com> wrote:
>
>
>
>
>
> > Can we it I use without Model? I want to use only in Controller. Can I
> > use like this?
>
> > On Sep 22, 3:07 pm, reansey <rean...@gmail.com> wrote:
> > > Thank for your paying time to take care me if I have other problem I
> > > will contact you more
>
> > > On Sep 22, 2:41 pm, Prasit Gebsaap <prasit.gebs...@gmail.com> wrote:
>
> > > > This is just for example, I think I have a good explaination for you.
> > > > I have changed many files. Please compare using diff tool or something
> > like
> > > > that.
>
> > > > Prasit Gebsaap
>
> > > > Nonthaburi, Thailandhttp://www.joomlant.com,http:/
> > /www.joomlant.orghttp://ktdms.blogspot....
>
> >  > >  com_bayon_modified.zip
> > > > 343KViewDownload
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Joomla! General Development" group.
> > To post to this group, send an email to
> > joomla-de...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > joomla-dev-gene...@googlegroups.com<joomla-dev-general%2Bunsubs cr...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/joomla-dev-general?hl=en-GB.
>
> --
> Prasit Gebsaap
>

reansey

unread,
Sep 23, 2010, 9:00:41 PM9/23/10
to Joomla! General Development
Hello i was try all my best to do com_bayon but it still not work, So
how can I make it as you guide?

On Sep 22, 4:59 am, Prasit Gebsaap <prasit.gebs...@gmail.com> wrote:
> Yes, you can.
> 1. First option, you do like what I do in a model what you will add SQL
> query in controller which not complies with MVC.
> 2. You can repeat on each id, load record using JTable, update its property.
> Then store it to database.
>
> The second one you do not include SQL query in controller but performance
> is worse comparing to first method.
>
> I did not test, on fresh installation. I Just install and then modify code.
> Then I copied files to package and sent it.

> Please let me know if it not work,
>
> On 22 September 2010 15:59, reansey <rean...@gmail.com> wrote:
>
>
>
> > Can we it I use without Model? I want to use only in Controller. Can I
> > use like this?
>
> > On Sep 22, 3:07 pm, reansey <rean...@gmail.com> wrote:
> > > Thank for your paying time to take care me if I have other problem I
> > > will contact you more
>
> > > On Sep 22, 2:41 pm, Prasit Gebsaap <prasit.gebs...@gmail.com> wrote:
>
> > > > This is just for example, I think I have a good explaination for you.
> > > > I have changed many files. Please compare using diff tool or something
> > like
> > > > that.
>
> > > > Prasit Gebsaap
>
> > > > Nonthaburi, Thailandhttp://www.joomlant.com,http:/
> > /www.joomlant.orghttp://ktdms.blogspot....
>
> >  > >  com_bayon_modified.zip
> > > > 343KViewDownload
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Joomla! General Development" group.
> > To post to this group, send an email to
> > joomla-de...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > joomla-dev-gene...@googlegroups.com<joomla-dev-general%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/joomla-dev-general?hl=en-GB.
>
> --
> Prasit Gebsaap
>

Prasit Gebsaap

unread,
Sep 23, 2010, 9:58:20 PM9/23/10
to joomla-de...@googlegroups.com
What is the reason to do that only in Controller? If you understand something you should able to move code from Model to Controller. The other was implemented for you already.

To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.




--
Prasit Gebsaap
 

reansey

unread,
Sep 23, 2010, 11:11:19 PM9/23/10
to Joomla! General Development

But it still not work when I try to customizing. But Ok i will try my
best thank
On Sep 23, 6:58 pm, Prasit Gebsaap <prasit.gebs...@gmail.com> wrote:
> What is the reason to do that only in Controller? If you understand
> something you should able to move code from Model to Controller. The other
> was implemented for you already.
>
> > <joomla-dev-general%2Bunsu...@googlegroups.com<joomla-dev-general%252Buns...@googlegroups.com>

Andy Nagai

unread,
Sep 24, 2010, 12:43:29 AM9/24/10
to joomla-de...@googlegroups.com
Are you displaying the publish and unpublish icons using JToolBarHelper?

JToolBarHelper::publishList();
JToolBarHelper::unpublsihList();




To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.

reansey

unread,
Sep 24, 2010, 2:30:56 AM9/24/10
to Joomla! General Development
Hello!
I want to display JToolBarHelper::publish and
JToolBarHelper::unpublish . ok like my below thing
Back end: Menu pages
Table : jos_bayon_main
Add one more field "published TINYINT" to jos_bayon_main table
In administrator/index.php?option=com_bayon&view=menupages (Menupages
list)

* add 2 more toolbar button Publish and Unpublish, when admin
select one or more rows in table below it will publish/unpublish those
menupages.
* Show one more column "Publish", using image No
=Unpublished Yes = Published. Add can click on image to publish
or unpublish

In administrator/index.php?
option=com_bayon&view=menupage&task=edit&cid[]=xx (Menupage details)

* Add this

Published No /Yes use it with Radio button

* When admin click save, store it jos_bayon_main table.

So I want to do it like this. Can you help me for this. I was read
from Learning Joomla! Extension Development E-Book but still do not
understand.


On Sep 23, 9:43 pm, Andy Nagai <andy.na...@gmail.com> wrote:
> Are you displaying the publish and unpublish icons using JToolBarHelper?
>
> JToolBarHelper::publishList();
> JToolBarHelper::unpublsihList();
>
> > > > <joomla-dev-general%2Bunsu...@googlegroups.com<joomla-dev-general%252Buns...@googlegroups.com>
> > <joomla-dev-general%252Buns...@googlegroups.com<joomla-dev-general%25252Bun...@googlegroups.com>

Prasit Gebsaap

unread,
Sep 24, 2010, 3:45:36 AM9/24/10
to joomla-de...@googlegroups.com
The attached file add published (Yes/No) in edit view. I have tested for package installation and it works.
 
But if I do it for you what will you learning from this?

To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.




--
Prasit Gebsaap
 
Nonthaburi, Thailand
 

com_bayon_modified_2010-09-24.zip

reansey

unread,
Sep 24, 2010, 4:00:26 AM9/24/10
to Joomla! General Development
Hello!

For learning only. And what I asked you is what I want to learn from
you and group. Before I do not know what is component and it work. I
just install joomla and test it with content only. You no I am a
teacher at a small school in my country and my student always ask me
that kind of question. But you really helpful. So you are my online
instructor.

On Sep 24, 12:45 am, Prasit Gebsaap <prasit.gebs...@gmail.com> wrote:
> The attached file add published (Yes/No) in edit view. I have tested for
> package installation and it works.
>
> But if I do it for you what will you learning from this?
>
> > > > > > <joomla-dev-general%2Bunsu...@googlegroups.com<joomla-dev-general%252Buns...@googlegroups.com>
> > <joomla-dev-general%252Buns...@googlegroups.com<joomla-dev-general%25252Bun...@googlegroups.com>
>
> > > > <joomla-dev-general%252Buns...@googlegroups.com<joomla-dev-general%25252Bun...@googlegroups.com>
> > <joomla-dev-general%25252Bun...@googlegroups.com<joomla-dev-general%2525252Bu...@googlegroups.com>
> >  You received this message because you are subscribed to the Google Groups
> > "Joomla! General Development" group.
> > To post to this group, send an email to
> > joomla-de...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > joomla-dev-gene...@googlegroups.com<joomla-dev-general%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/joomla-dev-general?hl=en-GB.
>
> --
> Prasit Gebsaap
>
> Nonthaburi, Thailandhttp://www.joomlant.com,http://www.joomlant.orghttp://ktdms.blogspot.com,http://lowcost-it.blogspot,com
>
>  com_bayon_modified_2010-09-24.zip
> 132KViewDownload

reansey

unread,
Sep 24, 2010, 9:28:51 AM9/24/10
to Joomla! General Development
Hello!
Why it does not work in my pc? I was to remove and then install again
but still not work. So how can i test it?
> > Nonthaburi, Thailandhttp://www.joomlant.com,http://www.joomlant.orghttp://ktdms.blogspot....
>
> >  com_bayon_modified_2010-09-24.zip
> > 132KViewDownload

Prasit Gebsaap

unread,
Sep 24, 2010, 9:52:47 AM9/24/10
to joomla-de...@googlegroups.com
Could you please provide more information including OS, PHP version and what is the error message you got. In your case, I think database tables were not removed, so the modified table was not update to support published property. Please make sure that column named 'published' exists in #__bayon_main table.

To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.




--
Prasit Gebsaap
 
Nonthaburi, Thailand
 

reansey

unread,
Sep 25, 2010, 12:24:27 AM9/25/10
to Joomla! General Development

Hello!
I use Windows XP Service Pack 2, Apache Version : 2.2.8
PHP Version : 5.2.6 and MySQL Version :5.0.51b .
for database I was check it correctly cos i see "published" column in
my db jos_bayon_main and also
var $published = null; in bayon_main file.

What is error:
When I add new Item, I am not yet Publish but it display in Front End.
So why like this?


On Sep 24, 6:52 am, Prasit Gebsaap <prasit.gebs...@gmail.com> wrote:
> Could you please provide more information including OS, PHP version and what
> is the error message you got. In your case, I think database tables were not
> removed, so the modified table was not update to support published property.
> Please make sure that column named 'published' exists in #__bayon_main
> table.
>
> > > > > > > <joomla-dev-general%252Buns...@googlegroups.com<joomla-dev-general%25252Bun...@googlegroups.com>
> > <joomla-dev-general%25252Bun...@googlegroups.com<joomla-dev-general%2525252Bu...@googlegroups.com>
>
> > > > > <joomla-dev-general%25252Bun...@googlegroups.com<joomla-dev-general%2525252Bu...@googlegroups.com>
> > <joomla-dev-general%2525252Bu...@googlegroups.com<joomla-dev-general%252525252B...@googlegroups.com>
> ...
>
> read more »

Prasit Gebsaap

unread,
Sep 25, 2010, 3:12:24 AM9/25/10
to joomla-de...@googlegroups.com
So what I do for you, it works as I add toolbar and function to publish/unpublish item. But how to use it in frontend depends on code in frontend. And I never look for that but you have to modify query to include WHERE published = 1. Joomla! does nothing for you in this case.

To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.




--
Prasit Gebsaap
 

Viktor-Doxa

unread,
Sep 25, 2010, 12:28:50 PM9/25/10
to Joomla! General Development
ever try using jTable::publish() method ? i think it simpler..

$publishIds = array($id); //$id come from cid can be multiple id in
arrays
$user =& JFactory::getUser();
if (!$table->publish($publishIds, 1, $user->get('id')))
{
//something wrong here....
}

PS: i just start learning joomla so this is still a "textbook" way...
> ...
>
> read more »

reansey

unread,
Sep 26, 2010, 10:05:59 PM9/26/10
to Joomla! General Development
Hello!

Thank you very much that you try your best to help me. But if I want
to add this toolbar (Publih/Unpublish) to the other menu like Item and
Link, I just do ask you did for is ok. I mean just copy and past.

On Sep 24, 8:52 pm, Prasit Gebsaap <prasit.gebs...@gmail.com> wrote:
> Could you please provide more information including OS, PHP version and what
> is the error message you got. In your case, I think database tables were not
> removed, so the modified table was not update to support published property.
> Please make sure that column named 'published' exists in #__bayon_main
> table.
>
> ...
>
> read more »

Prasit Gebsaap

unread,
Sep 26, 2010, 10:34:29 PM9/26/10
to joomla-de...@googlegroups.com
Ok, you have do more than copy and paste, but don't worry it is a little to do.
 
You have to add field 'published' to desired table and JTable subclass that represent that databse table. It is in /admininistrator/com_ponents/com_bayon/tables/. Then in controller just copy and paste is Ok, but it model you have to change table to be updated in publishList method. I think you can do this by yourself.
 
Please be note that I did not mind to instruct or teach you. But I always prefer help hungry man to know how to fishing than give him some fish. This make his life really better.
Some day in 20 years ago, I want to learn computer programming. I went to computer center but I don't know how to turn the computer on so I sat there looking for others doing it. Then I done the same way as they have done. But some day I got the different computer I mean not similar to any one. I just try or leave it but never give up.
 
Cheers
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.




--
Prasit Gebsaap
 

reansey

unread,
Sep 26, 2010, 10:44:56 PM9/26/10
to Joomla! General Development
Yes very good idea. You know I try my best with Joomla because I want
to promote it to my student and community in Cambodia.
Do you have some tips that I can learn how to programing Joomla fast
and easy to understand.

On Sep 27, 9:34 am, Prasit Gebsaap <prasit.gebs...@gmail.com> wrote:
> Ok, you have do more than copy and paste, but don't worry it is a little to
> do.
>
> You have to add field 'published' to desired table and JTable subclass that
> represent that databse table. It is in
> /admininistrator/com_ponents/com_bayon/tables/. Then in controller just copy
> and paste is Ok, but it model you have to change table to be updated in
> publishList method. I think you can do this by yourself.
>
> Please be note that I did not mind to instruct or teach you. But I always
> prefer help hungry man to know how to fishing than give him some fish. This
> make his life really better.
> Some day in 20 years ago, I want to learn computer programming. I went to
> computer center but I don't know how to turn the computer on so I sat there
> looking for others doing it. Then I done the same way as they have done. But
> some day I got the different computer I mean not similar to any one. I just
> try or leave it but never give up.
>
> Cheers
> ...
>
> read more »

Prasit Gebsaap

unread,
Sep 26, 2010, 10:56:27 PM9/26/10
to joomla-de...@googlegroups.com
If you have some background in PHP programming then It is not difficult to get in touch with Joomla!. For programming in Joomla, I use a book titled "Mastering Joomla! Framework and Extension Development". The author is James Kennard. You can start from that book. The second tip is looking in others code. Google search what you want to know. And asking is also one method.
 
I also teaching many student trainees in company to use Joomla! If they cannot develop extension, they just know how to use it. They are a lot of people need a web site but they don't how to start or cannot afford high cost. Using Joomla! can minimize their cost. This is the reason for me to build Joomlant.com web site. So they can start by reading first.

To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.

reansey

unread,
Sep 26, 2010, 11:49:55 PM9/26/10
to Joomla! General Development
Hello!

Where can i put WHERE published = 1 in com_bayon to make front end
work?

I try to use
"$db =& JFactory::getDBO();
$db->setQuery("SELECT * FROM #__bayon_main WHERE published = 1
ORDER BY date");
$rows = $db->loadObjectList();" is it correct code for make front
end work?

On Sep 27, 9:56 am, Prasit Gebsaap <prasit.gebs...@gmail.com> wrote:
> If you have some background in PHP programming then It is not difficult to
> get in touch with Joomla!. For programming in Joomla, I use a book titled
> "Mastering Joomla! Framework and Extension Development". The author is James
> Kennard. You can start from that book. The second tip is looking in others
> code. Google search what you want to know. And asking is also one method.
>
> I also teaching many student trainees in company to use Joomla! If they
> cannot develop extension, they just know how to use it. They are a lot of
> people need a web site but they don't how to start or cannot afford high
> cost. Using Joomla! can minimize their cost. This is the reason for me to
> build Joomlant.com web site. So they can start by reading first.
>
> ...
>
> read more »

Prasit Gebsaap

unread,
Sep 27, 2010, 3:06:17 AM9/27/10
to joomla-de...@googlegroups.com
I tried to created menu item for this component but I cannot assign menupage (published added). I don't know what is the purpose of this component. But I seen that it used JElement but I don't why we have to code like that. It can be done using JElement or SQL type parameter. If for menupage we should add published=1 in SQL of JElement Subclass. Sorry, please look at administrator/components/com_bayon/elements. This will hide unpublished items from users to select.
 
Could you explain what you want to do with this component?
 
 


 
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.

reansey

unread,
Sep 27, 2010, 8:27:51 PM9/27/10
to Joomla! General Development
Hello!

Did you receive my email? Yes in the mail I was tell you about what I
want to do with this component.
Please help me for this. Thank in Advance!

On Sep 27, 2:06 pm, Prasit Gebsaap <prasit.gebs...@gmail.com> wrote:
> I tried to created menu item for this component but I cannot assign menupage
> (published added). I don't know what is the purpose of this component. But I
> seen that it used JElement but I don't why we have to code like that. It can
> be done using JElement or SQL type parameter. If for menupage we should add
> published=1 in SQL of JElement Subclass. Sorry, please look at
> administrator/components/com_bayon/elements. This will hide unpublished
> items from users to select.
>
> Could you explain what you want to do with this component?
>
> ...
>
> read more »

Prasit Gebsaap

unread,
Sep 28, 2010, 3:52:42 AM9/28/10
to joomla-de...@googlegroups.com
What I mean is about what is the purpose of this component? It is not what you want to do with this component. For example com_menus provides menu item to users.

> ...
>
> read more »

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.

reansey

unread,
Sep 28, 2010, 4:10:30 AM9/28/10
to Joomla! General Development
Hello!
com_bayon use for counting the number of downloads. Ex. in one website
they want to know how many time their software was download from the
visitor. Like this web site http://sankuru.biz/en/downloads/joomla-15-extensions.html
this the own of this component.

On Sep 28, 2:52 pm, Prasit Gebsaap <prasit.gebs...@gmail.com> wrote:
> What I mean is about what is the purpose of this component? It is not what
> you want to do with this component. For example com_menus provides menu item
> to users.
>
> ...
>
> read more »

reansey

unread,
Sep 29, 2010, 11:31:28 AM9/29/10
to Joomla! General Development
Hello!
you have any idea for help me for com_bayon? I really need the idea
for this because so young in this case. Thank for sharing

On Sep 23, 9:43 pm, Andy Nagai <andy.na...@gmail.com> wrote:
> Are you displaying the publish and unpublish icons using JToolBarHelper?
>
> JToolBarHelper::publishList();
> JToolBarHelper::unpublsihList();
>
> > > > <joomla-dev-general%2Bunsu...@googlegroups.com<joomla-dev-general%252Buns...@googlegroups.com>
> > <joomla-dev-general%252Buns...@googlegroups.com<joomla-dev-general%25252Bun...@googlegroups.com>
Reply all
Reply to author
Forward
0 new messages