Yii Framework Forum: Yiiframework.co.il Code is now open sourced! - Yii Framework Forum

Jump to content

  • (6 Pages)
  • +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 6
  • You cannot start a new topic
  • You cannot reply to this topic

Yiiframework.co.il Code is now open sourced! Rate Topic: ***** 4 Votes

#61 User is offline   SapporoGuy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 177
  • Joined: 25-December 10
  • Location:Sappor Beer Refinery

Posted 27 March 2012 - 11:51 PM

I used the extra db file because the schema.sql was throwing errors.

I can see English and sometimes Hebrew ...

I am having trouble with urls.

I installed osX: 127.0.0.1/~user/yiiframework-co-il-cms/
I changed the settings in the config files but short URLs don't work. :(
0

#62 User is offline   outrage 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 312
  • Joined: 10-November 09
  • Location:Blackpool, United Kingdom

Posted 29 March 2012 - 01:11 PM

View Postdrumaddict, on 30 May 2011 - 08:42 AM, said:

Hi y'all.
Just in case anyone is having a problem with viewing the custom pages (clicking on the magnifying glass) that he creates on admin/custompages .It's probably because the custom URL rule for custom pages ,
[$_more[ "http://<lang:({$rule['language']})>.{$domain}/<alias:({$rule['alias']})>" ] = array('site/custompages/index');[/color][/size]
[size="2"][color="#1c2837"]


is supposed to work only if the config params setting 'subdomain_languages' => true.
If you have set it to false,then you need another URL rule.So in protected/components/CustomUrlManager,just add below this line
$urlrules = array_merge( $_more, $this->rules );       	

one more line:
 $urlrules = array_merge( $urlrules, array(  "<alias:\w+>/*"=>'site/custompages/index') );[/size][/color][/size][/size][/color][/color][/size]
[size="2"][color="#1c2837"][color="#000000"][size="3"][size="2"][color="#1c2837"][size="2"]

.I am not sure if this is the best solution,but made the view links on the management page work.
I think a nice feature missing would be for the end user to manage a menu,and add these custom pages on the menu.
But let's not get greedy,this application is packed with tons of features.


PS in code blocks there is some garbage printing ,all those size color etc-sorry that's not from me,its from the editor.Ignore it,


Thanks for your post, I was also having problems with custom pages.

I made a small change to your solution though to allow urls with dashes like the 'about-us' page.
Use this line instead:

$urlrules = array_merge( $urlrules, array(  "<alias:[0-9a-zA-Z_\-]+>/*"=>'site/custompages/index') );


Note:
Anyone still struggling with the custom pages, please ensure that you edit one of the pages and then submit it (you don't need to make a change).
This will delete the existing url cache and your pages should be viewable.
0

#63 User is offline   outrage 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 312
  • Joined: 10-November 09
  • Location:Blackpool, United Kingdom

Posted 29 March 2012 - 03:12 PM

I find that with language sub-domains set to false, I cannot view the forum or blog posts (Sorry, But the page you were looking for was not found).

It's probably due to the rules in CustomUrlManager.php similar to the above post.

Has anyone figured out how to get them working properly?
0

#64 User is offline   outrage 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 312
  • Joined: 10-November 09
  • Location:Blackpool, United Kingdom

Posted 29 March 2012 - 03:46 PM

View Postoutrage, on 29 March 2012 - 03:12 PM, said:

I find that with language sub-domains set to false, I cannot view the forum or blog posts (Sorry, But the page you were looking for was not found).

It's probably due to the rules in CustomUrlManager.php similar to the above post.

Has anyone figured out how to get them working properly?


OK fixed it myself by simply mirroring the rules used for sub-domains but removing the sub-domain part.

This should make everything work:

else
	{
		$this->rules = array(
				
			//-----------------------ADMIN--------------
			"<lang:({$active_lang})>/admin" => 'admin/index/index',
			"<lang:({$active_lang})>/admin/<_c:([a-zA-z0-9-]+)>" => 'admin/<_c>/index',
		        "<lang:({$active_lang})>/admin/<_c:([a-zA-z0-9-]+)>/<_a:([a-zA-z0-9-]+)>" => 'admin/<_c>/<_a>',
		        "<lang:({$active_lang})>/admin/<_c:([a-zA-z0-9-]+)>/<_a:([a-zA-z0-9-]+)>//*" => 'admin/<_c>/<_a>/',
			//-----------------------ADMIN--------------
				
			"<lang:({$active_lang})>/" => 'site/index/index',
			"<lang:({$active_lang})>/<_c:([a-zA-z0-9-]+)>" => 'site/<_c>/index',
		        "<lang:({$active_lang})>/<_c:([a-zA-z0-9-]+)>/<_a:([a-zA-z0-9-]+)>" => 'site/<_c>/<_a>',
		        "<lang:({$active_lang})>/<_c:([a-zA-z0-9-]+)>/<_a:([a-zA-z0-9-]+)>//*" => 'site/<_c>/<_a>/',
					
			// Site Map
			"http://{$domain}/sitemap" => array('site/sitemap/index', 'urlSuffix'=>'.xml', 'caseSensitive'=>false),
					
			// Tutorials
			"http://{$domain}/tutorials/category/<alias:(.*)>" => array('site/tutorials/viewcategory'),
			"http://{$domain}/tutorials/view/<alias:(.*)>" => array('site/tutorials/viewtutorial'),
					
			// Blogs
			"http://{$domain}/blog/category/<alias:(.*)>" => array('site/blog/viewcategory'),
			"http://{$domain}/blog/view/<alias:(.*)>" => array('site/blog/viewpost'),
					
			// Extensions
			"http://{$domain}/extensions/category/<alias:(.*)>" => array('site/extensions/viewcategory'),
			"http://{$domain}/extensions/view/<alias:(.*)>" => array('site/extensions/viewpost'),
			"http://{$domain}/extensions/download/<fileid:(\d+)>-<alias:(.*)>" => array('site/extensions/download'),
					
			// User profile
			"http://{$domain}/user/<uid:(\d+)>-<alias:(.*)>" => array('site/users/viewprofile'),
					
			// Forum Topics
			"http://{$domain}/forum/topic/<topicid:(\d+)>-<alias:(.*?)>/*" => array('site/forum/viewtopic'),
					
					
	            
		);
	}
		
	$urlrules = array_merge( $_more, $this->rules );
	$urlrules = array_merge( $urlrules, array(  "<alias:[0-9a-zA-Z_\-]+>/*"=>'site/custompages/index') );
	Yii::app()->cache->set('customurlrules', $urlrules);


Again, after editing this file, edit and save one of the custom pages in the admin section to refresh the custom url cache.
0

#65 User is offline   SapporoGuy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 177
  • Joined: 25-December 10
  • Location:Sappor Beer Refinery

Posted 30 March 2012 - 02:27 AM

Can you use this on local host ?
If yes, how?
0

#66 User is offline   outrage 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 312
  • Joined: 10-November 09
  • Location:Blackpool, United Kingdom

Posted 30 March 2012 - 05:59 AM

View PostSapporoGuy, on 30 March 2012 - 02:27 AM, said:

Can you use this on local host ?
If yes, how?


I didn't manage to get this working on localhost. Had problems with the captcha.
It's easy to setup as a virtual host though, just follow the instructions here:

http://sawmac.com/xampp/virtualhosts/
0

#67 User is offline   SapporoGuy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 177
  • Joined: 25-December 10
  • Location:Sappor Beer Refinery

Posted 01 April 2012 - 02:00 PM

ugh!!!!

ok, created a virtual host:
http://yiiframework.local/

then go to change language:
http://yiiframework.local/en
error:
The requested URL /en was not found on this server.


here's my index file:

<?php

// change the following paths if necessary
$yii=dirname(__FILE__).'/framework/yiilite.php';
$config=dirname(__FILE__).'/protected/config/';
// Define root directory
defined('ROOT_PATH') or define('ROOT_PATH', dirname(__FILE__) . '/');

// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG', false);

if( YII_DEBUG === true )
{
	ini_set('display_errors', true);
	error_reporting(E_ALL);
	
	// By default we use testing.com for the currently active domain
#	define('CURRENT_ACTIVE_DOMAIN', 'http://127.0.0.1/~lime/yiiframework-co-il-cms/');
	define('CURRENT_ACTIVE_DOMAIN', 'http://yiiframework.local/');
}
else
{
	//ini_set('display_errors', false);
	//error_reporting(0);
	ini_set('display_errors', true);
	error_reporting(E_ALL);
	
	// On production it will be the yiiframework.co.il domain name
#	define('CURRENT_ACTIVE_DOMAIN', 'http://127.0.0.1/~lime/yiiframework-co-il-cms/');
	define('CURRENT_ACTIVE_DOMAIN', 'http://yiiframework.local/');
}

$configFile = YII_DEBUG ? 'dev.php' : 'production.php';

require_once($yii);
Yii::createWebApplication($config . $configFile)->run();

0

#68 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 01 April 2012 - 10:57 PM

That probably caused due to wrong URL rules. The index looks fine.

This is kinda hard for me to maintain so if anyone is interested i can put this up on github and provide access for others to contribute.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#69 User is offline   SapporoGuy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 177
  • Joined: 25-December 10
  • Location:Sappor Beer Refinery

Posted 02 April 2012 - 12:50 AM

Where can I find the section that does the rules?

I really like the demo :(
0

#70 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 02 April 2012 - 10:07 AM

protected/components/CustomUrlManager.php
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#71 User is offline   SapporoGuy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 177
  • Joined: 25-December 10
  • Location:Sappor Beer Refinery

Posted 02 April 2012 - 11:38 AM

Ok, getting closer!
CustomUrlManager is not giving a result for $urlrules.
The check is just skipping the If and returning an array for that string.

Using print_r ( $urlrules ) ;

So, yiiframework.local/en/... or even yiifreamework.local/documentation/guide/... is broken.

I checked for mod_rewrite and all the stuff too
0

#72 User is offline   SapporoGuy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 177
  • Joined: 25-December 10
  • Location:Sappor Beer Refinery

Posted 02 April 2012 - 12:21 PM

Solved!!!

I was right and wrong!
Urls were not working because htaccess wasn't working!
AllowOverride was set to None and not All in httpd.conf
0

#73 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 02 April 2012 - 12:23 PM

Glad you got it working.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#74 User is offline   SapporoGuy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 177
  • Joined: 25-December 10
  • Location:Sappor Beer Refinery

Posted 02 April 2012 - 12:39 PM

So am i!

I had to use a stock yii htaccess to get in since your htaccess was giving me forbidden errors

I can see the site and navigate but:
Can't get to admin :: CException error - not allowed to enter this section
Login (menu) :: using the rmail from the db, and admin as password, capthcha >> error is CSRF token could jot be verified (( I'm not connected to the net ))
0

#75 User is offline   outrage 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 312
  • Joined: 10-November 09
  • Location:Blackpool, United Kingdom

Posted 02 April 2012 - 01:59 PM

View PostVince., on 01 April 2012 - 10:57 PM, said:

That probably caused due to wrong URL rules. The index looks fine.

This is kinda hard for me to maintain so if anyone is interested i can put this up on github and provide access for others to contribute.


Hi Vince,

I understand that you have commitments and can't maintain this yourself at the moment. I'm just glad that you were prepared to share your code with us.

It's a great idea to let others contribute. I'm sure there will be a huge interest in this project since it's what a lot of people have been asking for in the forums for years and you've done a great job.

Thanks again!
0

#76 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 02 April 2012 - 02:07 PM

@sapporoguy see if this helps for the second problem:
http://www.yiiframew...dpost__p__99346

For the first one try using the User:hashPassword('yourpassword', 'emailaddress');

to get a new password and then just update the user record and paste the new password. Make sure the email you used in the hashPassword method matches the user email address in the db.


@outrage No problem. I'll work on adding it to github
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#77 User is offline   SapporoGuy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 177
  • Joined: 25-December 10
  • Location:Sappor Beer Refinery

Posted 02 April 2012 - 02:43 PM

still learning iii: where should I do: "User:hashPassword('yourpassword', 'emailaddress');"

Here is the htaccess that I used to get a working site:
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on

# if a directory or a file exists, use it directly
# RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
 RewriteRule . index.php

0

#78 User is offline   Vince. 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 432
  • Joined: 29-December 08
  • Location:Los Angeles,CA

Posted 02 April 2012 - 03:28 PM

anywhere, just put it somewhere in the views so you'll get a pass hash that you'll put in the db for the user you are trying to access with. This is just a hack so you'll be able to login.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image
0

#79 User is offline   SapporoGuy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 177
  • Joined: 25-December 10
  • Location:Sappor Beer Refinery

Posted 02 April 2012 - 04:31 PM

OK, I added

<?php echo User:hashPassword('yourpassword', 'emailaddress'); ?>


to the index view.

I tried with the above and with real information but still got:

Parse error: parse error, expecting `','' or `';'' in /Users/lime/Sites/yiiframework/protected/modules/site/views/index/index.php on line 1 Call Stack: 0.0004 641248 1. {main}()

And a bunch more errors :(

dude, really sorry I keep bugging you about this!

If you're really in LA, I'll buy you a beer when I go back in June :D
0

#80 User is offline   Chris-S 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 32
  • Joined: 08-January 12
  • Location:Ohio

Posted 02 April 2012 - 05:21 PM

We have a working demo here in english: http://goarc.org/yii

Most of the pages do not function properly, did I miss something?

Nvm, the issue was with .htaccess d'oh!
ARC cms - www.goarc.org
Yii based cms with mybb forum software integrated!
0

Share this topic:


  • (6 Pages)
  • +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 6
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users