News:

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

Main Menu

Remove duplicate entries in PHP files

Started by T3CHN0, October 06, 2010, 07:40:49 PM

Previous topic - Next topic

T3CHN0

Hi

I was wondering if there is a way to scan & Remove duplicate entries in PHP files?

Do I have to go through each & every file? Or is there a better way to do this.

What does the different colours when editing PHP files mean?

Is there a program I can use to search and clean the php files for me?

My forum works great & no errors, but I do notice sometimes my files have
2 or some times even up-to 6 entries of the same thing when I am doing
manual installs of MODS.
I clean the files up when I find the duplicates but it's very time consuming
and would like to know of a better way if there is one

Cheers

SlammedDime

um... duplicate entries?  You mean, like the same line of code in two or more spots?  Unless a mod is leaving behind old code and you're installing a newer version of the mod, there is no 'duplicate code', if there is a line of code in more than one spot in the file, it is there for a reason and should NOT be removed.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

T3CHN0

NOTE: THIS CODE IS NOT ANY KIND OF FIX

Here is an example of what I mean.

1443:             // Don't allow everything to be embedded with the author name.   
1444:             'parsed_tags_allowed' => array('url', 'iurl', 'ftp'),   
1445:             'block_level' => true,   
1446:          ),   
1447:          array(   
1448:             'tag' => 'quote',   
1449:             'parameters' => array(   
1450:                'author' => array('match' => '([^<>]{1,192}?)'),   
1451:                'link' => array('match' => '(?:board=\d?((?:topic|threadid)=[\dmsg#\./]{1,40}(?:;start=[\dmsg#\./]{1,40})?|action=profile;u=\d )'),   
1452:                'date' => array('match' => '(\d )', 'validate' => 'timeformat'),   
1453:             ),   
1454:             'before' => '<div class="quoteheader"><div class="topslice_quote"><a href="' . $scripturl . '?{link}">' . $txt['quote_from'] . ': {author} ' . $txt['search_on'] . ' {date}</a></div></div><blockquote>',   
1455:             'after' => '</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div>',   
1456:             'block_level' => true,   
1457:          ),   1458:          array(   
1459:             'tag' => 'quote',   
1460:             'parameters' => array(   
1461:                'author' => array('match' => '(.{1,192}?)'),   
1462:             ),
   ==>1463:             'before' => '<div class="quoteheader"><div class="topslice_quote">' . $txt['quote_from'] . ': {author}</div></div><blockquote>',   
1464:             'after' => '</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div>',   
1465:             'block_level' => true,


This is from my LOGS

I can keep correcting errors and searching files but I don't have the time.
I would like to have a clean forum as to I would think it would be better for speed moving from page to page
posting & so forth...

As my forum works I am happy to leave it the way it is as well...

Oya

thats not a duplicate

thats because quotes can be handled in multiple different ways so it has to be left as is - dont change it, it'll break

T3CHN0

I haven't change it as yet, but would have at some point.
the log shows that code as an error...

however I did see this error the 2 codes look a little different.

other cases it would look more like

   
if (!empty($board['children']))
{   
if (!empty($board['children']))
{   
if (!empty($board['children']))
{

& that's when I would be cleaning up duplicates

Oya

the only times there should be any duplicates is if you installed a mod twice (or the mod is badly written)

there aren't any places in the code you can just remove bits from afaik

T3CHN0

OK this is not a problem & I think it's becoming to much involved for a simple question.

I guess the answer is NO.. & I have to clean the files my self.

It's a pain to do it that way but if that's how it is then
there is nothing more to be said.

Other question was...
When editing the files with an FTP program there are different colours in the files
mostly all the same colour but at points there is colours.
in the PHP file. Any answers to why? What do the colours mean?

please simple answere only

Cheers all for your replies

SlammedDime

It's called syntax highlighting... different editors highlight in different ways.

Our point is, if you're seeing multiple lines like that, something is wrong to begin with, as SMF does not install like this.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

T3CHN0

Quote from: SlammedDime on October 06, 2010, 09:36:54 PM
It's called syntax highlighting... different editors highlight in different ways.
something is wrong,

OK so it means there could be a problem
NP
Colour of lines mean nothing as different editor's might have the lines as differant colours.
Cheers that's all I want to know

Thanks all for your replies.

Aleksi "Lex" Kilpinen

Based on the last reply, I'll mark this topic solved for now - but if you still need assistance with something, feel free to mark it not solved and let us know :)
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Advertisement: