News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

SMF Topic Prefix Lite Mod

Started by Nibogo, April 19, 2009, 10:27:22 AM

Previous topic - Next topic

Nibogo

Quote from: 007007 on July 07, 2009, 08:15:58 AM
nice mod thx

how i can add color for the prefix please ?

Quote from: NIBOGO on April 21, 2009, 02:48:12 PM
Quote from: netoya on April 21, 2009, 10:48:58 AM
can I change the color of the prefix and also make it to where the prefix isn't part of the link to that topic?

Both are possible, but I will have to edit all the pages where the topics can be shown (unread, notifications, recent) so I will not do that

MrCreatoR

#41
I added russian translation to the mod:

* Added file TopicPrefix.russian-utf8.php (by copying TopicPrefix.english-utf8.php).

* Added to package-info.xml file this line:
<require-file name="TopicPrefix.russian-utf8.php" destination="$languagedir" />

* And added to install.xml translated part with...
<file name="$languagedir/Modifications.russian-utf8.php" error="skip">
(also by copying of «Modifications.english-utf8.php» part).

But... after installing i have problems (the installation is ok, no errors):

1) When redirecting after installing, i get this error:

QuoteFatal error: Call to undefined function PrefixMain() in /home/.../public_html/Sources/Admin.php on line 576

2) When i trying to edit any post, i get this error:

QuoteTable 'sycra297_smf.smf_prefix' doesn't exist
File: /home/.../public_html/Sources/Post.php
Line: 1136

The modified (translated to russian) mod is attached.

P.S
And when i trying to install original mod, i got this error message saing that this is not a modification package or it's corrupted.

MrCreatoR


MrCreatoR


Mr ChriZ

I agree with the other posters.  For me a single line of prefix is not very useful.

I have need to prefix with a template like this:
QuoteIssue

Cause

Status of Issue

Temporary Resolution

Permanent Resolution

Versions Effected

Severity Rating

Implications on Other Customers

Places Issue Seen

Related Issues

Known Calls

Related Discussion

Related Links

Issue Identified by

Article History
Having just a single line, I don't see much use for.  I know what you mean about real life though.  I make skins for a media player http://yabb.jriver.com/interact/index.php?topic=46922.0 I never get time to do updates etc!

Exterminator2006

i have a error

8: Undefined index: post_prefix
Sources/Post.php
Líne: 1445

Post.php line 1445
   $_POST['subject'] = $_POST['post_prefix'] . ': ' . $_POST['subject'];

Same solution

thanks :)

Hoodie

I'm getting the following error on every board that I'm trying to post a new topic or reply..

8: Undefined variable: prefix
File: /home/automot5/public_html/lxnation/Themes/default/Post.template.php
Line: 339

Here is Line 339 and surrounding in Post.template.php

334:     if (!empty($context['prefix'])){
335:     foreach ($context['prefix'] AS $dummy){
336:     $prefix_groups = explode(',',$dummy['permissions']);
337:     $groups_permission = count(array_intersect($user_info['groups'], $prefix_groups)) == 0 ? false : true; 
338:     $prefix_boards = explode(',', $dummy['id_boards']);
==>339:     if (((in_array($board_info['id'],$prefix_boards)) || $prefix['id_boards'] == 0) && ($groups_permission == true || $context['user']['is_admin']))
340:     $show = true;
341:     }
342:     }
343:    
344:     if ($show){

MrCreatoR

Quote from: NIBOGO on April 19, 2009, 10:27:22 AM
Compatibility:
- 2.0 RC1
- 2.0 RC1-1
No support for «2.0 RC1.2»? :(


MrCreatoR

Quote from: NIBOGO on September 06, 2009, 11:56:30 AM
Works great on SMF 2.0 RC1-2
On clean installation perhaps? I installed on local smf with only those packages:

QuoteHighslide Image Viewer 1.5
Bookmarks 2.2.1

But also i installed on other smf without those packages...

And now (in both of them) i get errors when i trying to edit/create some topic:

Table 'smf_admin.smf_adminprefix' doesn't exist
File: Z:\home\smf.ru\www\Sources\Post.php
Line: 1192


Can you please tell me what can i do to fix that, even if it's a problem on my side?

MrCreatoR

Ok, even on completely clean new SMF installation this mod have mentioned errors. What am i doing wrong?

edi67

Quote from: Automotive Nation on September 05, 2009, 09:48:05 PM
I'm getting the following error on every board that I'm trying to post a new topic or reply..

8: Undefined variable: prefix
File: /home/automot5/public_html/lxnation/Themes/default/Post.template.php
Line: 339

Here is Line 339 and surrounding in Post.template.php

334:     if (!empty($context['prefix'])){
335:     foreach ($context['prefix'] AS $dummy){
336:     $prefix_groups = explode(',',$dummy['permissions']);
337:     $groups_permission = count(array_intersect($user_info['groups'], $prefix_groups)) == 0 ? false : true; 
338:     $prefix_boards = explode(',', $dummy['id_boards']);
==>339:     if (((in_array($board_info['id'],$prefix_boards)) || $prefix['id_boards'] == 0) && ($groups_permission == true || $context['user']['is_admin']))
340:     $show = true;
341:     }
342:     }
343:    
344:     if ($show){


i have same error some help ?
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

MrCreatoR

I think i found what is causing these problems - the following files not extracted properly on install stage (or they modified incorrectly, because at the end the files are 0 kb size):
$sourcedir/TopicPrefix.php
$themedir/TopicPrefix.template.php
$imagesdir/admin/prefix.gif

Just extract them manualy to proper directories.

And also i found a bug when the user does not specify any prefix, then 2 spaces added to the subject title. To fix that, open Sources/Post.php, now find:
$_POST['subject'] = $_POST['post_prefix'] . '  ' . $_POST['subject'];

and replace with this:
$_POST['subject'] = ltrim($_POST['post_prefix'] . '  ' . $_POST['subject']);

Exterminator2006

i have a error

8: Undefined index: post_prefix
Sources/Post.php
Líne: 1445

Post.php line 1445
   $_POST['subject'] = $_POST['post_prefix'] . ': ' . $_POST['subject'];

Same solution

thanks :)

phatuis

I know you said adding color is possible, but when I was making my prefixes, I added a span class, no color, added bbcode, no color, so do we have to edit the related files?

Maxtor

Quote from: NIBOGO on September 06, 2009, 11:56:30 AM
Works great on SMF 2.0 RC1-2

Works fine! one of the best mods ! i was looking for this in my old 1.1.10 !!!

Maxtor

Quote from: Automotive Nation on September 05, 2009, 09:48:05 PM
I'm getting the following error on every board that I'm trying to post a new topic or reply..

8: Undefined variable: prefix
File: /home/automot5/public_html/lxnation/Themes/default/Post.template.php
Line: 339

Here is Line 339 and surrounding in Post.template.php

334:     if (!empty($context['prefix'])){
335:     foreach ($context['prefix'] AS $dummy){
336:     $prefix_groups = explode(',',$dummy['permissions']);
337:     $groups_permission = count(array_intersect($user_info['groups'], $prefix_groups)) == 0 ? false : true; 
338:     $prefix_boards = explode(',', $dummy['id_boards']);
==>339:     if (((in_array($board_info['id'],$prefix_boards)) || $prefix['id_boards'] == 0) && ($groups_permission == true || $context['user']['is_admin']))
340:     $show = true;
341:     }
342:     }
343:    
344:     if ($show){


same error here. any fix?

linette97

How the H*LL do you install this thing!?! I tried everything suggested
I installed this file (who knows where, Doesn't say)

I get this

Package upload failed due to the following error:
"Although the package was downloaded to the server it appears to be empty. Please check the Packages directory, and the "temp" sub-directory are both writable. If you continue to experience this problem you should try extracting the package on your PC and uploading the extracted files into a subdirectory in your Packages directory and try again. For example, if the package was called shout.tar.gz you should:
1) Download the package to your local PC and extract it into files.
2) Using an FTP client create a new directory in your "Packages" folder, in this example you may call it "shout".
3) Upload all the files from the extracted package to this directory.
4) Go back to the package manager browse page and the package will be automatically found by SMF."


I follow those instructions above
Get this
Installing this package will perform the following actions:
Type Action Description
1. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
2. Execute Modification ./Themes/default/languages/Modifications.english-utf8.php Test successful
3. Execute Modification ./Themes/default/languages/Modifications.spanish_es-utf8.php Skipping file
4. Execute Modification ./Themes/default/languages/Modifications.spanish_latin-utf8.php Skipping file
5. Execute Modification ./Themes/default/languages/Modifications.spanish_es.php Skipping file
6. Execute Modification ./Themes/default/languages/Modifications.spanish_latin.php Skipping file
7. Execute Modification ./index.php Test successful
8. Execute Modification ./Sources/ManagePermissions.php Test successful
9. Execute Modification ./Sources/Post.php Test successful
10. Execute Modification ./Themes/default/Post.template.php Test successful
11. Execute Modification ./Sources/Admin.php Test successful
12. Extract File ./Sources/TopicPrefix.php
13. Extract File ./Themes/default/TopicPrefix.template.php
14. Extract File ./Themes/default/languages/TopicPrefix.english.php
15. Extract File ./Themes/default/languages/TopicPrefix.english-utf8.php
16. Extract File ./Themes/default/languages/TopicPrefix.spanish_es.php
17. Extract File ./Themes/default/languages/TopicPrefix.spanish_es-utf8.php
18. Extract File ./Themes/default/languages/TopicPrefix.spanish_latin.php
19. Extract File ./Themes/default/languages/TopicPrefix.spanish_latin-utf8.php
20. Extract File ./Themes/default/images/admin/prefix.gif
21. Execute Code db_prefix.php


I get to Apply Mod but I get this error
Fatal error: require() [function.require]: Failed opening required '/var/www/vhosts/bxwarez.com/httpdocs/Packages/temp/db_prefix.php' (include_path='.:.:') in /var/www/vhosts/bxwarez.com/httpdocs/Sources/Packages.php on line 905

I go take a look at line 905 This is what  I see
            require($boarddir . '/Packages/temp/' . $context['base_path'] . $action['filename']);

I uploaded db_prefix.php. to my main directory & I get this
Creating Tables:

`bx`.smf_prefix table created.
Your database update has been completed successfully!

The Topic Prefix Mod Database was successfully installed.
Now you should go to the Topic Prefix Admin Panel.


Can PLEASE someone help! I NEED this mod and I can't seem to install it!!

Thanks!
Watch Documentaries Online!


Yesterday is history,
Tomorrow is a mystery,
Today is a gift,
That's why it's called the Present.


scimmiotto

any news about rc2? it doesn't work
Loop code example:
The following statement is FALSE
The previous statement is TRUE.

Advertisement: