• R/O
  • SSH
  • HTTPS

necosuke-lpo: 提交


Commit MetaInfo

修訂28 (tree)
時間2008-10-06 13:55:20
作者junkikuchi

Log Message

動的なページに一部対応した

Change Summary

差異

--- trunk/application/models/Lpo.php (revision 27)
+++ trunk/application/models/Lpo.php (revision 28)
@@ -17,6 +17,26 @@
1717 $data['created'] = new Zend_Db_Expr('now()');
1818 $data['updated'] = new Zend_Db_Expr('now()');
1919
20+ if(
21+ array_key_exists('landing_url', $data) &&
22+ $data['landing_url'] != 'http://'
23+ ) {
24+ $_url = parse_url($data['landing_url']);
25+ if(!array_key_exists('path', $_url)) {
26+ $data['landing_url'] = $data['landing_url'] . '/';
27+ }
28+ }
29+
30+ if(
31+ array_key_exists('conversion_url', $data) &&
32+ $data['conversion_url'] != 'http://'
33+ ) {
34+ $_url = parse_url($data['conversion_url']);
35+ if(!array_key_exists('path', $_url)) {
36+ $data['conversion_url'] = $data['conversion_url'] . '/';
37+ }
38+ }
39+
2040 return parent::insert($data);
2141 }
2242
@@ -23,6 +43,26 @@
2343 public function update($data, $where) {
2444 $data['updated'] = new Zend_Db_Expr('now()');
2545
46+ if(
47+ array_key_exists('landing_url', $data) &&
48+ $data['landing_url'] != 'http://'
49+ ) {
50+ $_url = parse_url($data['landing_url']);
51+ if(!array_key_exists('path', $_url)) {
52+ $data['landing_url'] = $data['landing_url'] . '/';
53+ }
54+ }
55+
56+ if(
57+ array_key_exists('conversion_url', $data) &&
58+ $data['conversion_url'] != 'http://'
59+ ) {
60+ $_url = parse_url($data['conversion_url']);
61+ if(!array_key_exists('path', $_url)) {
62+ $data['conversion_url'] = $data['conversion_url'] . '/';
63+ }
64+ }
65+
2666 return parent::update($data, $where);
2767 }
2868 }
--- trunk/application/models/Account.php (revision 27)
+++ trunk/application/models/Account.php (revision 28)
@@ -75,6 +75,8 @@
7575 public function getContentRows($url, $ref) {
7676 $ret = array();
7777
78+ $db = Zend_Db_Table_Abstract::getDefaultAdapter();
79+
7880 $lpo_t = new Lpo();
7981 foreach(
8082 $this->findDependentRowset(
@@ -82,7 +84,13 @@
8284 null,
8385 $lpo_t->select()
8486 ->where('status = ?', 'active')
85- ->where('landing_url = ?', $url)
87+ ->where(
88+ sprintf(
89+ 'landing_url = %s OR landing_url = %s',
90+ $db->quote($url),
91+ $db->quote(array_shift(explode('?', $url)))
92+ )
93+ )
8694 ->order('name')
8795 ) as $lpo
8896 ) {
--- trunk/application/controllers/LpoController.php (revision 27)
+++ trunk/application/controllers/LpoController.php (revision 28)
@@ -66,7 +66,7 @@
6666 $this->getResponse()->setHeader('P3P', "CP='UNI CUR OUR'");
6767
6868 $key = $this->getRequest()->getParam('id');
69- $url = array_shift(explode('?', $this->getRequest()->getParam('url')));
69+ $url = $this->getRequest()->getParam('url');
7070 $ref = $this->getRequest()->getParam('ref');
7171
7272 $this->view->callback = $this->getRequest()->getParam('callback');
@@ -81,6 +81,7 @@
8181
8282 /* conversion */
8383 if(!empty($session->landing)) {
84+ $db = Zend_Db_Table_Abstract::getDefaultAdapter();
8485 $lpo_t = new Lpo();
8586 foreach(
8687 $acct->findDependentRowset(
@@ -88,7 +89,13 @@
8889 null,
8990 $lpo_t->select()
9091 ->where('status = ?', 'active')
91- ->where('conversion_url = ?', $url)
92+ ->where(
93+ sprintf(
94+ 'conversion_url = %s OR conversion_url = %s',
95+ $db->quote($url),
96+ $db->quote(array_shift(explode('?', $url)))
97+ )
98+ )
9299 ) as $val
93100 ) {
94101 if(array_key_exists($val->id, $session->landing)) {
Show on old repository browser