PHP - How To Do Like That: Forums / Showthread.php? T = 10
Hi all ,
I'm a newbie in PHP coding and wondering how to do like that: ...forums / showthread.php? t = 10 in VBulletin forums. I created forums using PHP (and his pros ^^ ) but I gave for each new topic a new .php page. Thanks for all who'll help me to do, at least some keywords to look for. Nice Regards! Similar Tutorialsim using the modified preorder tree traversal heirarchal system for my forum. (http://articles.sitepoint.com/article/hierarchical-data-database/2) basically where you store the left and right id to form relationships between forums like phpbb does. but im struggling to show subforums underneath their parents. eg: Code: [Select] forum id left id right id parent id 1 1 8 0 this is a category 2 2 7 1 this is a forum belonging to the category 3 3 6 1 this is a forum belonging to the category 4 4 5 2 this is a subforum belonging to forum 2 i can display all of the forums within their categories fine but cant think how to add the subforums underneath the forums that have them. has anyone got any advice? I wil ltry and explain this the best i can so please bare with me if it doesnt come out right first time lol. I am making a forum and as we all know forums have subforums or child boards that are within the forums themselves. Like php freaks has the forum php coding and then a sub forum within it for php regex. Im having trouble coding this though. Anyone have any tips on code and database structure that could help? I was thinking of making three new database tables for child forums, child topics and child posts but im sure there is an easier way. something like a column within the main forum table which defines wether the forum is a child or not. But then how would i link this child forum with the forum that its supposed to be in. Any advice is greatly appreciated. Thanks. So, you know how on forums (including this one) the icon of a topic/forum will be greyed out if your account viewed that topic's latest post, regardless of which computer you viewed it on? How exactly does it store that? I know that logically it would store it on the Database, but I'm curious as to the actual implementation. It seems to me that storing every single topic you viewed it and when would take up huge numbers of rows, even for a small number of people, like say 100. If you have a forum with 1000's of people, each viewing even 3 topics a day, you're record numbers would be huge, slowing down the database. And calling your last viewed time for each and ever topic? Wouldn't that slow down the code excecution heaps? If you have any input, I'd love to hear it. It's a question I've been wrestling with in the back of my mind for a few years now How do forums check if you've read a post or not? Is it through cookies? i installed the most popular chat mod on smf forums called ajax chat. i am certain i did everything correctly. but when i try to test it i get a 403 on byethost. ive also had problems with phpbb this must mean that byethost must not allow ajax does anyone know of a server that will allow me to use this mod? Hi guys I found a nice script that removes all the work of writing individual embedding for a long list of video host, it works well and pretty easy to be tweaked even by non coders such as me. One problem seems to be that some host have that annoying autostart or autoplay feature when a person places a link to a forum. So if you have a forum page with multiple urls for videos that auto start or play feature drives you nuts. I have tried to tweak the code by adding a param name= and used the 0 token and the false alpha word, still no luck with vimeo, it continues to start as soon as it finishes loading. This code block shows the script file for vimeo, there are only two files in my includes to run this script so both must be tweaked with the changes, I use the nifty free PSPad editor to do this and have no trouble making any changes needed. My question is at what level can an option like disabling a feature take place, is this something that must be performed by the host or can this script actually take a param name= to disable it. Thanks for any input or advice, pointing to a good read is most welcome also. Code: [Select] if (($vimeo) && (strpos($message, 'www.vimeo.com/') !== false)){ $message = preg_replace('#<a class="postlink" href="http:\/\/www.vimeo.com\/(.*?)">(.*?)<\/a>#U', '<object type="application/x-shockwave-flash" style="width:400px;height:230px;" data="http://vimeo.com/moogaloop.swf?clip_id=$1&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=$1&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /></object>', $message);} I have asked this question in 3 different places but I get no answers lol. I hope to find some help here.
i want to only display user role for keymaster and moderator users.
I don't want every participant to have their role shown , only the keymaster and moderators are important enough to me to show their role next to their avatar. The following function code i found, and used... It worked but has some issues:
function role_show () { $displayed_user = bbp_get_reply_author_id() ; $role = bbp_get_user_role( $displayed_user); if ( bbp_is_user_keymaster($displayed_user) ||$role == 'bbp_moderator') $args['show_role'] = true ; else $args['show_role'] = false ; return $args ; } add_filter ('bbp_before_get_reply_author_link_parse_args', 'role_show' )Code Issues: On the Forums topic post lists, This code also removes the avatar from showing in the same cell section as the “last post by” . And it removes the “last post by” name in this same section. How can I fix this ? If needed, I could implement this code again and provide a link to the error so you can see. Thank you for any help. Side notes: Someone told me to try function role_show ($args) {As my first line , but it did not work. It resulted in the following screenshot : as Attached Files functions-picture.png 35.46KB 0 downloads |