Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Plugins

 
Reply to topic    Forum Index » General feedback View previous topic
View next topic
Plugins
Author Message
zumbuluk



Joined: 26 Sep 2005
Posts: 43

Post Plugins Reply with quote
OK, so I have some hacks that are quite useful to me in cuntenews 13.6 (such as the ability to sort by xfields on 3 levels, the WYSIWYG editor for my correspondents and there were others, but I can't think of them right now, so I dunno if they're that important to me Smile ).

Anyway, I was wonderning if it was possible to make them into plugins (for SOMEONE else to make them, I don't think I could do it) for cutesql.

The sort_by_xfields could actually be added to the existing x_fields plugin, since it doesn't add more than 10 lines to the code. If you want, I can write exactly what lines...

So?
Fri Oct 14, 2005 8:56 am View user's profile Send private message
Guest








Please login to hide the ads.

FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2857
Location: Germany

Post Re: Plugins Reply with quote
zumbuluk wrote:
OK, so I have some hacks that are quite useful to me in cuntenews 13.6 (such as the ability to sort by xfields on 3 levels, the WYSIWYG editor for my correspondents and there were others, but I can't think of them right now, so I dunno if they're that important to me Smile ).


Actually, there exists a plugin for TinyMCE. It shouldn't be hard to change it to the WYSIWYG editor you prefer.

Just send me the lines one has to add in addnews/editnews.mdu and I'll try to make a plugin for it.



Quote:
The sort_by_xfields could actually be added to the existing x_fields plugin, since it doesn't add more than 10 lines to the code. If you want, I can write exactly what lines...

So?


Sure. Smile
Fri Oct 14, 2005 9:23 am View user's profile Send private message
odin
Moderator


Joined: 29 Sep 2005
Posts: 138
Location: Poland

Post Re: Plugins Reply with quote
zumbuluk wrote:
WYSIWYG editor




It is easy as hell. You must add 3 lines in news module ( readme.txt will tell you which ), and fill up the short config file ( 3 lines Smile ). And there you have it Smile Gosh, I'm so sleppy...
Fri Oct 14, 2005 2:19 pm View user's profile Send private message MSN Messenger
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2857
Location: Germany

Post Re: Plugins Reply with quote
odin wrote:
Gosh, I'm so sleppy...


Why are you always sleepy at this time of the day? What do you do at night? Very Happy
Fri Oct 14, 2005 2:38 pm View user's profile Send private message
DiGiTAL



Joined: 16 Oct 2005
Posts: 64
Location: Ukraine

Post Reply with quote
http://www.s-grand.com/WYSIWYGInnova.rar
Sun Oct 16, 2005 2:17 am View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger ICQ Number
lexa
Creator of CuteNews.RU


Joined: 02 Oct 2005
Posts: 92
Location: St.-Petersburg, Russia

Post Reply with quote
I not recommend use it but Innova is commercial programm.



Use TinyMCE if you want WYSIWYG. TinyMCE very good.
Sun Oct 16, 2005 3:30 am View user's profile Send private message Visit poster's website ICQ Number
odin
Moderator


Joined: 29 Sep 2005
Posts: 138
Location: Poland

Post Re: Plugins Reply with quote
FI-DD wrote:
odin wrote:
Gosh, I'm so sleppy...


Why are you always sleepy at this time of the day? What do you do at night? Very Happy




Reading books, lots of books Very Happy And after harsh day I veeeeery sleppy. I don't have even time for some food Sad
Sun Oct 16, 2005 8:34 am View user's profile Send private message MSN Messenger
zumbuluk



Joined: 26 Sep 2005
Posts: 43

Post Re: Plugins Reply with quote
FI-DD wrote:


Actually, there exists a plugin for TinyMCE. It shouldn't be hard to change it to the WYSIWYG editor you prefer.





Is it already present in the script? Cause I couldn't find it in the demo page...



As for the xfield sorting, here's what goes into the show.inc.php



Line 633 (quite frankly, I dunno what that goes after in a regular cutenews, because I have so many hacks installed.... I think it goes after Active news and Author filter)







Code:
 // Sort by XField v1.0 - addblock

if (isset($sortbyxfield)) {

   $xfieldsaction = 'noop';

   include_once($cutepath.'/inc/xfields.mdu');

   if (!function_exists("sortcmp_sbx")) {

      function sortcmp_sbx($a, $b) {

         global $all_news, $xfieldsdata, $sortbyxfield, $sortbyxfield2, $sortbyxfield3;



         $news_a = explode('|', $all_news[$a]);

         $news_b = explode('|', $all_news[$b]);



         $newsid_a = $news_a[0];

         $newsid_b = $news_b[0];



         $sort1 = strnatcasecmp($xfieldsdata[$newsid_a][$sortbyxfield], $xfieldsdata[$newsid_b][$sortbyxfield]);

         $sort2 = strnatcasecmp($xfieldsdata[$newsid_a][$sortbyxfield2], $xfieldsdata[$newsid_b][$sortbyxfield2]);

         $sort3 = strnatcasecmp($xfieldsdata[$newsid_a][$sortbyxfield3], $xfieldsdata[$newsid_b][$sortbyxfield3]);

         if ($sort1 != 0) {

            return $sort1;

         } elseif ($sort2 != 0) {

            return $sort2;

         } else {

            return $sort3;

         }

      }

   }

   $xfieldsdata = xfieldsdataload();

   uksort($all_news, 'sortcmp_sbx');

}

// Sort by XField v1.0 - End addblock




then, again, in the section of the shows.inc.php after it says "DO NOT EDIT BELOW" and

Code:
if (isset($sortby)) {

if (!function_exists('sortcmp')) {

function sortcmp($a, $b) {

 global $all_news, $sortby;



 $news_a = explode('|', $all_news[$a]);

 $news_b = explode('|', $all_news[$b]);



 return strnatcasecmp($news_a[$sortby], $news_b[$sortby]);

}

}

uksort($all_news, 'sortcmp');

if ($sortad=="d") { $all_news = array_reverse($all_news); }

Unset($Sortby);

}



// Sort News v1.1 - End addblock




you should put this :

Code:
 // Sort by XField v1.0 - addblock

if (isset($sortbyxfield)) {

   $xfieldsaction = 'noop';

   include_once($cutepath.'/inc/xfields.mdu');

   if (!function_exists("sortcmp_sbx")) {

      function sortcmp_sbx($a, $b) {

         global $all_news, $xfieldsdata, $sortbyxfield, $sortbyxfield2, $sortbyxfield3;



         $news_a = explode('|', $all_news[$a]);

         $news_b = explode('|', $all_news[$b]);



         $newsid_a = $news_a[0];

         $newsid_b = $news_b[0];



         $sort1 = strnatcasecmp($xfieldsdata[$newsid_a][$sortbyxfield], $xfieldsdata[$newsid_b][$sortbyxfield]);

         $sort2 = strnatcasecmp($xfieldsdata[$newsid_a][$sortbyxfield2], $xfieldsdata[$newsid_b][$sortbyxfield2]);

         $sort3 = strnatcasecmp($xfieldsdata[$newsid_a][$sortbyxfield3], $xfieldsdata[$newsid_b][$sortbyxfield3]);

         if ($sort1 != 0) {

            return $sort1;

         } elseif ($sort2 != 0) {

            return $sort2;

         } else {

            return $sort3;

         }

      }

   }

   $xfieldsdata = xfieldsdataload();

   uksort($all_news, 'sortcmp_sbx');

   if ($sortad=="d") { $all_news = array_reverse($all_news); }

   unset($sortbyxfield, $sortbyxfield2, $sortbyxfield3);

}

// Sort by XField v1.0 - End addblock




Hope this helps, I know I confused it a bit with not knowing the exact lines... Razz [/quote]
Sun Oct 16, 2005 11:15 am View user's profile Send private message
zumbuluk



Joined: 26 Sep 2005
Posts: 43

Post Reply with quote
Also, there was some hack in cutenews that enabled you to limit the number of characters displayed in for example short story. Any ideas on how to do it here?
Sun Oct 16, 2005 12:11 pm View user's profile Send private message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2857
Location: Germany

Post Re: Plugins Reply with quote
zumbuluk wrote:
Is it already present in the script? Cause I couldn't find it in the demo page...


No, it's not in the script. I'll put it in the download section this evening.



Sort by XFields:

I'll look at it but I don't think I can make it work. Shows.inc.php in CuteNews and CuteNews.RU are totally different.



But I will send your request to lexa. Maybe he writes a plugin for this. Very Happy



Quote:
Also, there was some hack in cutenews that enabled you to limit the number of characters displayed in for example short story. Any ideas on how to do it here?
Do you mean the truncate hack? Right now, there is the shortTitle plugin. I'll try to change it to a shortShortStory plugin. Wink
Sun Oct 16, 2005 2:16 pm View user's profile Send private message
zumbuluk



Joined: 26 Sep 2005
Posts: 43

Post Reply with quote
Great! Smile

BTW, I can already see the advantage of plugins, cause if they're all listed in one place, they won't get "lost" like in cutenews or cutehack
Sun Oct 16, 2005 6:34 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    Forum Index » General feedback All times are GMT + 1 Hour
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.