HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


File Manipulation Instructions for Importers

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#79925 (In Topic #16238)
Avatar

Community saint

I am working on an importer and am wondering if and how the manipulation of files should be handled? Near as I can tell glancing through the code is that files ie(downloads section type thing and/or images) are left in their original location and just url pointers are used to reference them however I was thinking this could make site folder structure a little messy instead of using ocPortals folder structure for organizing files. Is the reason you choose not to move files into ocPortals directory structure because you forsee issues that would bring up or is this something I should consider tackling? I thought I would ask before I begin something like that since you may have left out those operations for a reason (other than to streamline coding time)?
Back to the top
 
Posted
Rating:
#79928
Avatar

There are lots of copy operations in the importers… just look for copy( in the code.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#79931
Avatar

Community saint

hmm apparently they aren't in the ones I am working on but I will check others to find how you guys manage it thanks.
Back to the top
 
Posted
Rating:
#79933
Avatar

Also look for "rename(".

Actually you're right the phpnuke one isn't doing that. I think that was the first importer we did, it's probably a bit rubbish then ;).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#79934
Avatar

Community saint

Found it in use under joomla importer. Thanks
Back to the top
 
Posted
Rating:
#80107
Avatar

Community saint

@Chris

Do you have an ocPortal function for renaming files and if so where is it hiding?

I noticed that uploads to the downloads are saved with what looks like an MD5 filename with a .dat extension and while I could easily recreate this effect myself I figure I would reuse your code for efficiency. So what file (and function name) do I find this under please? I tried looking through the API guide and in the sources/files and files2.php files but either I missed it or it is somewhere else?

My goal was to have files moved into ocPortals directory structure and follow its naming conventions.
Back to the top
 
Posted
Rating:
#80108
Avatar

Just PHP 'rename', with an '@' in front to suppress errors if the file is already moved or missing.

uniqid('') may be used for the randomised names. The purpose is anti-leech protection. Realistically though you don't need it because of uploads/downloads/.htaccess. The extra protection is for servers without .htaccess enabled, or Microsoft IIS (not supported).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#80129
Avatar

Community saint

Duck-

You are getting quite a workout and will soon be an ocPortal programming god.  :)

Bob
Back to the top
 
Posted
Rating:
#80137
Avatar

Community saint

BobS said

and will soon be an ocPortal programming god.
Demi-god maybe, because we all know that Chris is the one true ocPortal God.

Expand:


Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#80139
Avatar

Community saint

temp1024 said

BobS said

and will soon be an ocPortal programming god.
Demi-god maybe, because we all know that Chris is the one true ocPortal God.

Expand:


That's priceless!!

Really, Chris is Zeus. You are alreeady one of the Olympians and I hope a few others will join your rank.

Bob
Back to the top
 
Posted
Rating:
#80140
Avatar

Hmm, to accept these complements I would need to break the first commandment  :lol:


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#80159
Avatar

Community saint

Hmm … I would need to break the first commandment …
And that is?

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#80160
Avatar

Thought you might appreciate the answer to that in romanised Hebrew…

lo yiyeh-lekha elohim acheirim,

Of course, it is implied I speak in a reference frame in concordance with the Lord's prayer as above, my cultural upbringing, and my name.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#80161
Avatar

Community saint

:thumbs:

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: