Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-05-04 15:45:38

bsaner
Member
Registered: 2011-04-11
Posts: 11

Paid work - Plugin development

I run a podcast and we’re looking to move over to Textpattern.

I unfortunately don’t have the time to learn the various callbacks and the like, but we have a fair idea of what we want. The plugin should:

  1. allow file uploads bypassing the TXP file indexing (in other words, we want a form on the Write page that would upload to a directory on the server directly WITHOUT being tracked, etc. in the TXP file upload indexing).
    1. we have two directories- /path/to/webroot/media/mp3 and /path/to/webroot/media/ogg (we run a podcast and oggcast), so we’d need two upload forms that would upload to the proper directory
    2. we’ll also need to record the filename and filetype (e.g. mp3/ogg)
  2. generating the SHA256 hash of each file (we will be using this as the GUID of the episode, for those familiar with podcast feeds)
  3. grabbing the filesize of each file
  4. grabbing the playtime length of each file1.
  5. store 1-4 in a MySQL table (i have a schema you can reference).
    1. it should insert on first article save, and update on subsequent saves.

Contact me via r00t [at] sysadministrivia [dot] com (or r00t^2 on Freenode) to name what you consider a fair price. I have some work done already, but I just can’t seem to make textpattern happy to use the functions. Please only contact if you’re okay with me opensourcing the code I commission from you.

EDIT: multiple standalone plugins are okay too, but a unified plugin is ideal as a lot of these functions would most likely be closely intertwined.

1 we have PHP’s getID3 library installed. i have a function you can use to grab the length if you’ve never used it before.

Last edited by bsaner (2016-05-04 17:04:35)

Offline

#2 2016-05-09 19:58:05

etc
Developer
Registered: 2010-11-11
Posts: 5,210
Website GitHub

Re: Paid work - Plugin development

I’m not taker, but it was interesting to integrate file “custom fields” into txp. Anyone willing to test:

  • download and install this 4.6 branch
  • install this (very raw) plugin
# Name: abc_article_file v0.1 
# Type: Admin/AJAX plugin
# 
# Author: 
# URL: 
# Recommended load order: 5

# .....................................................................
# This is a plugin for Textpattern CMS - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the 'Install plugin' box:
# .....................................................................

YToxMTp7czo0OiJuYW1lIjtzOjE2OiJhYmNfYXJ0aWNsZV9maWxlIjtzOjY6ImF1dGhvciI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1snYXJ0aWNsZV9maWxlJ11bJ3R5cGUn
XTsKCQkkZmlsZVBhdGggPSBidWlsZF9maWxlX3BhdGgoJGZpbGVfYmFzZV9wYXRoLCAkZmls
ZU5hbWUpOwoKCQkvLyBhZGQgeW91ciBmaWxlIHBhcnNpbmcgY29kZSBoZXJlCgoJCS8vIHNh
dmUgZmlsZQoJCWlmICghZmlsZV9wdXRfY29udGVudHMoCgkJCSRmaWxlUGF0aCwKCQkJZmls
ZV9nZXRfY29udGVudHMoJF9GSUxFU1snYXJ0aWNsZV9maWxlJ11bJ3RtcF9uYW1lJ10pKQoJ
CSkgcmV0dXJuOwoKCQkkZmlsZU5hbWUgPSBkb1NsYXNoKCRmaWxlTmFtZSk7CgkJJGZpbGVU
eXBlID0gZG9TbGFzaCgkZmlsZVR5cGUpOwoJCXNhZmVfdXBkYXRlKCd0ZXh0cGF0dGVybics
ICJjdXN0b21fMT0nJGZpbGVOYW1lJywgY3VzdG9tXzI9JyRmaWxlVHlwZSciLCAnSUQ9Jy5p
bnR2YWwoJHJzWydJRCddKSk7Cgl9Cn0iO3M6NDoidHlwZSI7czoxOiI0IjtzOjU6Im9yZGVy
IjtzOjE6IjUiO3M6NToiZmxhZ3MiO3M6MToiMCI7czo0OiJoZWxwIjtiOjA7czozOiJtZDUi
O3M6MzI6IjVjMjI3ZWI0NTYyODdlMGY2ODI1YTk3MjM3NzliNzkyIjt9

It should add a file upload button after the custom fields in Write tab and save the name and the type of the file as custom_1 and custom_2 on upload (to files directory).

Offline

Board footer

Powered by FluxBB