com_hoicoiapi + adsmanager

More
3 years 4 months ago #37 by amin
amin created the topic: com_hoicoiapi + adsmanager
hi,
First, I have a special thanks for publishing this great component hoicoiapi.
I want the adsmanager component like any other component such as k2 and ..., components compatible with it hoicoiapi.
Thank you slip if the guide.
thanks
The topic has been locked.
More
3 years 4 months ago #38 by Jibon Costa
com_hoicoiapi + adsmanager
Hello Amin,

Glad to hear that our extension help you. I never use "adsmanager" before. Can you write here the features? Also if you know PHP then you can extend our extension. It's open source & can be found it GitHub too.

Thanks
Jibon
The following user(s) said Thank You: amin
The topic has been locked.
More
3 years 4 months ago #39 by amin
com_hoicoiapi + adsmanager
Thanks guide
feauter : extensions.joomla.org/extensions/extensi...ified-ads/adsmanager
Let's ask if I attach this component to check.
please guide me to set this adsmanager component with hoicoiapi for export json for create andriod app
thanks
The topic has been locked.
More
3 years 4 months ago #40 by amin
com_hoicoiapi + adsmanager
plese help me
The topic has been locked.
More
3 years 4 months ago - 3 years 4 months ago #41 by amin
com_hoicoiapi + adsmanager
hi
i write code for adsmanager in controller.php (com_hoicoiaoi
// http://YOURSITE.COM/index.php?option=com_hoicoiapi&task=getAdsm
    public function getAdsm() {

        if (!file_exists(JPATH_ROOT . '/administrator/components/com_adsmanager/helpers/select.php')) {
            jexit("You don't have Adsm installed");
        }
        include_once JPATH_ROOT . '/administrator/components/com_adsmanager/helpers/select.php';
        include_once JPATH_ROOT . '/administrator/components/com_adsmanager/models/category.php';

        $output = array();
        $model = new AdsmanagerModelCategory();
        $items = $model->getList();
        if ($items && !$this->input->get("catid") && !$this->input->get("id")) {

            foreach ($items as $item) {
                $item = get_object_vars($item);
             //   $item['media'] = $this->getHikaImages($item['category_id']);
                $output[] = $item;
            }
        } elseif ($this->input->get("catid")) {
            $db = JFactory::getDbo();
            $query = "SELECT product_id FROM #__adsmanager_categories WHERE" . $db->quoteName('category_id') . " = " . $db->quote($this->input->get("catid"));
            $db->setQuery($query);
            $items = $db->loadColumn();

            include_once JPATH_ROOT . '/administrator/components/com_adsmanager/models/content.php';
            $model = new AdsmanagerModelContent();
            if ($model->getProducts($items)) {
                $products = $model->all_products;
                foreach ($products as $product) {
                    $output[] = $product;
                }
            }
        } elseif ($this->input->get("id")) {
            include_once JPATH_ROOT . '/administrator/components/com_adsmanager/models/content.php';
            $model = new AdsmanagerModelContent();
            $model->getProducts($this->input->get("id"));
            $product = $model->products;
            $output = $product[$this->input->get("id")];
        }
        header('Content-Type: application/json');
        echo json_encode($output);
        jexit();
    }

	
    protected function getAdsmImages($id) {
        include_once JPATH_ROOT . '/administrator/components/com_adsmanager/helpers/helper.php';
        include_once JPATH_ROOT . '/administrator/components/com_adsmanager/helpers/image.php';
        $db = JFactory::getDBO();
        $query = "SELECT file_path FROM #__hikashop_file WHERE file_ref_id={$id} ";
        $db->setQuery($query);
        $items = $db->loadAssocList();
        $output = array();
        $model = new hikashopImageHelper();
        foreach ($items as $item) {
            $output[] = get_object_vars($model->getThumbnail($item['file_path']));
        }
        return $output;
    }

but dont worked.please help me how set hoicoiapi to adsmanager
adsmanager all files attach in url : LINK REMOVED

so thanks
Last edit: 3 years 4 months ago by Jibon Costa. Reason: LINK REMOVED
The topic has been locked.
More
3 years 4 months ago #42 by Jibon Costa
com_hoicoiapi + adsmanager
Hi Amin,

Give me some time. I will check your code. Little busy with other stuff.

Thanks
Jibon
The following user(s) said Thank You: amin
The topic has been locked.
More
3 years 4 months ago #43 by amin
com_hoicoiapi + adsmanager
yeah.you say right little busy code adsmanager.
But I'm sure you can do.
I am infinitely grateful to you
Thanks Jibon
I am waiting for your guide
The topic has been locked.
More
3 years 4 months ago #44 by Jibon Costa
com_hoicoiapi + adsmanager
Hi,

Here is the working method. Add this in the controller & give a try :)
    //http://YOURSITE.COM/index.php?option=com_hoicoiapi&task=getAdsm
    //Image path: http://YOURSITE.COM/images/com_adsmanager/contents/FILE_NAME
    public function getAdsm() {

        if (!file_exists(JPATH_ROOT . '/components/com_adsmanager/lib/core.php')) {
            jexit("You don't have AdsManager installed");
        }
        include_once JPATH_ROOT . '/components/com_adsmanager/lib/core.php';
        include_once JPATH_ROOT . '/administrator/components/com_adsmanager/models/category.php';
        include_once JPATH_ROOT . '/administrator/components/com_adsmanager/models/content.php';

        $output = array();
        $model = new AdsmanagerModelCategory();
        $items = $model->getCategories(true);
        $input = $this->input;

        if ($items && !$input->get("catid") && !$input->get("id")) {
            foreach ($items as $item) {
                $data = get_object_vars($item);
                $output[] = $data;
            }
        } elseif ($input->get("catid")) {
            $model = new AdsmanagerModelContent();
            $filters['category'] = $catid;
            $items = $model->getContents($filters);

            foreach ($items as $item) {
                $data = get_object_vars($item);
                $output[] = $data;
            }
        } elseif ($input->get("id")) {
            $model = new AdsmanagerModelContent();
            $item = $model->getContent($input->get("id"), true);
            $data = get_object_vars($item);
            $output[] = $data;
        }

        header('Content-Type: application/json');
        echo json_encode($output);
        jexit();
    }
Call from font-end same as other. Example:
All categories: http://YOUR_SITE/index.php?option=com_hoicoiapi&task=getAdsm
All items in category: http://YOUR_SITE/index.php?option=com_hoicoiapi&task=getAdsm&catid=1
Single Item detail: http://YOUR_SITE/index.php?option=com_hoicoiapi&task=getAdsm&id=1

Let me know if you face any problem. If you have time please add this code in the GitHub :)

Regards
Jibon Costa
The following user(s) said Thank You: amin
The topic has been locked.