 |
 |
 |
 |
 |
| Author |
Message |
zumbuluk
Joined: 26 Sep 2005 Posts: 43
|
|
Plugins |
|
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 ).
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 |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2857 Location: Germany |
|
Re: Plugins |
|
 |  | 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 ). |
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.
 |  | 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. 
|
|
| Fri Oct 14, 2005 9:23 am |
|
 |
odin
Moderator
Joined: 29 Sep 2005 Posts: 138 Location: Poland |
|
Re: Plugins |
|
 |  | 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 ). And there you have it Gosh, I'm so sleppy...
|
|
| Fri Oct 14, 2005 2:19 pm |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2857 Location: Germany |
|
Re: Plugins |
|
 |  | Gosh, I'm so sleppy... |
Why are you always sleepy at this time of the day? What do you do at night? 
|
|
| Fri Oct 14, 2005 2:38 pm |
|
 |
DiGiTAL
Joined: 16 Oct 2005 Posts: 64 Location: Ukraine |
|
|
| Sun Oct 16, 2005 2:17 am |
 |
 |
lexa
Creator of CuteNews.RU

Joined: 02 Oct 2005 Posts: 92 Location: St.-Petersburg, Russia |
|
|
|
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 |
 |
 |
odin
Moderator
Joined: 29 Sep 2005 Posts: 138 Location: Poland |
|
Re: Plugins |
|
 |  |  |  | Gosh, I'm so sleppy... |
Why are you always sleepy at this time of the day? What do you do at night?  |
Reading books, lots of books And after harsh day I veeeeery sleppy. I don't have even time for some food 
|
|
| Sun Oct 16, 2005 8:34 am |
|
 |
zumbuluk
Joined: 26 Sep 2005 Posts: 43
|
|
Re: Plugins |
|
 |  |
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)
 |  | // 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
 |  | 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 :
 |  | // 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... [/quote]
|
|
| Sun Oct 16, 2005 11:15 am |
|
 |
zumbuluk
Joined: 26 Sep 2005 Posts: 43
|
|
|
|
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 |
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2857 Location: Germany |
|
Re: Plugins |
|
 |  | 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.
 |  | 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. 
|
|
| Sun Oct 16, 2005 2:16 pm |
|
 |
zumbuluk
Joined: 26 Sep 2005 Posts: 43
|
|
|
|
Great!
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 |
|
 |
|
|
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
|
|
 |
 |
 |
|