PrestaShop Forums: [CONTRIBUTION] News module/mod - PrestaShop Forums

Jump to content


Welcome to the PrestaShop Forum! We hope you'll share your comments and suggestions with us. We ask that you please post in English to the main sections of the PrestaShop Forum. If you want to write in another language, please post in the corresponding PrestaShop Community section below.

Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

NYC

Vous parlez français ? par ici !


[CONTRIBUTION] News module/mod


[CONTRIBUTION] News module/mod

#1 Eihwaz

    PrestaShop Apprentice

  • 01 Dec 2008
  • Members
  • PipPip
  • 144 posts
  • Location:Kiev — mother of russian cities

Posted 06 March 2010 - 01:58 PM

Read this first, for legal reasons (don't worry, the modules are still free):


Warranty


All modules, themes or modifications are provided "as is", without a warranty of any kind, either express or implied, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose, or the warranty of non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the modules or the use or other dealings in the modules.

Permission


The author is hereby granted permission, to the user of these modules, themes or modifications to use freely in association with Prestashop. The users are free to use/edit/modify these modules in anyway he/she see fit. However, the users are NOT allowed to redistribute, provide download link, or display download link of these modules, themes, or modifications to his/her blog, Forum, or website of any kind in anyway or send out modules, themes, or modifications to the third party by email or resell or redistribute these modules, themes, or modifications to exchange any intangible, tangible or monetary value with its original format. All of download links have to be in the original place http://www.eihwazblo...p?id_category=1

Disclaimer


Please back up your files and the database before you install the modules, themes, or modification. In the event if you break your site, YOU agree to indemnify and hold the developer harmless from any and all damages of your website.
You download the modules, themes, or modification at your own risk. By downloading the files you agree to not hold anybody but yourself responsible for anything that may come as a result of the use of the modules, the themes, or modification.

And now to the modules:


Remember I said that soon these modules will be moved to my blog? The time has come :) You can get them all here. I didn't have much time to describe them properly or prepare pictures for all of them, will fix ASAP.

#2 Star

    PrestaShop Addict

  • 01 Jan 2009
  • Members
  • PipPipPip
  • 618 posts
  • Location:California

Posted 06 March 2010 - 05:48 PM

Hi Eihwaz,

Thanks for the mod. However, the download link gives error. :-S

#3 Eihwaz

    PrestaShop Apprentice

  • 01 Dec 2008
  • Members
  • PipPip
  • 144 posts
  • Location:Kiev — mother of russian cities

Posted 06 March 2010 - 05:53 PM

Thank you, I've just updated the link, it should work fine now, sorry about that :)

#4 Star

    PrestaShop Addict

  • 01 Jan 2009
  • Members
  • PipPipPip
  • 618 posts
  • Location:California

Posted 06 March 2010 - 06:05 PM

From 1267894403:

Thank you, I've just updated the link, it should work fine now, sorry about that :)


Thank you for the mod. I like your appoach, very easy and simple. I am the wrost programmer. I learned a lot from you. Thank you again.

#5 google-friend

    PrestaShop Apprentice

  • 03 Jul 2009
  • Members
  • PipPip
  • 66 posts

Posted 07 March 2010 - 07:02 PM

this news module is great. I will use it for my blog. Is that a way we can have a block on the left column to automatically show the last 10 newest news? And a block that link to a calendar that link to the news just link the wordpress? If we have this two above function, I will use this "news- blog" to replace my wordpress. Keeping up one appication is better than keeping two.

Thank you very much for the module.

#6 Eihwaz

    PrestaShop Apprentice

  • 01 Dec 2008
  • Members
  • PipPip
  • 144 posts
  • Location:Kiev — mother of russian cities

Posted 07 March 2010 - 07:29 PM

It already contains module to show recently added news, you need to activate it in your BO. I don't know about calendar module though, probably I will get to it at some point, but not in the nearest future, but there soon will be a surprise for everyone using this modification, just wait for it :)

#7 google-friend

    PrestaShop Apprentice

  • 03 Jul 2009
  • Members
  • PipPip
  • 66 posts

Posted 07 March 2010 - 07:49 PM

From 1267986596:

It already contains module to show recently added news, you need to activate it in your BO. I don't know about calendar module though, probably I will get to it at some point, but not in the nearest future, but there soon will be a surprise for everyone using this modification, just wait for it :)


I can not take any more surprise from you, man. :cheese: Everything is too good to be true from you. I am using your order step mod too. It wor so well.....

Thankou for all the mods.

#8 google-friend

    PrestaShop Apprentice

  • 03 Jul 2009
  • Members
  • PipPip
  • 66 posts

Posted 07 March 2010 - 08:34 PM

I did everything you stated above. And at the tab secion on the BO, I don't see how I can add news.

Attached File(s)



#9 Jack

    PrestaShop Apprentice

  • 17 Oct 2008
  • Members
  • PipPip
  • 239 posts

Posted 07 March 2010 - 08:49 PM

I got the same error. May be I am missing something?

This is a great module. I love it. Thanks.

#10 Eihwaz

    PrestaShop Apprentice

  • 01 Dec 2008
  • Members
  • PipPip
  • 144 posts
  • Location:Kiev — mother of russian cities

Posted 07 March 2010 - 08:50 PM

Ok, here it is: it's a comment module for this blog/news thing.

Please only install if you're using news mod from the first post


I didn't plan this at the very beginning, so we'll need to change few files.
Create a new hook in your database:

INSERT INTO `ps_hook` (`name`,`title`) VALUES ('blogComments', 'Hook for comments in the news');

Open blog.php file (root directory), line 17, change

$smarty->assign(array(
'blog' => $blog,
'content_only' => intval(Tools::getValue('content_only'))
));

to

$smarty->assign(array(
'blog' => $blog,
'content_only' => intval(Tools::getValue('content_only')),
'HOOK_BLOG_COMMENTS' => Module::hookExec('blogComments')
));

Open your theme's blog.tpl file, find:


{$blog->date_add} {l s=$blog->meta_title}


{$blog->description_short}
{$blog->content}


And after the
add this line:

{$HOOK_BLOG_COMMENTS}

Now copy the module (see the link in the beginning of this post) to your modules dir and install it as usual.
Don't forget that it's a v.0.1 :)


#11 Eihwaz

    PrestaShop Apprentice

  • 01 Dec 2008
  • Members
  • PipPip
  • 144 posts
  • Location:Kiev — mother of russian cities

Posted 07 March 2010 - 08:54 PM

google-friend, Jack, are you sure you didn't forget to run that mysql query?
Because it's the only reason I can think of right now, but I'll check again. Also, what PS version are you using?

#12 google-friend

    PrestaShop Apprentice

  • 03 Jul 2009
  • Members
  • PipPip
  • 66 posts

Posted 07 March 2010 - 09:01 PM

I use 1.2.5. I just attach my SQ image. I am sure the DB is there.

Attached File(s)



#13 Newest

    PrestaShop Apprentice

  • 01 Mar 2009
  • Members
  • PipPip
  • 101 posts

Posted 07 March 2010 - 09:08 PM

I got the same error. What should I hook my blog at the BO? I assigned the parent selection to home. Am I doing it right?

Attached File(s)



#14 Jack

    PrestaShop Apprentice

  • 17 Oct 2008
  • Members
  • PipPip
  • 239 posts

Posted 07 March 2010 - 09:10 PM

I am using 1.25 and I tried it on 1.3 also. It gave me the same error.

It is wonderful of you to share this module. Thank you again.

#15 Eihwaz

    PrestaShop Apprentice

  • 01 Dec 2008
  • Members
  • PipPip
  • 144 posts
  • Location:Kiev — mother of russian cities

Posted 07 March 2010 - 09:24 PM

I'm missing something, I just installed it on 1.25 successfully using these instruction I've posted earlier (see the image).
That's the problem, I can't get this error to appear on my machine to sort it out. I'll keep trying though.

Attached File(s)

  • Attached File  proof.gif (14bytes)
    Number of downloads: 15203


#16 familyman

    PrestaShop Apprentice

  • 12 Jan 2010
  • Members
  • PipPip
  • 32 posts

Posted 07 March 2010 - 09:35 PM

I have followed the installation step by step, and I got the same error as others do. I am using 1.2.5 and I check my SQ and everything is there. I wonder if you have uploaded all the files?

#17 Eihwaz

    PrestaShop Apprentice

  • 01 Dec 2008
  • Members
  • PipPip
  • 144 posts
  • Location:Kiev — mother of russian cities

Posted 07 March 2010 - 10:08 PM

Could someone having this problem do this for me:
Open your classes/AdminTab.php and after line 127

$this->id = Tab::getCurrentTabId();

add this chunk:

var_dump(array(get_class($this), intval($this->id), intval($cookie->id_employee)));

Then refresh your News tab and post here what it says? Should be something like:

array(3) { [0]=> string(9) "AdminBlog" [1]=> int(69) [2]=> int(1) }

(The first one is a class name, the second is current Tab id, the third one is your administrator user id (which is most probably 1), so you're not posting anything that could allow someone to access your shop, don't worry)

#18 Jack

    PrestaShop Apprentice

  • 17 Oct 2008
  • Members
  • PipPip
  • 239 posts

Posted 07 March 2010 - 10:14 PM

This is what I got

Attached File(s)



#19 Eihwaz

    PrestaShop Apprentice

  • 01 Dec 2008
  • Members
  • PipPip
  • 144 posts
  • Location:Kiev — mother of russian cities

Posted 07 March 2010 - 10:16 PM

Wrong tab, you should enter News tab that you've created.

#20 Jack

    PrestaShop Apprentice

  • 17 Oct 2008
  • Members
  • PipPip
  • 239 posts

Posted 07 March 2010 - 10:29 PM

Here it is.

Attached File(s)







1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users