Jump to content

Archived

This topic is now archived and is closed to further replies.

michail12

CakePHP: milesj's Forum Plugin

Recommended Posts

Hello everyone.

I'm relatively new to PHP, and I'm loving how CakePHP has made my life easy, and hard at the same time.

 

I'm having trouble updating the deprecated Forum Plugin from milesj. If anyone there could help me, I'd much appreciate it.

 

First off, deprecated views and controllers. They amaze me to no end. No matter how deep I try to trace them, it's impossible for me to find out what is wrong with it.
I do have an idea, but I can't trace where I should change the codes.

 

Second; admin roles, ACL, CRUD is not a fairly new concept to me now, but because of the deprecated codes I can't get a deeper understanding about why I can't disable new users from accessing the admin panel.

Third; the Admin Plugin is good, but wouldn't detect the Forum Plugin correctly. I can't trace back where this went wrong. Also, adding new users through the admin panel doesn't hash the password.

 

My codes are here for your viewing and mockery: http://www.mediafire.com/download/00635ajpsn19ba1/AsCIISite.rar

Share this post


Link to post
Share on other sites

Updates:

Forum Plugin and Admin Plugin are definitely fked up. Post count is not correct, displaying unknown posts and whatnot.

Share this post


Link to post
Share on other sites

programming help forums are not here to fix your's or other people's code for them.

 

do you have a specific programming question or a specific problem or error that you need help with?

 

we can only really help you when you post just the relevant section of code you need help with, along with any errors or symptoms you got from that code.

 

also, we can really only help you with one issue at a time, that you have isolated out of the complete code. expecting someone, on a general programming help forum, who are not the author of the application in question, to be up to speed with or to go through a complete application in order to help you, is beyond the scope of what you should expect.

Share this post


Link to post
Share on other sites

programming help forums are not here to fix your's or other people's code for them.

 

do you have a specific programming question or a specific problem or error that you need help with?

 

we can only really help you when you post just the relevant section of code you need help with, along with any errors or symptoms you got from that code.

 

also, we can really only help you with one issue at a time, that you have isolated out of the complete code. expecting someone, on a general programming help forum, who are not the author of the application in question, to be up to speed with or to go through a complete application in order to help you, is beyond the scope of what you should expect.

Thanks, and uh I've already solved it though. After fiddling around the settings, I found what was wrong. Thanks anyway! :) 

Will be back here for more specific questions though. :)

Share this post


Link to post
Share on other sites

cKkWNmSk.png

I can't get the breadcrumbs to behave properly. I'm at the forum plugin index, but it's reading that it's inside the Primary Forum.

 

This is basically the forum.ctp inside the Forum Plugin.

<?php
echo $this->Html->docType();
echo $this->OpenGraph->html(array('xmlns' => 'http://www.w3.org/1999/xhtml')); ?>
<head>
	<?php echo $this->Html->charset(); ?>
	<title><?php echo $this->Breadcrumb->pageTitle($settings['name'], array('separator' => $settings['titleSeparator'])); ?></title>
	<?php
	echo $this->Html->css('Forum.normalize');
	echo $this->Html->css('Forum.style');
	echo $this->Html->script('Forum.mootools-core-1.4.5');
	echo $this->Html->script('Forum.mootools-more-1.4.0.1');
	echo $this->Html->script('Forum.forum');

	if ($this->params['controller'] === 'forum') {
		echo $this->Html->meta(__d('forum', 'RSS Feed - Latest Topics'), array('action' => 'index', 'ext' => 'rss'), array('type' => 'rss'));
	} else if (isset($rss)) {
		echo $this->Html->meta(__d('forum', 'RSS Feed - Content Review'), array($rss, 'ext' => 'rss'), array('type' => 'rss'));
	}

	$locales = $config['Decoda']['locales'];

	$this->OpenGraph->name($settings['name']);
	$this->OpenGraph->locale(array($locales[Configure::read('Config.language')], $locales[$settings['defaultLocale']]));

	echo $this->OpenGraph->fetch();
	echo $this->fetch('css');
	echo $this->fetch('script'); ?>
</head>

<body>
	<div class="wrapper">
		<?php echo $this->element('navigation'); ?>

		<div class="header">
			<h1 class="logo">
				<?php echo $this->Html->link($settings['name'], $settings['url']); ?>
			</h1>

			<ul class="menu">
				<li<?php if ($menuTab === 'home') echo ' class="active"'; ?>><?php echo $this->Html->link(__d('forum', 'Home'), $settings['url']); ?></li>
				<li<?php if ($menuTab === 'forums') echo ' class="active"'; ?>><?php echo $this->Html->link(__d('forum', 'Forums'), array('controller' => 'forum', 'action' => 'index')); ?></li>
				<li<?php if ($menuTab === 'search') echo ' class="active"'; ?>><?php echo $this->Html->link(__d('forum', 'Search'), array('controller' => 'search', 'action' => 'index')); ?></li>
				<li<?php if ($menuTab === 'rules') echo ' class="active"'; ?>><?php echo $this->Html->link(__d('forum', 'Rules'), array('controller' => 'forum', 'action' => 'rules')); ?></li>
				<li<?php if ($menuTab === 'help') echo ' class="active"'; ?>><?php echo $this->Html->link(__d('forum', 'Help'), array('controller' => 'forum', 'action' => 'help')); ?></li>

				<?php if ($user && $this->Forum->isAdmin()) { ?>
					<li><?php echo $this->Html->link(__d('forum', 'Admin'), array('controller' => 'admin', 'action' => 'index', 'plugin' => 'admin', 'admin' => false)); ?></li>
				<?php } ?>
			</ul>

			<span class="clear"><!-- --></span>
		</div>

		<div class="content">
			<?php echo $this->element('search'); ?>
			<?php echo $this->element('breadcrumbs'); ?>

			<span class="clear"></span>

			<?php echo $this->Session->flash(); ?>
			<?php echo $this->fetch('content'); ?>

			<?php echo $this->element('breadcrumbs'); ?>
		</div>

		<div class="footer">
			<?php echo $this->element('copyright'); ?>
		</div>
	</div>

	<?php if (!CakePlugin::loaded('DebugKit')) {
		echo $this->element('sql_dump');
	} ?>
</body>
</html>

The breadcrumbs.ctp

div class="breadcrumbs">
	<?php echo $this->Html->link($settings['name'], array('controller' => 'forum', 'action' => 'index'));

	if ($crumbs = $this->Breadcrumb->get()) {
		echo ' » ';
		
		$count = count($crumbs) - 1;

		foreach ($crumbs as $i => $crumb) {
			echo $this->Html->link($crumb['title'], $crumb['url'], $crumb['options']);

			if ($count != $i) {
				echo ' » ';
			}
		}
	} ?>
</div>

Dunno what causes it. Any help?

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.