PDA

View Full Version : Miscellaneous Hacks - CFM: Directory


Throtex
09-23-2006, 10:00 PM
Title: "CFM: Directory"
-------------------------------------------------
Author: Sal Bezos (webmaster@carforummisfits.com)
Date of Creation: September 23, 2006
Version: 0.1 (9/23/2006)
Home: http://www.carforummisfits.com/
-------------------------------------------------

Purpose:
--------
This product for vBulletin creates a directory page for any sort of directory-type content. It uses collapsable rows in a table to present large amounts of data in a compact space. Items are added to the list via the AdminCP. Entry options include a heading, a blurb (shown under the heading when you expand the row), and a custom webpage with additional contents that may be optionally enabled for each directory entry.

I designed this for my forum in order to provide a list of affiliated advertisers to my users. However, it can be used to compactly display many other types of information, such as contact information. Since support is limited, I encourage you to modify this for your own uses (and release any derivative works on vbulletin.org) provided you provide an attribution to me.


Tested:
-------
This product has been tested on a modified vBulletin 3.6.0 installation. There is no reason why it should not work in the same manner on any 3.5.x installation, but it has not and will not be tested by the author.


Included Files:
---------------
- README.txt
- cfmdirectory.php
- admincfmdirectory.php
- product-cfmdirectory.xml
- sshot1.png
- sshot2.png
- sshot3.png
- sshot4.png
- sshot5.png
- sshot6.png


Installation:
-------------
1. Upload the admincfmdirectory.php file to your admincp directory, and set proper file permissions.

2. Upload the cfmdirectory.php file to your forum root directory.

3. In your admin panel, go to Plugins & Products / Manage Products / Add/Import Product and import the "product-cfmdirectory.xml" product file. If this is your first installation of this product, select the "No" radio button in the "Allow Overwrite" option. If you are upgrading or reinstalling, select the "Yes" radio button. Click the "Import" button.

4. Visit http://<yourhostname>/forums/cfmdirectory.php to verify that the page appears. Now you're ready to add items to the directory.

5. In your admin panel, go to vBulletin Options and select the "CFM: Directory" options from the list.

6. You may choose to enter text in the Directory Introductory Text box. You can use HTML here. This text will appear above the text of your directory. Click the Save button if you want to save any changes.

7. Click the Directory Entries link.

8. Click on Create New Entry

9. Enter a heading for your directory item, and a blurb (HTML is allowed). The blurb will appear when you expand the directory item.

10. Optionally, enter something in the content block. This will appear on its own page, kind of like a personal web page for the item you are adding. If you want to use this, be sure to set the content page radio button to "Yes".

11. Click on Submit New Entry.

12. Revisit http://<yourhostname>/forums/cfmdirectory.php to ensure that the item appears as expected.

13. Lather, rinse, and repeat.

14. Add a link to http://<yourhostname>/forums/cfmdirectory.php somewhere on your forum so your users can access it ... maybe in a pretty drop-down menu of your choice. I won't impose the location on you -- I think you can handle this!


FAQ:
----
Q: I hate the names of things!
A: That's not really a question.

Q: I hate the names of things?
A: Uh, better ... I tried to put things in phrases. Also, you can always go dumpster-diving in the templates and php files for anything I left out. Don't be afraid, there's not much you can hurt.

Q: Can you explain your screenshots?
A: I suppose ...
sshot1: AdminCP option menu w/ Intro text box and link to directory manager
sshot2: Entering data ... this entry has a content page
sshot3: After adding two entries. Entries are sorted alphabetically by heading
sshot4: The directory in its natural state -- all entries collapsed. Notice Zaphod has a personal page.
sshot5: The directory with both entries un-collapsed
sshot6: A content page


Support:
--------
Any questions and problems should be reported to the modification's thread on http://www.vbulletin.org and may or may not be answered. No warranty, express or implied, is granted with this software. Use is at your own risk.


License:
--------
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991


Live demo: http://www.carforummisfits.com/forums/cfmdirectory.php
(my personal install will be updated with ads when I get to it)

Throtex
09-24-2006, 01:38 AM
Note that since the directory items start off collapsed, people who are not running Javascript will not be able to view the contents of the blurb, as they will not be able to use the expand buttons. If you anticipate this being an issue, you may want to make sure all of your entries have a "contents" page.

--

As to this: "Also, you can always go dumpster-diving in the templates and php files for anything I left out. Don't be afraid, there's not much you can hurt."

This applies to anything short of the attribution notice. Feel free to rename the php file itself as well to make it more descriptive -- but if you do this, make sure you go into the file itself and change any instances of the old filename. I can probably use some self-referential variable instead, but I got lazy. :)

--

I like seeing how people are using this, so please post a link to sites where you are running this! Aside from shameless self-promotion ;) we can get other ideas.

Snake
09-24-2006, 10:50 AM
Awesome this is great! :D

ymy
09-24-2006, 02:47 PM
great work Throtex,

Q. Can i use it like web links directory?
I mean can i create main directory and many sub-directory

Thanks

Lionel
09-24-2006, 03:07 PM
I use this hack as a sponsors page. In main page it displays the list of sponsors. In content page I removed header and navbar and it displays a full html page for the sponsor.

Throtex
09-24-2006, 03:09 PM
great work Throtex,

Q. Can i use it like web links directory?
I mean can i create main directory and many sub-directory

Thanks
Hmm ... right now, you can only have the one directory. I can see how that would be useful though!

I don't have time to develop these things much past what I use it for ... but if anyone would like to use this as a base to do something like what you suggest, they're welcome to do so. It would probably involve an extra field in the table (like a category field) and then displaying items by category. Shouldn't be too much more work for anyone that wants to do that.

ymy
09-24-2006, 04:43 PM
thanks! Throtex

*clicks install*

Throtex
09-25-2006, 12:30 PM
Hmm ... right now, you can only have the one directory. I can see how that would be useful though!

I don't have time to develop these things much past what I use it for ... but if anyone would like to use this as a base to do something like what you suggest, they're welcome to do so. It would probably involve an extra field in the table (like a category field) and then displaying items by category. Shouldn't be too much more work for anyone that wants to do that.

^^ I'm tempted to do this myself this coming weekend if I have time (sorry ... work, school, etc.) :)

I'm thinking this:
- allow users to select a category for each entry, or select 'none'
- allow users to create new categories
- toggle on/off display categories on main page (would show as a list of links like "category0 | category1 | category2 | ... | categoryN" right above the entry listings) ... if off, would function exactly as it does right now
- click on a category link will only show entries from that category
- link to an "All" category to show the entire list like now

I think that would make this a lot more useful. I'll see if I can get to it. :D

rasun
09-25-2006, 02:00 PM
^^ I'm tempted to do this myself this coming weekend if I have time (sorry ... work, school, etc.) :)

I'm thinking this:
- allow users to select a category for each entry, or select 'none'
- allow users to create new categories
- toggle on/off display categories on main page (would show as a list of links like "category0 | category1 | category2 | ... | categoryN" right above the entry listings) ... if off, would function exactly as it does right now
- click on a category link will only show entries from that category
- link to an "All" category to show the entire list like now

I think that would make this a lot more useful. I'll see if I can get to it. :D
This sounds awsome.
For something like that I was allready searching for. Need it for some kind of "content index page" ....

More subcategories would be great. I mean for example first you see the catagories "big cars", "small cars" .... When you open them, there you will find other subcategories with car companies "Ford" , "Mercedes" .... which you also can open and see the content...
Is somehting like that possible?

Throtex
09-25-2006, 02:13 PM
Is somehting like that possible?
Everything is possible ;) I'll consider that ... I think at least the category thing would be useful for my own application, so at least I have the motivation to do it. :D

rasun
09-25-2006, 02:47 PM
^^ So it was a good idea to post a car example for this ;)

OK good to hear that you have motivation to do it, thanks in advance :)

Zowners
09-26-2006, 02:23 AM
Will this work on 3.6.1?

GlobalFusion
09-26-2006, 03:08 AM
I"ll give it a test run. ;)

Throtex
09-26-2006, 11:55 AM
Will this work on 3.6.1?
No reason it shouldn't, but I haven't run the upgrade myself so I'm still on 3.6.0. It doesn't rely on any existing tables (makes its own table) so presumably everything should be ok.

Zowners
09-26-2006, 01:21 PM
Well I added it/it works. yeah!!!! I'm hoping to make a links directory out of it...somehow. Thanks. :=) The link is: http://thesupportgroupforum.com ;)

Peace

Throtex
09-26-2006, 04:02 PM
Well I added it/it works. yeah!!!! I'm hoping to make a links directory out of it...somehow. Thanks. :=) The link is: http://thesupportgroupforum.com ;)

Peace
Glad to hear :)

HDT
09-29-2006, 11:11 PM
Is possible to change cfmdirectory.php to cfmdirectory.htm or html?
So final link is domain.com/forum/cfmdirectory.htm/html.

I think if using cfmdirectory.php,reciprocal links system can not detect links on that page when run auto check.