Index: branches/RC/themes/default2009/in-link/module_info.xml =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/module_info.xml (revision 12746) +++ branches/RC/themes/default2009/in-link/module_info.xml (revision 0) @@ -1,5 +0,0 @@ - - - in-link/designs/section - in-link/designs/detail - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/designs/standard.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/designs/standard.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/designs/standard.tpl (revision 0) @@ -1,490 +0,0 @@ - - - - - - - - - -
-
- -
-
- -
-
- -
-
-
- - - - -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - -
- img/link_icon.gif" width="16" height="23" alt="" /> - - - - " target="_blank"> - - - img/icon_hot.gif" alt=""/> - img/icon_new.gif" alt=""/> - img/icon_popular.gif" alt=""/> - img/icon_pick.gif" alt=""/> - img/icon_favorite.gif" alt=""/> - - -
- - - : , - : , - : , - : , - : - -
- - - - - - -
- - " class="thickbox" rel="link-images" title=""> -
-
- -
-
-
- - -

- - img/ic_removefromfav.gif" width="11" height="10" alt="" /> - - img/ic_addtofav.gif" width="11" height="10" alt="" /> "> - - -
-
- - - - - - -
- " class="thickbox" rel="link-images" title=""> - " title="" alt="" border="0" />
-
-
- img/s.gif" width="8" height="1" alt="" /> -
- - - -
-

-
- - - - - - - - - - -
-

-
- - -
- - - - - - - -
tab-bottom-line tab-bottom-line "> - - - - - - - - - - - - - - - - - - - - - -
inactive-tabactive-tab"> -   - inactive-tabactive-tab"> -  
- -
tab-bottom-content tab-bottom-content "> - - - -
style="display:none" - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- img/s.gif" width="3" height="1" alt=""/>
-
- img/s.gif" width="3" height="1" alt=""/>
-
- : - - -
-
img/s.gif" width="3" height="1" alt=""/>
-
- : - - -
-
img/s.gif" width="3" height="1" alt=""/>
-
- : - - -
-
img/s.gif" width="3" height="1" alt=""/>
-
- : - - -
-
img/s.gif" width="3" height="1" alt=""/>
-
- : - - -
-
img/s.gif" width="3" height="1" alt=""/>
-
- : - - -
-
img/s.gif" width="3" height="1" alt=""/>
-
- -
-
img/s.gif" width="3" height="1" alt=""/>
-
-
- - - - - - - - - - - -
-
-
- - - -
display:none"> -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
-
- - - - - - " class="input-text" style="" value=""> - - " class="input-text" style="" value=""/> - - - "/> -
- - - -
-
- - " alt=""/>
- img/s.gif" width="1" height="5" alt=""/>
- " value="" tabindex="" style=""> - "/> -
- - - - "/> - "/> -
-
-
-
- - -
- - - - - -
- -
- - - - - - - - () - - - - -
- - -
- -
- -
- - - - - - - - - -
-
- - - - -
- - - - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/designs/detail.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/designs/detail.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/designs/detail.tpl (revision 0) @@ -1,8 +0,0 @@ - - - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/designs/paid.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/designs/paid.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/designs/paid.tpl (revision 0) @@ -1,490 +0,0 @@ - - - - - - - - - -
-
- -
-
- -
-
- -
-
-
- - - - -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - -
- img/link_icon.gif" width="16" height="23" alt="" /> - - - - " target="_blank"> - - - img/icon_hot.gif" alt=""/> - img/icon_new.gif" alt=""/> - img/icon_popular.gif" alt=""/> - img/icon_pick.gif" alt=""/> - img/icon_favorite.gif" alt=""/> - - -
- - - : , - : , - : , - : , - : - -
- - - - - - -
- - " class="thickbox" rel="link-images" title=""> -
-
- -
-
-
- - -

- - img/ic_removefromfav.gif" width="11" height="10" alt="" /> - - img/ic_addtofav.gif" width="11" height="10" alt="" /> "> - - -
-
- - - - - - -
- " class="thickbox" rel="link-images" title=""> - " title="" alt="" border="0" />
-
-
- img/s.gif" width="8" height="1" alt="" /> -
- - - -
-

-
- - - - - - - - - - -
-

-
- - -
- - - - - - - -
tab-bottom-line tab-bottom-line "> - - - - - - - - - - - - - - - - - - - - - -
inactive-tabactive-tab"> -   - inactive-tabactive-tab"> -  
- -
tab-bottom-content tab-bottom-content "> - - - -
style="display:none" - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- img/s.gif" width="3" height="1" alt=""/>
-
- img/s.gif" width="3" height="1" alt=""/>
-
- : - - -
-
img/s.gif" width="3" height="1" alt=""/>
-
- : - - -
-
img/s.gif" width="3" height="1" alt=""/>
-
- : - - -
-
img/s.gif" width="3" height="1" alt=""/>
-
- : - - -
-
img/s.gif" width="3" height="1" alt=""/>
-
- : - - -
-
img/s.gif" width="3" height="1" alt=""/>
-
- : - - -
-
img/s.gif" width="3" height="1" alt=""/>
-
- -
-
img/s.gif" width="3" height="1" alt=""/>
-
-
- - - - - - - - - - - -
-
-
- - - -
display:none"> -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
-
- - - - - - " class="input-text" style="" value=""> - - " class="input-text" style="" value=""/> - - - "/> -
- - - -
-
- - " alt=""/>
- img/s.gif" width="1" height="5" alt=""/>
- " value="" tabindex="" style=""> - "/> -
- - - - "/> - "/> -
-
-
-
- - -
- - - - - -
- -
- - - - - - - - () - - - - -
- - -
- -
- -
- - - - - - - - - -
-
- - - - -
- - - - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/designs/.smsignore =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/designs/.smsignore (revision 12746) +++ branches/RC/themes/default2009/in-link/designs/.smsignore (revision 0) @@ -1 +0,0 @@ -.*\.tpl \ No newline at end of file Index: branches/RC/themes/default2009/in-link/designs/section.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/designs/section.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/designs/section.tpl (revision 0) @@ -1,96 +0,0 @@ - - - - - - - - - -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
- - - - -
-
- -
-
- - - -
-
- - - - - - () - - - - - - - - -
- - -
- -
-
- - - - - -
- - - - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/my_account/my_links.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/my_account/my_links.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/my_account/my_links.tpl (revision 0) @@ -1,62 +0,0 @@ - - - - - - - - - - - - -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - - () - - - - - - - img/s.gif" width="1" height="10" alt="" />
- - - -
- - -
- -
-
-
- - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/my_account/my_items.elm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/my_account/my_items.elm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/my_account/my_items.elm.tpl (revision 0) @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/new_links.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/new_links.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/new_links.tpl (revision 0) @@ -1,65 +0,0 @@ - - - - - - - - - - -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - () - - - - - - - - -
- - -
-
-
-
- - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/enhancements/cancel_enhancement_confirm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/enhancements/cancel_enhancement_confirm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/enhancements/cancel_enhancement_confirm.tpl (revision 0) @@ -1,87 +0,0 @@ - - - - - - - - - - - - -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - - - -
- - - - - - - - - - - - -
-

-
- -
-
- - " /> - - " /> -
-
-
- -
-
-
- - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/enhancements/enhance_link.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/enhancements/enhance_link.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/enhancements/enhance_link.tpl (revision 0) @@ -1,102 +0,0 @@ - - - - - - - - - - - - -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - - - - - - -

-
- -
"> - - - - - - - - - - - - - -
43"> -
img/s.gif" width="1" height="1" alt="" />
-
- - - - - -
- - - - "/> - "/> - - - - - -
-
-
-
-
-
- - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/enhancements/extend_enhancement_confirm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/enhancements/extend_enhancement_confirm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/enhancements/extend_enhancement_confirm.tpl (revision 0) @@ -1,92 +0,0 @@ - - - - - - - - - - - - -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - - - -
- - - - - - - - - - - - -
-

-
- -
-
- - - " /> - - - " /> - - - " /> -
-
-
- -
-
-
- - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/enhancements/enhance_confirm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/enhancements/enhance_confirm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/enhancements/enhance_confirm.tpl (revision 0) @@ -1,49 +0,0 @@ - - - - - - - - - - -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - - -

- "> -
- -
-
-
- - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/enhancements/extend_enhancement.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/enhancements/extend_enhancement.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/enhancements/extend_enhancement.tpl (revision 0) @@ -1,94 +0,0 @@ - - - - - - - - - - - - -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - - - - - - - - - - - - -
- : - - -
- : - - -
-
- - - ');" value=""/> - - - -
- , - "> - - - ');" value=""/> -
-
- -
-
-
- - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/enhancements/enhancement_details.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/enhancements/enhancement_details.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/enhancements/enhancement_details.tpl (revision 0) @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - : -
- - -
-
-
- - : -
- - - : -
-
-
- -
- - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/hot_links.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/hot_links.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/hot_links.tpl (revision 0) @@ -1,67 +0,0 @@ - - - - - - - - - - -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - - () - - - - - - - - -
- - -
- -
-
-
- - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/modify_link.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/modify_link.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/modify_link.tpl (revision 0) @@ -1,122 +0,0 @@ - - - - - - - - - - -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - - - - *

- - - - - - img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "> - - - - - - - - - "/> - "/> - -
-
- -
-
- -
- - - - () - - "> - - "> - -
-
- - -
-
- -
-
-
- - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/search_results.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/search_results.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/search_results.tpl (revision 0) @@ -1,98 +0,0 @@ - - - - - - - - - - -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
- - - -
-
- -
-
- - - - - () - - - - - - - - - -
- Did you mean: -
-
- - - - - - -
  • -
    - - -
    -

    Narrow Search By

    -
      - -
    -
    -
    -
    - - - - - - - -
    - - -
    -
    -
    -
    - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/add_review_confirm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/add_review_confirm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/add_review_confirm.tpl (revision 0) @@ -1,49 +0,0 @@ - - - - - - - - - - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - - - -
    -
    - -
    -
    - - - - - - -

    - "> -
    - -
    -
    -
    - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/pop_links.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/pop_links.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/pop_links.tpl (revision 0) @@ -1,65 +0,0 @@ - - - - - - - - - - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - - - -
    -
    - -
    -
    - - - - - () - - - - - - - - -
    - - -
    -
    -
    -
    - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/pick_links.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/pick_links.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/pick_links.tpl (revision 0) @@ -1,65 +0,0 @@ - - - - - - - - - - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - - - -
    -
    - -
    -
    - - - - - () - - - - - - - - -
    - - -
    -
    -
    -
    - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/modify_pending_confirm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/modify_pending_confirm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/modify_pending_confirm.tpl (revision 0) @@ -1,49 +0,0 @@ - - - - - - - - - - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - - - -
    -
    - -
    -
    - - - - - - -

    - "> -
    - -
    -
    -
    - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/modify_confirm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/modify_confirm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/modify_confirm.tpl (revision 0) @@ -1,49 +0,0 @@ - - - - - - - - - - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - - - -
    -
    - -
    -
    - - - - - - -

    - "> -
    - -
    -
    -
    - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/add_review.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/add_review.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/add_review.tpl (revision 0) @@ -1,152 +0,0 @@ - - - - - - - - - - - - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - - - -
    -
    - -
    -
    - - - - - - - - -
    - - - - - - -
    - img/link_icon.gif" width="16" height="23" alt="" /> - - - - - img/icon_hot.gif" alt=""/> - img/icon_new.gif" alt=""/> - img/icon_popular.gif" alt=""/> - img/icon_pick.gif" alt=""/> - img/icon_favorite.gif" alt=""/> - - -
    - - - : , - : , - : , - : , - : - -
    - - - - - - -
    - - " class="thickbox" rel="link-images" title=""> -
    -
    - -
    -
    -
    - " onclick="open_window('', 'new_window', '800', '600');"/>

    - -

    - - img/ic_removefromfav.gif" width="11" height="10" alt="" /> - - img/ic_addtofav.gif" width="11" height="10" alt="" /> "> - - -
    -
    -
    - -
    - -
    - - - - - - - - - - - - -
    - - - - *

    - - - - - - img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />

    - -
    - - - - - - - - " /> - -
    -
    -
    - - -
    -
    - -
    -
    -
    - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/suggest_confirm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/suggest_confirm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/suggest_confirm.tpl (revision 0) @@ -1,47 +0,0 @@ - - - - - - - - - - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - - - -
    -
    - -
    -
    - - - - - -

    - "> -
    -
    -
    -
    - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/add_review_pending_confirm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/add_review_pending_confirm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/add_review_pending_confirm.tpl (revision 0) @@ -1,49 +0,0 @@ - - - - - - - - - - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - - - -
    -
    - -
    -
    - - - - - - -

    - "> -
    - -
    -
    -
    - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/suggest_link.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/suggest_link.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/suggest_link.tpl (revision 0) @@ -1,111 +0,0 @@ - - - - - - - - - - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - - - -
    -
    - -
    -
    - - - - - - - - - *

    - - - - - - img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />

    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - "> - - - - - - - - - - "/> - "/> - -


    - -
    -
    - - - - - -
    -
    -
    - - -
    -
    - -
    -
    -
    - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/links/suggest_pending_confirm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/links/suggest_pending_confirm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/links/suggest_pending_confirm.tpl (revision 0) @@ -1,49 +0,0 @@ - - - - - - - - - - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    - - - -
    -
    - -
    -
    - - - - - - -

    - "> -
    - -
    -
    -
    - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/img/menu_links.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/themes/default2009/in-link/img/ic_mylinks46.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/themes/default2009/in-link/inc/googlemaps.js =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/inc/googlemaps.js (revision 12746) +++ branches/RC/themes/default2009/in-link/inc/googlemaps.js (revision 0) @@ -1,29 +0,0 @@ -google.load("maps", "2.x"); - -// Call this function when the page has been loaded -function initialize() { - map = new google.maps.Map2(document.getElementById("map")); - map.setCenter(new google.maps.LatLng(37.4419, -122.1419), 13); - map.addControl(new GSmallMapControl()); - map.addControl(new GMapTypeControl()); -} - -var map = false; -function showaddress(addr,addrInfo) { - if (!map) initialize(); - geocoder = new google.maps.ClientGeocoder(); - geocoder.getLatLng( - addr, - function(point) { - if (!point) { - alert(addr + " not found"); - } else { - map.setCenter(point, 13); - var marker = new GMarker(point); - map.clearOverlays(); - map.addOverlay(marker); - marker.openInfoWindowHtml(addrInfo); - } - } - ); -} \ No newline at end of file Index: branches/RC/themes/default2009/in-link/inc/styles.css =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/inc/styles.css (revision 12746) +++ branches/RC/themes/default2009/in-link/inc/styles.css (revision 0) @@ -1 +0,0 @@ -/* --- Listing Element Styles --- */ Index: branches/RC/themes/default2009/in-link/elements/html_head.elm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/elements/html_head.elm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/elements/html_head.elm.tpl (revision 0) @@ -1,11 +0,0 @@ -inc/styles.css" type="text/css" /> - - - - - - - - - - Index: branches/RC/themes/default2009/in-link/elements/visit_link.elm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/elements/visit_link.elm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/elements/visit_link.elm.tpl (revision 0) @@ -1 +0,0 @@ - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/elements/sorting.elm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/elements/sorting.elm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/elements/sorting.elm.tpl (revision 0) @@ -1,42 +0,0 @@ - - - - - -
    - :  |  : - - : -
    -img/s.gif" width="1" height="4" alt="" />
    -img/grey_pix.gif" width="100%" height="1" alt="" />
    -
    - - - - - -
    -
    - : - - - - " value="" /> - -
    - -img/s.gif" width="1" height="10" alt="" />
    \ No newline at end of file Index: branches/RC/themes/default2009/in-link/elements/content_boxes/search_results.elm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/elements/content_boxes/search_results.elm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/elements/content_boxes/search_results.elm.tpl (revision 0) @@ -1,27 +0,0 @@ - - - - - () - - - - - - - -
    - -
    img/s.gif" width="1" height="1" alt="" />
    - - - - - - - img/s.gif" width="1" height="5" alt="" />
    - ">... -
    - - -
    \ No newline at end of file Index: branches/RC/themes/default2009/in-link/elements/content_boxes/related_items.elm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/elements/content_boxes/related_items.elm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/elements/content_boxes/related_items.elm.tpl (revision 0) @@ -1,6 +0,0 @@ - - - - -
    - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/elements/content_boxes/home_page_items.elm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/elements/content_boxes/home_page_items.elm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/elements/content_boxes/home_page_items.elm.tpl (revision 0) @@ -1,21 +0,0 @@ - - - - - - - - - - - -
    - - -
    - ">...
    -
    -
    - - -
    \ No newline at end of file Index: branches/RC/themes/default2009/in-link/elements/content_boxes/my_favorites.elm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/elements/content_boxes/my_favorites.elm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/elements/content_boxes/my_favorites.elm.tpl (revision 0) @@ -1,21 +0,0 @@ - - - - - - () - - - - - - -
    - - - - - - -
    - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/elements/links.elm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/elements/links.elm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/elements/links.elm.tpl (revision 0) @@ -1,244 +0,0 @@ - - - - - -
    img/s.gif" width="1" height="1" alt="" />
    - - - - - -
    - -
    -
    - " title=""> -
    - " class="text-title"> - - img/icon_hot.gif" alt=""/> - img/icon_new.gif" alt=""/> - img/icon_popular.gif" alt=""/> - img/icon_pick.gif" alt=""/> - img/icon_favorite.gif" alt=""/> - - -
    - - : , - : , - : , - : , - : - - - - - - -
    - - img/ic_removefromfav.gif" width="11" height="10" alt="" /> - - img/ic_addtofav.gif" width="11" height="10" alt="" /> "> - - -  |  - - img/reviews.gif" width="14" height="10" alt="" /> "> - -

    - - img/s.gif" width="1" height="4" alt="" />
    - - - -
    - -
    - - - - - - img/link_icon.gif" width="16" height="23" alt="" /> - " class="text-title"> - - - - - - - -
    img/s.gif" width="1" height="1" alt="" />
    - - - - - -
    - " title="">
    -
    - "> (OrgId: ) - - img/icon_hot.gif" alt=""/> - img/icon_new.gif" alt=""/> - img/icon_popular.gif" alt=""/> - img/icon_pick.gif" alt=""/> - img/icon_favorite.gif" alt=""/> - - -
    - - : , - : , - : , - : , - : -
    - - :
    - - - -

    - - - - - - - - - - - - - - - - -
    - img/ic_details.gif" width="14" height="13" alt="" /> "> - -  |  img/ic_edit.gif" width="11" height="10" alt="" /> "> - -  |  img/ic_edit.gif" width="11" height="10" alt="" /> - - "> - - "> - - -  |  img/ic_delete.gif" width="11" height="10" alt="" /> " onclick="return confirm('');"> -
    -
    - -
    - - - - - - "> - - - - - - - - - - - - - -
    img/s.gif" width="1" height="1" alt="" />
    - - - - - -
    - -
    -
    - " title=""> -
    - " class="text-title"> - - img/icon_hot.gif" alt=""/> - img/icon_new.gif" alt=""/> - img/icon_popular.gif" alt=""/> - img/icon_pick.gif" alt=""/> - img/icon_favorite.gif" alt=""/> - - -
    - - :
    - : , - : , - : , - : -

    -
    - -
    - - - - - -
    img/s.gif" width="1" height="1" alt="" />
    - - - - - -
    - -
    -
    - " title=""> -
    - " class="text-title"> - - img/icon_hot.gif" alt=""/> - img/icon_new.gif" alt=""/> - img/icon_popular.gif" alt=""/> - img/icon_pick.gif" alt=""/> - img/icon_favorite.gif" alt=""/> - - -
    - - : , - : , - : , - : , - : - - - - - - -
    - - img/ic_removefromfav.gif" width="11" height="10" alt="" /> - - img/ic_addtofav.gif" width="11" height="10" alt="" /> "> - - -  |  - - img/reviews.gif" width="14" height="10" alt="" /> "> - - -
    - -
    - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/elements/side_boxes/quick_search.elm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/elements/side_boxes/quick_search.elm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/elements/side_boxes/quick_search.elm.tpl (revision 0) @@ -1,30 +0,0 @@ - - - - -
    "> - - - - -
    - -
    - -
    - !" /> - - -
    \ No newline at end of file Index: branches/RC/themes/default2009/in-link/elements/side_boxes/new.elm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/elements/side_boxes/new.elm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/elements/side_boxes/new.elm.tpl (revision 0) @@ -1,18 +0,0 @@ - - - - - "> () - - - - - - "> - - - - -
    - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/elements/side_boxes/pick.elm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/elements/side_boxes/pick.elm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/elements/side_boxes/pick.elm.tpl (revision 0) @@ -1,18 +0,0 @@ - - - - - "> () - - - - - - "> - - - - -
    - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/elements/side_boxes/pop.elm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/elements/side_boxes/pop.elm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/elements/side_boxes/pop.elm.tpl (revision 0) @@ -1,18 +0,0 @@ - - - - - "> () - - - - - - "> - - - - -
    - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/elements/side_boxes/hot.elm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/elements/side_boxes/hot.elm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/elements/side_boxes/hot.elm.tpl (revision 0) @@ -1,18 +0,0 @@ - - - - - "> () - - - - - - "> - - - - -
    - - \ No newline at end of file Index: branches/RC/themes/default2009/in-link/elements/side_boxes/action_box.elm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/elements/side_boxes/action_box.elm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/elements/side_boxes/action_box.elm.tpl (revision 0) @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - "> - - - -
    - - "> -
    Index: branches/RC/themes/default2009/in-link/elements/.smsignore =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/elements/.smsignore (revision 12746) +++ branches/RC/themes/default2009/in-link/elements/.smsignore (revision 0) @@ -1 +0,0 @@ -.*\.xml\.tpl \ No newline at end of file Index: branches/RC/themes/default2009/in-link/elements/enhancements.elm.tpl =================================================================== diff -u -N --- branches/RC/themes/default2009/in-link/elements/enhancements.elm.tpl (revision 12746) +++ branches/RC/themes/default2009/in-link/elements/enhancements.elm.tpl (revision 0) @@ -1,51 +0,0 @@ - - - - - - - 43"> -
    img/s.gif" width="1" height="1" alt="" />
    - - - - - - " value="" checked="checked"/> - - - " onclick="return open_window(this.href, 'listing_details', 545, 420);"> - - - - - - - - - - - - - - - - -
    - - - - - " name="" id="_" value=""> - - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/install/prerequisites.php =================================================================== diff -u -N --- branches/5.0.x/in-link/install/prerequisites.php (revision 12746) +++ branches/5.0.x/in-link/install/prerequisites.php (revision 0) @@ -1,79 +0,0 @@ -_toolkit =& $instance; - } - - /** - * Checks minimal version, that could be upgradeable - * - * @param string $mode when called mode {install, standalone, upgrade) - */ - function CheckPrerequisites($versions, $mode) - { - $errors = Array (); - - if ($mode == 'standalone') { - if (!$this->Application->isModuleEnabled('In-Portal')) { - $errors[] = 'Please install or enable "In-Portal" module first'; - } - } - - if ($mode == 'upgrade') { - $sql = 'SELECT Version - FROM ' . TABLE_PREFIX . 'Modules - WHERE Name = "In-Portal"'; - $inportal_version = $this->Conn->GetOne($sql); - - if ($inportal_version === false) { - // only, when In-Portal was installed - return $errors; - } - - $min_version = '4.3.1'; - - $current_version = $this->_toolkit->ConvertModuleVersion($inportal_version); - $needed_version = $this->_toolkit->ConvertModuleVersion($min_version); - if ($current_version < $needed_version) { - $errors[] = 'Please upgrade "In-Portal" to version ' . $min_version; - } - } - - return $errors; - } - } \ No newline at end of file Index: branches/5.0.x/in-link/install/install_data.sql =================================================================== diff -u -N --- branches/5.0.x/in-link/install/install_data.sql (revision 12746) +++ branches/5.0.x/in-link/install/install_data.sql (revision 0) @@ -1,305 +0,0 @@ -INSERT INTO ConfigurationAdmin VALUES ('Link_SortField', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_opt_CreatedOn,Hits=la_Link_Hits,CachedRating=la_opt_Rating,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 4) AND (IsSystem = 0)', 10.01, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.01, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortField2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_opt_CreatedOn,Hits=la_Link_Hits,CachedRating=la_opt_Rating,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 4) AND (IsSystem = 0)', 10.02, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.02, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links', 'la_Text_Links', 'la_link_perpage_prompt', 'text', '', '', 10.03, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_NewDays', 'la_Text_Links', 'la_link_newdays_prompt', 'text', '', '', 10.05, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MinPopRating', 'la_Text_Links', 'la_fld_Link_MinPopRating', 'text', '', '', 10.06, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MaxHotNumber', 'la_Text_Links', 'la_fld_Link_MaxHotNumber', 'text', '', '', 10.08, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_EnhancedLinks', 'la_Text_Links', 'la_link_EnhancedLinks', 'checkbox', '', '', 10.09, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_AllowFreeListings', 'la_Text_Links', 'la_link_AllowFreeListings', 'checkbox', '', '', 10.1, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ShowPick', 'la_Text_Links', 'la_link_editorspick_prompt', 'checkbox', '', '', 10.11, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_UrlStatus', 'la_Text_Links', 'la_link_urlstatus_prompt', 'checkbox', '', '', 10.12, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'ReviewText=la_opt_CommentText,CreatedOn=la_opt_CreatedOn', 20.01, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'asc=la_common_Ascending,desc=la_common_Descending', 20.01, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'ReviewText=la_opt_CommentText,CreatedOn=la_opt_CreatedOn', 20.02, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'asc=la_common_Ascending,desc=la_common_Descending', 20.02, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MinPopVotes', 'la_Text_Links', 'la_fld_Link_MinPopVotes', 'text', '', '', 10.07, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_LinkReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 20.03, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_LinkReviews_Short', 'la_Text_Reviews', 'la_review_perpage_short_prompt', 'text', NULL, NULL, 20.04, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links_Short', 'la_Text_Links', 'la_link_perpage_short_prompt', 'text', '', '', 10.04, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Name', 'la_Text_Link_Search', 'la_Link_Name', 'checkbox', '', '', 2, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Description', 'la_Text_Link_Search', 'la_Link_Description', 'checkbox', '', '', 1, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Url', 'la_Text_Link_Search', 'la_Link_Url', 'checkbox', '', '', 5, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CreatedOn', 'la_Text_Link_Search', 'la_Link_CreatedOn', 'checkbox', '', '', 5, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Hits', 'la_Text_Link_Search', 'la_Link_Hits', 'checkbox', '', '', 6, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedRating', 'la_Text_Link_Search', 'la_Link_CatchedRating', 'checkbox', '', '', 7, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedVotesQty', 'la_Text_Link_Search', 'la_Link_CatchedVotesQty', 'checkbox', '', '', 8, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedReviewsQty', 'la_Text_Link_Search', 'la_Link_CatchedReviewsQty', 'checkbox', '', '', 9, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Value', 'la_Text_Links', 'la_prompt_DupReviews', 'text', '', 'style="width: 50px;"', 10.13, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Interval', 'la_Text_Links', 'la_prompt_DupReviews', 'select', '', '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year', 10.13, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Value', 'la_Text_Links', 'la_prompt_DupRating', 'text', '', 'style="width: 50px;"', 10.14, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Interval', 'la_Text_Links', 'la_prompt_DupRating', 'select', '', '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year', 10.14, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('l_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 30.01, 0, 0); -INSERT INTO ConfigurationAdmin VALUES ('l_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 30.02, 0, 0); -INSERT INTO ConfigurationAdmin VALUES ('l_MaxImageCount', 'la_section_ImageSettings', 'la_config_MaxImageCount', 'text', '', '', 40.01, 0, 0); -INSERT INTO ConfigurationAdmin VALUES ('l_ThumbnailImageWidth', 'la_section_ImageSettings', 'la_config_ThumbnailImageWidth', 'text', '', '', 40.02, 0, 0); -INSERT INTO ConfigurationAdmin VALUES ('l_ThumbnailImageHeight', 'la_section_ImageSettings', 'la_config_ThumbnailImageHeight', 'text', '', '', 40.03, 0, 0); -INSERT INTO ConfigurationAdmin VALUES ('l_FullImageWidth', 'la_section_ImageSettings', 'la_config_FullImageWidth', 'text', '', '', 40.04, 0, 0); -INSERT INTO ConfigurationAdmin VALUES ('l_FullImageHeight', 'la_section_ImageSettings', 'la_config_FullImageHeight', 'text', '', '', 40.05, 0, 0); - -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_links', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_links', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_links', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_links', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_links', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 0, 1); - -INSERT INTO ConfigurationAdmin VALUES ('l_MaxCategories', 'la_Text_Links', 'la_fld_MaxCategories', 'text', NULL, NULL, 10.15, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('l_EnableGoogleMaps', 'la_Text_Links', 'la_fld_LinkEnableGoogleMaps', 'checkbox', NULL, NULL, 10.16, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('l_GoogleMapsAPIKey', 'la_Text_Links', 'la_fld_LinkGoogleMapsAPIKey', 'text', NULL, NULL, 10.17, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('l_EnableLinkContactForm', 'la_Text_Links', 'la_config_EnableLinkContactForm', 'checkbox', NULL, NULL, 10.18, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('ReciprocalLinkChecking', 'la_Text_Links', 'la_config_ReciprocalLinkChecking', 'checkbox', NULL, NULL, 10.19, 0, 0); - -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_Links', '10', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_SortField', 'Name', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_SortOrder', 'asc', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_SortField2', 'Description', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_SortOrder2', 'desc', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_NewDays', '100', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_MinPopRating', '5', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_MaxHotNumber', '5', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_EnhancedLinks', '0', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_AllowFreeListings', '1', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_ShowPick', '1', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_UrlStatus', '', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_ReviewsSort', 'CreatedOn', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_ReviewsOrder', 'desc', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_ReviewsSort2', 'ReviewText', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_ReviewsOrder2', 'asc', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_MinPopVotes', '20', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_LinkId', '1', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_Name', '1', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_Description', '1', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_Url', '1', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_CreatedOn', '1', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_Hits', '1', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_CatchedRating', '1', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_CatchedVotesQty', '1', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_CatchedReviewsQty', '1', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_ReviewById', '1', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_Priority', '1', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_Status', '1', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_EditorsPick', '1', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_ResourceId', '1', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_HotItem', '1', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_PopItem', '1', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_NewItem', '1', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'link_ReviewDelay_Value', '1', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'link_ReviewDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'link_RatingDelay_Value', '1', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'link_RatingDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_Root', '{LinkCatId}', 'In-Portal', ''); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_Links_Short', '3', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_Highlight_OpenTag', '', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_Highlight_CloseTag', '', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_LinkReviews_Short', '3', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_LinkReviews', '10', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'l_CategoryTemplate', '/in-link/designs/section', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'l_ItemTemplate', 'in-link/designs/detail', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'l_MaxImageCount', 5, 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'l_ThumbnailImageWidth', 120, 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'l_ThumbnailImageHeight', 120, 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'l_FullImageWidth', 450, 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'l_FullImageHeight', 450, 'In-Link', 'in-link:configuration_output'); - -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Keyword_links', '90', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Pop_links', '5', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Rating_links', '5', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Increase_links', '30', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_ShowMultiple_links', '0', 'In-Link', 'in-link:configuration_search'); - -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'StartValidationTime', '0', 'In-Link', ''); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'LastExpirationTime', '0', 'In-Link', ''); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_RatingToPop', '5', 'In-Link', 'in-link:configuration_output'); - -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'l_MaxCategories', '3', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'l_EnableGoogleMaps', '0', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'l_GoogleMapsAPIKey', '', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'l_EnableLinkContactForm', 1, 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'ReciprocalLinkChecking', '0', 'In-Link', 'in-link:configuration_output'); - -INSERT INTO Events VALUES(DEFAULT, 'LINK.ADD', NULL, 1, 1, NULL, 'In-Link', 'la_event_link.add', 1); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ADD', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.add', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ADD.PENDING', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.add.pending', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ADD.PENDING', NULL, 1, 1, NULL, 'In-Link', 'la_event_link.add.pending', 1); -INSERT INTO Events VALUES(DEFAULT, 'LINK.MODIFY', NULL, 1, 1, NULL, 'In-Link', 'la_event_link.modify', 1); -INSERT INTO Events VALUES(DEFAULT, 'LINK.MODIFY', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.modify', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.MODIFY.PENDING', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.modify.pending', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Link', 'la_event_link.modify.pending', 1); -INSERT INTO Events VALUES(DEFAULT, 'LINK.MODIFY.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.modify.approve', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.MODIFY.DENY', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.modify.deny', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.approve', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.DENY', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.deny', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.REVIEW.ADD', NULL, 1, 1, NULL, 'In-Link', 'la_event_link.review.add', 1); -INSERT INTO Events VALUES(DEFAULT, 'LINK.REVIEW.ADD', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.review.add', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.review.add.pending', 1); -INSERT INTO Events VALUES(DEFAULT, 'LINK.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.review.add.pending', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.REVIEW.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.review.approve', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.REVIEW.DENY', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.review.deny', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance', 1); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.APPROVE', NULL, 0, 0, NULL, 'In-Link', 'la_event_link.link.enhance.approve', 1); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.APPROVE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.approve', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.DENY', NULL, 0, 0, NULL, 'In-Link', 'la_event_link.link.enhance.deny', 1); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.DENY', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.deny', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.EXPIRE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.expire', 1); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.EXPIRE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.expire', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.EXTEND', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.extend', 1); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.EXTEND', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.extend', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.RENEW', NULL, 0, 0, NULL, 'In-Link', 'la_event_link.link.enhance.renew', 1); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.RENEW', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.renew', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.RENEW.FAILED', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.renew_failed', 1); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.RENEW.FAILED', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.renew_failed', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.CANCEL', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.renew_cancel', 1); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.CANCEL', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.renew_cancel', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.RENEWAL.NOTICE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.renewal_notice', 1); -INSERT INTO Events VALUES(DEFAULT, 'LINK.ENHANCE.RENEWAL.NOTICE', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.enhance.renewal_notice', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.CONTACTFORM', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.contactform', 1); -INSERT INTO Events VALUES(DEFAULT, 'LINK.CONTACTFORM', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.link.contactform', 0); -INSERT INTO Events VALUES(DEFAULT, 'LINK.RECIPROCAL.CHECK.FAILED', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.reciprocal.check.failed', 1); -INSERT INTO Events VALUES(DEFAULT, 'LINK.VALIDATION.RESULTS', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.validation.results', 1); - -INSERT INTO CustomField VALUES (DEFAULT, 4, 'LinkAddress', 'lu_fld_LinkAddress', 0, 'la_section_BusinessLocation', 'la_fld_LinkAddress', 'text', 'size="40"', '', 1, 1, 0, 0); -INSERT INTO CustomField VALUES (DEFAULT, 4, 'LinkCity', 'lu_fld_LinkCity', 0, 'la_section_BusinessLocation', 'la_fld_LinkCity', 'text', 'size="40"', '', 2, 1, 0, 0); -INSERT INTO CustomField VALUES (DEFAULT, 4, 'LinkZipCode', 'lu_fld_LinkZipCode', 0, 'la_section_BusinessLocation', 'la_fld_LinkZipCode', 'text', NULL, '', 4, 1, 0, 0); -INSERT INTO CustomField VALUES (DEFAULT, 4, 'LinkState', 'lu_fld_LinkState', 0, 'la_section_BusinessLocation', 'la_fld_LinkState', 'select', '=+||SELECT DestAbbr AS OptionValue, DestName AS OptionName FROM StdDestinations WHERE DestType = 2 AND (DestParentId = 225 OR DestParentId = 38) ORDER BY DestParentId DESC, DestAbbr ASC', '', 3, 1, 0, 0); -INSERT INTO CustomField VALUES (DEFAULT, 4, 'LinkCountry', 'lu_fld_LinkCountry', 0, 'la_section_BusinessLocation', 'la_fld_LinkCountry', 'select', '=+||SELECT DestAbbr AS OptionValue, DestName AS OptionName FROM StdDestinations WHERE DestType = 1 ORDER BY DestAbbr ASC', '', 5, 1, 0, 0); -INSERT INTO CustomField VALUES (DEFAULT, 4, 'LinkPhone', 'lu_fld_LinkPhone', 0, 'la_section_BusinessLocation', 'la_fld_LinkPhone', 'text', NULL, '', 6, 1, 0, 0); - -INSERT INTO ItemTypes VALUES (4, 'In-Link', 'l', 'Link', 'Name', 'CreatedById', 'Hits', 'CachedRating', 'la_ItemTab_Links', 1, 'in-link/admin/addlink.php', 'clsLink', 'Link'); - -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.ADD', 'lu_PermName_Link.Add_desc', 'lu_PermName_Link.Add_error', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.VIEW', 'lu_PermName_Link.View_desc', 'lu_PermName_Link.View_error', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.ADD.PENDING', 'lu_PermName_Link.Add.Pending_desc', 'lu_PermName_Link.Add.Pending_error', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.MODIFY', 'lu_PermName_Link.Modify_desc', 'lu_PermName_Link.Modify_desc', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.DELETE', 'lu_PermName_Link.Delete_desc', 'lu_PermName_Link.Delete_error', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.RATE', 'lu_PermName_Link.Rate_desc', 'lu_PermName_Link.Rate_error', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.REVIEW', 'lu_PermName_Link.Review_desc', 'lu_PermName_Link.Review_error', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.REVIEW.PENDING', 'lu_PermName_Link.Review_Pending_desc', ' lu_PermName_Link.Review_Pending_error', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.MODIFY.PENDING', 'lu_PermName_Link.Modify.Pending_desc', 'lu_PermName_Link.Modify.Pending_desc', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.OWNER.MODIFY', 'lu_PermName_Link.Owner.Modify_desc', 'lu_PermName_Link.Owner.Modify_error', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.OWNER.MODIFY.PENDING', 'lu_PermName_Link.Owner.Modify.Pending_desc', 'lu_PermName_Link.Owner.Modify.Pending_error', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.OWNER.DELETE', 'lu_PermName_Link.Owner.Delete_desc', 'lu_PermName_Link.Owner.Delete_error', 'In-Link'); - -INSERT INTO SearchConfig VALUES ('Link', 'OrgId', 0, 0, 'lu_fielddesc_link_orgid', 'lu_field_orgid', 'In-Link', 'la_text_link', 19, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'NewItem', 0, 1, 'lu_fielddesc_link_newitem', 'lu_field_newitem', 'In-Link', 'la_text_link', 18, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'PopItem', 0, 1, 'lu_fielddesc_link_popitem', 'lu_field_popitem', 'In-Link', 'la_text_link', 17, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'HotItem', 0, 1, 'lu_fielddesc_link_hotitem', 'lu_field_hotitem', 'In-Link', 'la_text_link', 16, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'ResourceId', 0, 1, 'lu_fielddesc_link_resourceid', 'lu_field_resourceid', 'In-Link', 'la_text_link', 15, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'EditorsPick', 0, 1, 'lu_fielddesc_link_editorspick', 'lu_field_editorspick', 'In-Link', 'la_text_link', 14, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Status', 0, 0, 'lu_fielddesc_link_status', 'lu_field_status', 'In-Link', 'la_text_link', 13, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Priority', 0, 0, 'lu_fielddesc_link_priority', 'lu_field_priority', 'In-Link', 'la_text_link', 12, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'ModifiedById', 0, 0, 'lu_fielddesc_link_modifiedbyid', 'lu_field_modifiedbyid', 'In-Link', 'la_text_link', 11, DEFAULT, 0, 'text', 'PortalUser.Login', '{ForeignTable}.PortalUserId={LocalTable}.ModifiedById', NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CreatedById', 0, 0, 'lu_fielddesc_link_createdbyid', 'lu_field_createdbyid', 'In-Link', 'la_text_link', 10, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedReviewsQty', 0, 0, 'lu_fielddesc_link_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Link', 'la_text_link', 9, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedVotesQty', 0, 0, 'lu_fielddesc_link_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Link', 'la_text_link', 8, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'LinkId', 0, 1, 'lu_fielddesc_link_linkid', 'lu_field_linkid', 'In-Link', 'la_text_link', 0, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Name', 1, 1, 'lu_fielddesc_link_name', 'lu_field_name', 'In-Link', 'la_text_link', 1, DEFAULT, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Description', 1, 1, 'lu_fielddesc_link_description', 'lu_field_description', 'In-Link', 'la_text_link', 2, DEFAULT, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Url', 1, 1, 'lu_fielddesc_link_url', 'lu_field_url', 'In-Link', 'la_text_link', 3, DEFAULT, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CreatedOn', 0, 1, 'lu_fielddesc_link_createdon', 'lu_field_createdon', 'In-Link', 'la_text_link', 4, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Modified', 0, 1, 'lu_fielddesc_link_modified', 'lu_field_modified', 'In-Link', 'la_text_link', 5, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Hits', 0, 1, 'lu_fielddesc_link_hits', 'lu_field_hits', 'In-Link', 'la_text_link', 6, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedRating', 0, 0, 'lu_fielddesc_link_cachedrating', 'lu_field_cachedrating', 'In-Link', 'la_text_link', 7, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); - -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) as LinkCount FROM <%prefix%>Link WHERE Status=1', NULL, 'la_prompt_ActiveLinks', 0, 1); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS TotalLinks FROM <%prefix%>Link', NULL, 'la_prompt_TotalLinks', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS ActiveLinks FROM <%prefix%>Link WHERE Status = 1', NULL, 'la_prompt_ActiveLinks', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS PendingLinks FROM <%prefix%>Link WHERE Status = 2', NULL, 'la_prompt_PendingLinks', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS DisabledLinks FROM <%prefix%>Link WHERE Status = 0', NULL, 'la_prompt_DisabledLinks', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS NewLinks FROM <%prefix%>Link WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Link_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewLinks', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>Link WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickLinks', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS HotLinks FROM <%prefix%>Link WHERE (HotItem = 1) OR (Hits >= <%m:config name="Link_MaxHotNumber"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotLinks', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS PopularLinks FROM <%prefix%>Link WHERE (PopItem = 1) OR ( (CachedRating >= <%link:hit_count type="top"%>) AND <%link:hit_count type="top"%> AND (PopItem = 2) )', NULL, 'la_prompt_PopularLinks', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Link WHERE CachedRating > 0', NULL, 'la_prompt_LinksAverageRating', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT MAX(Hits) AS MaxLinksHits FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksHits', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT MAX(CachedVotesQty) AS MaxLinksVotes FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksVotes', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_NewestLinkDate', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_LastLinkUpdate', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_LinkReviews', 0, 2); - -INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 14, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.VIEW', 14, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.VIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.ADD.PENDING', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.RATE', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.REVIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.MODIFY', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.MODIFY.PENDING', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.ADD', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.VIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.RATE', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.REVIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.MODIFY', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.MODIFY.PENDING', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.DELETE', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.ADD', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.DELETE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.MODIFY', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.ADD', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.VIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.MODIFY', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.DELETE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.RATE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.REVIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.ADD', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.VIEW', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.ADD.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.MODIFY', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.DELETE', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.RATE', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.REVIEW', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.REVIEW.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.MODIFY.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.MODIFY', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.MODIFY.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.DELETE', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:links.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:setting_folder.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_output.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_output.edit', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_search.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_search.edit', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_email.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_email.edit', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_custom.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_custom.add', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_custom.edit', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_custom.delete', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:duplicate_checker.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:duplicate_checker.add', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:duplicate_checker.edit', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:duplicate_checker.delete', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:validation_list.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:validation_list.add', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:validation_list.edit', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:paid_listings.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:paid_listings.add', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:paid_listings.edit', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:paid_listings.delete', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:paid_listings.advanced:approve', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:paid_listings.advanced:decline', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:listing_types.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:listing_types.add', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:listing_types.edit', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:listing_types.delete', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:link_validation.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:link_validation.advanced:continue', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:link_validation.advanced:restart', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:link_validation.advanced:validate', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:link_validation.advanced:reset', 11, 1, 1, 0); - -INSERT INTO ImportScripts VALUES (DEFAULT, 'Links from CSV file [In-Link]', '', 'l', 'In-Link', '', 'CSV', '1'); - -INSERT INTO CustomField VALUES (DEFAULT, 1, 'l_ItemTemplate', 'la_fld_cust_l_ItemTemplate ', 0, 'la_title_SystemCF', 'la_fld_cust_l_ItemTemplate ', 'text', NULL, '', 0, 0, 1, 0); - -INSERT INTO Counters VALUES (DEFAULT, 'linkhits_count', 'SELECT ROUND(SUM(Hits)) FROM <%PREFIX%>Link', NULL, NULL, '300', '0', '|Link|'); - -INSERT INTO Modules VALUES ('In-Link', 'in-link/', 'l', DEFAULT, 1, 1, 'in-link/', 2, NULL); Index: branches/5.0.x/in-link/install/install_order.txt =================================================================== diff -u -N --- branches/5.0.x/in-link/install/install_order.txt (revision 12746) +++ branches/5.0.x/in-link/install/install_order.txt (revision 0) @@ -1 +0,0 @@ -102 \ No newline at end of file Index: branches/5.0.x/in-link/install/english.lang =================================================================== diff -u -N --- branches/5.0.x/in-link/install/english.lang (revision 12746) +++ branches/5.0.x/in-link/install/english.lang (revision 0) @@ -1,254 +0,0 @@ - - m/d/Yg:i Am/d/Yg:i:s A.,utf-8http://docs.in-portal.org/eng/index.php2 - - QWN0aW9ucyBVcG9uIEV4cGlyYXRpb24= - QWN0aW9ucyBVcG9uIFB1cmNoYXNl - RHVwbGljYXRlcw== - RXhwaXJlcyBPbg== - TGluaw== - T3duZXI= - TGlzdGluZyBUeXBl - UGVuZGluZyBSZW5ld2Fs - RW5hYmxlZCBPbg== - VmFsaWRhdGVkIE9u - VmFsaWRhdGlvbiBDb2Rl - RW5hYmxlIExpbmsgQ29udGFjdCBGb3Jtcw== - UmVjaXByb2NhbCBMaW5rIENoZWNraW5n - RGVjcmVhc2UgQnk= - RG9uJ3QgQ2hhbmdl - TGluayBDb250YWN0IEZvcm0= - TGluayBlbmhhbmNlbWVudCBzdWJtaXR0ZWQ= - TGluayBlbmhhbmNlbWVudCBhcHByb3ZlZA== - TGluayBlbmhhbmNlbWVudCBkZW5pZWQ= - TGluayBlbmhhbmNlbWVudCBleHBpcmVk - TGluayBlbmhhbmNlbWVudCByZW5ld2FsIHN1Ym1pdHRlZA== - TGluayBlbmhhbmNlbWVudCBleHRlbmRlZA== - TGluayBlbmhhbmNlbWVudCBpcyBhYm91dCB0byBleHBpcmU= - TGluayBlbmhhbmNlbWVudCBjYW5jZWxsZWQ= - TGluayBlbmhhbmNlbWVudCByZW5ld2FsIGZhaWxlZA== - TW9kaWZ5IExpbms= - UmVjaXByb2NhbCBDaGVjayBGYWlsZWQ= - TGluayBDb21tZW50IEFkZGVk - TGluayBDb21tZW50IFBlbmRpbmc= - TGluayBDb21tZW50IEFwcHJvdmVk - TGluayBDb21tZW50IERlY2xpbmVk - TGluayBWYWxpZGF0aW9uIFJlc3VsdHM= - QWRkaXRpb25hbCBTZWN0aW9u - TGluayBJdGVtIFRlbXBsYXRl - RW5hYmxlIFB1cmNoYXNpbmc= - RXhwaXJhdGlvbiBEYXRl - QWRkcmVzcw== - Q2l0eQ== - Q291bnRyeQ== - RW5hYmxlIEdvb2dsZSBNYXBz - R29vZ2xlIE1hcHMgQVBJIEtleQ== - TGluayBOYW1l - TGluayBPd25lcg== - UGhvbmU= - U3RhdGU= - TGluayBTdGF0dXM= - WmlwIGNvZGU= - TWF4aW11bSBudW1iZXIgb2YgSE9UIGxpbmtz - TWluaW11bSByYXRpbmcgdG8gY29uc2lkZXIgbGluayBQT1A= - TWluaW11bSBudW1iZXIgb2Ygdm90ZXMgdG8gY29uc2lkZXIgbGluayBQT1A= - SUQ= - TGlzdGluZyBUeXBl - RGVzY3JpcHRpb24= - SUQ= - TmFtZQ== - UGVuZGluZyBSZW5ld2Fs - UHVyY2hhc2UgRGF0ZQ== - UmVjaXByb2NhbCBMaW5rIFN0YXR1cw== - UmVjdXJyaW5n - UmVuZXdhbCBSZW1pbmRlcg== - UHJvZHVjdCBOYW1l - SW4tTGluaw== - SW5jcmVhc2UgQnk= - TGlua3M= - QWxsb3cgRnJlZSBMaXN0aW5ncw== - RW5oYW5jZWQgTGlzdGluZ3M= - YW5kIHRoZW4gYnk= - U29ydCBDb21tZW50cyBieQ== - R3JvdXBpbmcgQnk= - Tm90IENoZWNrZWQ= - Tm8= - UGVuZGluZyBSZW5ld2Fs - QWN0aXZlIExpbmtz - RGlzYWJsZWQgTGlua3M= - RWRpdG9yJ3MgUGljayBMaW5rcw== - SG90IExpbmtz - VG90YWwgTGluayBDb21tZW50cw== - QXZlcmFnZSBSYXRpbmcgb2YgTGlua3M= - TWF4aW11bSBIaXRzIG9mIGEgTGluaw== - TWF4aW11bSBWb3RlcyBvZiBhIExpbms= - TmV3IExpbmtz - UGVuZGluZyBMaW5rcw== - UG9wdWxhciBMaW5rcw== - VG90YWwgTGlua3M= - TG9jYXRpb24= - TGluaw== - T3JpZ2luYWwgVmFsdWVz - U2V0IEVxdWFsIFRv - UmVzZXQ= - RHVwbGljYXRlIENoZWNrZXI= - TGlua3M= - TGluayBWYWxpZGF0aW9u - TGlzdGluZ3M= - TGlzdGluZyBUeXBlcw== - UGFpZCBMaXN0aW5ncw== - U2hvcHBpbmcgQ2FydCBFbnRyeQ== - TGlua3M= - UGFpZCBMaXN0aW5n - TGlzdGluZyBUeXBl - U2hvcHBpbmcgQ2FydCBJdGVt - QWRkaW5nIExpbms= - QWRkaW5nIExpc3Rpbmc= - QWRkaW5nIExpc3RpbmcgVHlwZQ== - RHVwbGljYXRlIExpbmtz - RWRpdGluZyBMaW5r - RWRpdGluZyBMaXN0aW5n - RWRpdGluZyBMaXN0aW5nIFR5cGU= - SW1wb3J0IExpbmtz - RGlyZWN0b3J5 - TGlua3M= - TGlua3MgRXhwb3J0 - TmV3IExpbms= - TmV3IExpc3Rpbmc= - TmV3IExpc3RpbmcgVHlwZQ== - UGFpZCBMaXN0aW5ncw== - TGlzdGluZyBUeXBlcw== - U2hvcHBpbmcgQ2FydCBFbnRyeQ== - Q29udGludWUgTGluayBWYWxpZGF0aW9u - TWVyZ2U= - TmV3IEZpbGU= - TmV3IExpc3Rpbmc= - TmV3IExpc3RpbmcgVHlwZQ== - TmV3IFBhaWQgTGlzdGluZw== - U3RhcnQgTmV3IFZhbGlkYXRpb24= - UmVzZXQgVmFsaWRhdGlvbiBTdGF0dXM= - VXNlIGdyaWQgdG8gQXBwcm92ZSAvIERlY2xpbmU= - WW91IGFyZSBhYm91dCB0byBjYW5jZWwgeW91ciBsaW5rIGVuaGFuY2VtZW50Lg== - WW91IGFyZSBhYm91dCB0byBleHRlbmQgeW91ciBsaW5rIGVuaGFuY2VtZW50Lg== - Q2FuY2VsIEVuaGFuY2VtZW50 - RW5oYW5jZQ== - RW5oYW5jZSBMaW5r - RXh0ZW5kIC8gQ2FuY2VsIEVuaGFuY2VtZW50 - RXh0ZW5kIEVuaGFuY2VtZW50 - UmF0ZSB0aGlzIGxpbms= - Q29tbWVudCB0aGlzIExpbms= - VmlzaXQgTGluaw== - QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGNhbmNlbCB5b3VyIGVuaGFuY2VkIGxpbms/IFRoZSBsaXN0aW5nIHR5cGUgd2lsbCBiZSByZXNldCB0byByZWd1bGFyLg== - Q2hvb3NlIExpc3RpbmcgVHlwZQ== - RHVyYXRpb24= - QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSB0aGUgbGluaz8NClRoaXMgYWN0aW9uIGNhbm5vdCBiZSB1bmRvbmUu - TWFuYWdlIHlvdXIgTGlua3MgaGVyZQ== - RW5oYW5jZW1lbnQgc2V0IHRvIHJlbmV3IGF1dG9tYXRpY2FsbHkgb24= - QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGV4dGVuZCB5b3VyIGxpbmsgZW5oYW5jZW1lbnQ/ - QWRkcmVzcw== - Q2l0eQ== - Q291bnRyeQ== - UGhvbmU= - U3RhdGU= - WmlwIGNvZGU= - RW5oYW5jZW1lbnQgZXhwaXJlcyBvbg== - TGlzdGluZyBUeXBl - TGlzdGluZyBUeXBl - VXJs - RnJlZSBMaXN0aW5n - R29vZ2xlIE1hcHM= - VGhhbmsgeW91IQ== - TGluayBOYW1lIEEgdG8gWg== - TGluayBOYW1lIFogdG8gQQ== - TGlua3MgdXBkYXRlZA== - WW91ciBpbmZvcm1hdGlvbiByZXF1ZXN0IGhhcyBiZWVuIHNlbnQgb3V0LiA8YnIvPjxici8+WW91J2xsIGJlIGNvbnRhY3RlZCBzaG9ydGx5IQ== - UmVxdWVzdCBJbmZvcm1hdGlvbg== - TXkgTGlua3M= - Tm8gTGluayBFbmhhbmNtZW50cyBjdXJyZW50bHkgYXZhaWxhYmxl - Tm8gTGlua3M= - QWZ0ZXIgc2VsZWN0aW5nIGxpc3RpbmcgdHlwZSBpdCB3aWxsIGJlIGFkZGVkIHRvIHlvdXIgc2hvcHBpbmcgY2FydC4gT25jZSB5b3UgY29tcGxldGUgY2hlY2tvdXQgYW5kIHlvdXIgb3JkZXIgaXMgYXBwcm92ZWQgeW91ciBsaW5rIHN0YXR1cyB3aWxsIGJlIHVwZ3JhZGVkLiBZb3Ugd2lsbCBiZSBub3RpZmllZCBieSBlbWFpbCB3aGVuIHRoaXMgaXMgZG9uZS4= - cGVuZGluZw== - Q29tbWVudCBMaW5r - TGluayBEZXRhaWxz - U29ydCBMaW5rcyBCeQ== - U3VnZ2VzdCBMaW5r - VGhhbmsgeW91IGZvciBjb21tZW50aW5nIG9uIHRoaXMgbGluay4= - VGhhbmsgeW91IGZvciBzdWJtaXR0aW5nIHlvdXIgY29tbWVudCBmb3IgdGhpcyBsaW5rIC0gaXQncyBwZW5kaW5nIGZvciBhZG1pbmlzdHJhdGl2ZSBhcHByb3ZhbC4= - WW91ciBsaW5rIGhhcyBiZWVuIGVuaGFuY2VkLg== - WW91ciBMaW5rIGhhcyBiZWVuIG1vZGlmaWVk - VGhhbmsgeW91IGZvciB1cGRhdGluZyB5b3VyIGxpbmsuIFlvdXIgbW9kaWZpY2F0aW9ucyBhcmUgd2FpdGluZyBmb3IgYWRtaW5pc3RyYXRpdmUgYXBwcm92YWwu - TXkgTGlua3M= - Tm8gcGVybWlzc2lvbnMgdG8gY29tbWVudCBvbiB0aGlzIGxpbmsu - Tm8gcGVybWlzc2lvbnMgdG8gcGVyZm9ybSBtb2RpZnkgdGhlIGxpbms= - Tm8gcGVybWlzc2lvbnMgdG8gc3VnZ2VzdCBsaW5rIGludG8gdGhlIGN1cnJlbnQgY2F0ZWdvcnk= - VGhhbmsgeW91IGZvciB1cGRhdGluZyB5b3VyIGxpbmsu - VGhhbmsgeW91IGZvciBzdWJtaXR0aW5nIHlvdXIgbGluay4gQ3VycmVudGx5IGl0J3Mgd2FpdGluZyBmb3IgYWRtaW5pc3RyYXRpdmUgYXBwcm92YWw= - TGluayBDb21tZW50IEFkZGVk - TGluayBDb21tZW50IFBlbmRpbmc= - RW5oYW5jZW1lbnQgQ2FuY2VsbGF0aW9uIENvbmZpcm1hdGlvbg== - RW5oYW5jZW1lbnQgRXh0ZW50aW9uIENvbmZpcm1hdGlvbg== - RW5oYW5jZSBMaW5r - RW5oYW5jZW1lbnQgRGV0YWlscw== - RXh0ZW5kIC8gQ2FuY2VsIExpbmsgRW5oYW5jZW1lbnQ= - RmF2b3JpdGUgTGlua3M= - SG90IExpbmtz - TGluayBEZXRhaWxz - TGlua3M= - TGlua3MgU2VhcmNoIFJlc3VsdHM= - TW9kaWZ5IExpbms= - TGluayBNb2RpZmllZA== - UGVuZGluZyBMaW5rIENvbmZpcm1hdGlvbg== - TXkgTGlua3M= - TmV3IExpbmtz - RWRpdG9yJ3MgUGljayBMaW5rcw== - UG9wdWxhciBMaW5rcw== - Q29tbWVudCB0aGlzIExpbms= - U3VnZ2VzdCBMaW5r - QWRkIExpbmsgQ29uZmlybWF0aW9u - UGVuZGluZyBMaW5rIENvbmZpcm1hdGlvbg== - dG8gY2FuY2VsIGxpbmsgZW5oYW5jZW1lbnQ= - VG90YWwgTGlua3M= - - - U3ViamVjdDogTmV3IExpbmsgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIvPiIgLSBBZGRlZAoKVGhhbmsgeW91IGZvciBzdWJtaXR0aW5nIHlvdXIgbGluayB0byBvdXIgd2Vic2l0ZSE8YnIvPjxici8+DQoNCkxpbmsgZGV0YWlsIGFyZSBsaXN0ZWQgYmVsb3c6PGJyLz48YnIvPg0KDQpMaW5rIE5hbWU6IDxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIvPjxici8+DQo8aW5wMjptX2lmIGNoZWNrPSJsX0ZpZWxkIiBuYW1lPSJVcmwiPg0KTGluayBXZWJzaXRlOiA8aW5wMjpsX0ZpZWxkIG5hbWU9IlVybCIvPjxici8+DQo8L2lucDI6bV9pZj4NCjxpbnAyOm1faWYgY2hlY2s9ImxfRmllbGQiIG5hbWU9IkRlc2NyaXB0aW9uIj4NCkRlc2NyaXB0aW9uOiA8aW5wMjpsX0ZpZWxkIG5hbWU9IkRlc2NyaXB0aW9uIi8+PGJyLz4NCjwvaW5wMjptX2lmPg0KPGJyLz48YnIvPg0KDQpZb3UgY2FuIHZpZXcgeW91ciBsaW5rIGhlcmUgPGEgaHJlZj0iPGlucDI6bF9MaW5rTGluayB0ZW1wbGF0ZT0iX19kZWZhdWx0X18iLz4iPjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIvPjwvYT4= - U3ViamVjdDogTmV3IExpbmsgaGFzIGJlZW4gU3VibWl0dGVkCgpBIG5ldyBMaW5rIGhhcyBiZWVuIHN1Ym1pdHRlZCB0byB0aGUgd2Vic2l0ZSBieSA8aW5wMjpsX0ZpZWxkIG5hbWU9IlVzZXJOYW1lIi8+Ljxici8+PGJyLz4NCg0KTGluayBOYW1lOiA8aW5wMjpsX0ZpZWxkIG5hbWU9Ik5hbWUiLz48YnIvPg0KPGlucDI6bV9pZiBjaGVjaz0ibF9GaWVsZCIgbmFtZT0iVXJsIj4NCkxpbmsgV2Vic2l0ZTogPGlucDI6bF9GaWVsZCBuYW1lPSJVcmwiLz48YnIvPg0KPC9pbnAyOm1faWY+DQo8aW5wMjptX2lmIGNoZWNrPSJsX0ZpZWxkIiBuYW1lPSJEZXNjcmlwdGlvbiI+DQpEZXNjcmlwdGlvbjogPGlucDI6bF9GaWVsZCBuYW1lPSJEZXNjcmlwdGlvbiIvPjxici8+DQo8L2lucDI6bV9pZj4NCjxici8+PGJyLz4NCg0KWW91IGNhbiB2aWV3IGl0IGhlcmUgPGEgaHJlZj0iPGlucDI6bF9MaW5rTGluayB0ZW1wbGF0ZT0iX19kZWZhdWx0X18iLz4iPjxpbnAyOjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIvPjwvYT4NCg== - U3ViamVjdDogWW91ciBMaW5rICI8aW5wMjpsX0ZpZWxkIG5hbWU9Ik5hbWUiLz4iIGlzIFBlbmRpbmcKClRoYW5rIHlvdSBmb3Igc3VibWl0dGluZyB5b3VyIExpbmsuPGJyLz48YnIvPg0KDQpDdXJyZW50bHkgaXQncyBwZW5kaW5nIGZvciBhZG1pbmlzdHJhdGl2ZSBhcHByb3ZhbC48YnIvPjxici8+DQoNCllvdSdsbCBiZSBjb250YWN0ZWQgZGlyZWN0bHkgYnkgZW1haWwuPGJyLz48YnIvPg0KDQpMaW5rIE5hbWU6IDxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIvPjxici8+DQo8aW5wMjptX2lmIGNoZWNrPSJsX0ZpZWxkIiBuYW1lPSJVcmwiPg0KTGluayBXZWJzaXRlOiA8aW5wMjpsX0ZpZWxkIG5hbWU9IlVybCIvPjxici8+DQo8L2lucDI6bV9pZj4NCjxpbnAyOm1faWYgY2hlY2s9ImxfRmllbGQiIG5hbWU9IkRlc2NyaXB0aW9uIj4NCkRlc2NyaXB0aW9uOiA8aW5wMjpsX0ZpZWxkIG5hbWU9IkRlc2NyaXB0aW9uIi8+PGJyLz4NCjwvaW5wMjptX2lmPg0KPGJyLz48YnIvPg0KDQo= - U3ViamVjdDogTmV3IExpbmsgIGhhcyBiZWVuIFN1Ym1pdHRlZCBhbmQgUGVuZGluZyEKCk5ldyBsaW5rIGhhcyBiZWVuIHN1Ym1pdHRlZCBhbmQgaXMgcGVuZGluZyBmb3IgYWRtaW5pc3RyYXRpdmUgYXBwcm92YWwuPGJyLz48YnIvPg0KDQpMaW5rIE5hbWU6IDxpbnAyOjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIvPjxici8+DQo8aW5wMjptX2lmIGNoZWNrPSJsX0ZpZWxkIiBuYW1lPSJVcmwiPg0KTGluayBXZWJzaXRlOiA8aW5wMjpsX0ZpZWxkIG5hbWU9IlVybCIvPjxici8+DQo8L2lucDI6bV9pZj4NCjxpbnAyOm1faWYgY2hlY2s9ImxfRmllbGQiIG5hbWU9IkRlc2NyaXB0aW9uIj4NCkRlc2NyaXB0aW9uOiA8aW5wMjpsX0ZpZWxkIG5hbWU9IkRlc2NyaXB0aW9uIi8+PGJyLz4NCjwvaW5wMjptX2lmPg0KPGJyLz48YnIvPg0KDQpQbGVhc2UgcHJvY2VlZCB0byB0aGUgQWRtaW5pc3RyYXRpdmUgQ29uc29sZSB0byBhcHByb3ZlIG9yIGRlbnkgdGhpcyBsaW5rPGJyLz48L2JyPg== - U3ViamVjdDogWW91ciBMaW5rICI8aW5wMjpsX0ZpZWxkIG5hbWU9Ik5hbWUiLz4iIC0gQXBwcm92ZWQhCgpZb3VyIExpbmsgaGFzIGJlZW4gQXBwcm92ZWQhPGJyIC8+DQo8YnIgLz4NCkxpbmsgTmFtZTogPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIi8+PGJyIC8+DQo8YnIgLz4NCllvdSBjYW4gdmlldyBpdCBoZXJlIDxhIGhyZWY9IjxpbnAyOmxfTGlua0xpbmsgdGVtcGxhdGU9Il9fZGVmYXVsdF9fIi8+Ij48aW5wMjpsX0ZpZWxkIG5hbWU9Ik5hbWUiLz48L2E+ - U3ViamVjdDogIlJlcXVlc3QgSW5mb3JtYXRpb24iIGZvcm0gc3VibWl0dGVkCgpEZWFyIEJ1c2luZXNzIE93bmVyLDxiciAvPg0KPGJyIC8+DQomcXVvdDtSZXF1ZXN0IEluZm9ybWF0aW9uJnF1b3Q7IGZvcm0gaGFzIGJlZW4gc3VibWl0dGVkIGZvciA8aW5wMjptX3BhcmFtIG5hbWU9InRvX2xpbmtuYW1lIi8+PGJyIC8+DQo8YnIgLz4NCjxociBub3NoYWRlPSIiIHdpZHRoPSIxMDAlIiAvPg0KPGJyIC8+DQo8dGFibGU+DQogICAgPHRib2R5Pg0KICAgICAgICA8dHI+DQogICAgICAgICAgICA8dGQ+RnVsbCBuYW1lOjwvdGQ+DQogICAgICAgICAgICA8dGQ+PGlucDI6bV9wYXJhbSBuYW1lPSJmcm9tX25hbWUiIC8+PC90ZD4NCiAgICAgICAgPC90cj4NCiAgICAgICAgPHRyPg0KICAgICAgICAgICAgPHRkPkUtbWFpbDo8L3RkPg0KICAgICAgICAgICAgPHRkPjxhIGhyZWY9Im1haWx0bzo8aW5wMjptX3BhcmFtIG5hbWU9ImZyb21fZW1haWwiIC8+Ij48aW5wMjptX3BhcmFtIG5hbWU9ImZyb21fZW1haWwiIC8+PC9hPjwvdGQ+DQogICAgICAgIDwvdHI+DQogICAgICAgIDx0cj4NCiAgICAgICAgICAgIDx0ZD5TdWJqZWN0OjwvdGQ+DQogICAgICAgICAgICA8dGQ+PGlucDI6bV9wYXJhbSBuYW1lPSJmcm9tX3N1YmplY3QiIC8+PC90ZD4NCiAgICAgICAgPC90cj4NCiAgICAgICAgPHRyPg0KICAgICAgICAgICAgPHRkPlF1ZXN0aW9uczo8L3RkPg0KICAgICAgICAgICAgPHRkPjxpbnAyOm1fcGFyYW0gbmFtZT0ibWVzc2FnZSIvPiA8L3RkPg0KICAgICAgICA8L3RyPg0KICAgIDwvdGJvZHk+DQo8L3RhYmxlPg0KPGJyIC8+DQo8aHIgbm9zaGFkZT0iIiB3aWR0aD0iMTAwJSIgLz4NCjxiciAvPg== - U3ViamVjdDogSW5mb3JtYXRpb24gUmVxdWVzdCBmb3IgIjxpbnAyOm1fcGFyYW0gbmFtZT0idG9fbGlua25hbWUiIC8+IiBzdWJtaXR0ZWQKCkRlYXIgQWRtaW5pc3RyYXRvciw8YnIvPjxici8+DQoNCiJSZXF1ZXN0IEluZm9ybWF0aW9uIiBmb3JtIGhhcyBiZWVuIHN1Ym1pdHRlZCBmb3IgIjxpbnAyOm1fcGFyYW0gbmFtZT0idG9fbGlua25hbWUiIC8+Ijxici8+PGJyLz4NCg0KPGhyIHdpZHRoPSIxMDAlIiBub3NoYWRlPjxici8+DQoNCjx0YWJsZT4NCjx0cj4NCjx0ZD5GdWxsIG5hbWU6PC90ZD4NCjx0ZD48aW5wMjptX3BhcmFtIG5hbWU9ImZyb21fbmFtZSIgLz48L3RkPg0KPC90cj4NCg0KPHRyPg0KPHRkPkUtbWFpbDo8L3RkPg0KPHRkPjxpbnAyOm1fcGFyYW0gbmFtZT0iZnJvbV9lbWFpbCIgLz48L3RkPg0KPC90cj4NCg0KPHRyPg0KPHRkPlN1YmplY3Q6PC90ZD4NCjx0ZD48aW5wMjptX3BhcmFtIG5hbWU9ImZyb21fc3ViamVjdCIgLz48L3RkPg0KPC90cj4NCg0KPHRyPg0KPHRkPlF1ZXN0aW9uczo8L3RkPg0KPHRkPg0KPGJsb2NrcXVvdGU+DQo8aW5wMjptX3BhcmFtIG5hbWU9Im1lc3NhZ2UiLz4NCjwvYmxvY2txdW90ZT4NCjwvdGQ+DQo8L3RyPg0KPC90YWJsZT4NCjxicj48aHIgd2lkdGg9IjEwMCUiIG5vc2hhZGU+PGJyPg0K - U3ViamVjdDogWW91ciBMaW5rICI8aW5wMjpsX0ZpZWxkIG5hbWU9Ik5hbWUiLz4iIGhhcyBiZWVuIGRlbmllZAoKU29ycnksIGJ1dCBzdWJtaXR0ZWQgYnkgeW91IExpbmsgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIvPiIgaGFzIGJlZW4gZGVuaWVkPGJyPjxicj4NCg0KUGxlYXNlIGZlZWwgZnJlZSB0byBzdWJtaXQgYWdhaW4uPGJyPg== - U3ViamVjdDogTGluayBFbmhhbmNlbWVudCBSZWNlaXZlZCBhbmQgUGVuZGluZwoKRGVhciA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9IkZpcnN0TmFtZSIgLz4gPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJMYXN0TmFtZSIgLz4sPGJyLz48YnIvPg0KDQpUaGFuayB5b3UgZm9yIHN1Ym1pdHRpbmcgbGluayBlbmhhbmNlbWVudCByZXF1ZXN0LiBZb3Ugd2lsbCBiZSBub3RpZmllZCBvbmNlIHlvdXIgbGluayBlbmhhbmNlbWVudCBpcyBwcm9jZXNzZWQu - U3ViamVjdDogTGluayBFbmhhbmNlbWVudCBzdWJtaXR0ZWQKCkEgdXNlciBoYXMgc3VibWl0dGVkIGEgbGluayBlbmhhbmNlbWVudCByZXF1ZXN0Ljxici8+PGJyLz4NCg0KUGxlYXNlIHByb2NlZWQgdG8gYWRtaW5pc3RyYXRpdmUgY29uc29sZSB0byByZXZpZXcgaXQu - U3ViamVjdDogWW91ciBMaW5rIGVuaGFuY2VtZW50IGZvciA8aW5wMjpsX0ZpZWxkIG5hbWU9Ik5hbWUiIC8+IC0gQXBwcm92ZWQhCgpEZWFyIDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iRmlyc3ROYW1lIiAvPiA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9Ikxhc3ROYW1lIiAvPiw8YnIvPjxici8+DQoNCllvdXIgcmVjZW50IGxpbmsgZW5oYW5jZW1lbnQgcmVxdWVzdCBoYXMgYmVlbiBhcHByb3ZlZC4gVGhhbmsgeW91IQ0K - U3ViamVjdDogTGluayBFbmhhbmNlbWVudCBpcyBBcHByb3ZlZAoKTGluayBlbmhhbmNlbWVudCBmb3IgPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIi8+IGFzIGJlZW4gYXBwcm92ZWQu - U3ViamVjdDogTGluayBFbmhhbmNlbWVudCBmb3IgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIgLz4iIC0gQ2FuY2VsZWQKCkRlYXIgPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJGaXJzdE5hbWUiIC8+IDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iTGFzdE5hbWUiIC8+LDxici8+PGJyLz4NCg0KWW91ciBsaW5rIGVuaGFuY2VtZW50IGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIiAvPiIgb24gPGlucDI6Y29uZl9Db25maWdWYWx1ZSBuYW1lPSJTaXRlX05hbWUiLz4gaGFzIGJlZW4gY2FuY2VsZWQu - U3ViamVjdDogTGluayBFbmhhbmNlbWVudCBmb3IgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIgLz4iIC0gQ2FuY2VsZWQhCgpMaW5rIEVuaGFuY2VtZW50IGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIiAvPiIgaGFzIGJlZW4gY2FuY2VsZWQh - U3ViamVjdDogTGluayBFbmhhbmNlbWVudCBmb3IgPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIiAvPiAtIERlbmllZAoKRGVhciA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9IkZpcnN0TmFtZSIgLz4gPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJMYXN0TmFtZSIgLz4sPGJyLz48YnIvPg0KDQpTb3JyeSwgYnV0IHlvdXIgcmVjZW50IGxpbmsgZW5oYW5jZW1lbnQgcmVxdWVzdCBmb3IgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIgLz4iIGhhcyBiZWVuIGRlbmllZC4= - U3ViamVjdDogTGluayBFbmhhbmNlbWVudCBoYXMgYmVlbiBEZW5pZWQKCkxpbmsgZW5oYW5jZW1lbnQgZm9yIDxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIgLz4gaGFzIGJlZW4gZGVuaWVkLg== - U3ViamVjdDogTGluayBFbmhhbmNlbWVudCBmb3IgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIgLz4iIC0gRXhwaXJlZAoKRGVhciA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9IkZpcnN0TmFtZSIgLz4gPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJMYXN0TmFtZSIgLz4sPGJyLz48YnIvPg0KDQpZb3VyIGVuaGFuY2VkIGxpbmsgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIgLz4iIGF0IDxpbnAyOmNvbmZfQ29uZmlnVmFsdWUgbmFtZT0iU2l0ZV9OYW1lIi8+IGhhcyBleHBpcmVkLjxici8+PGJyLz4NCg0KSWYgeW91IHdhbnQgdG8gcmVuZXcgeW91ciBlbmhhbmNlZCBsaW5rLCBwbGVhc2UgcmUtc3VibWl0IGxpbmsgZW5oYW5jZW1lbnQgcmVxdWVzdC4= - U3ViamVjdDogTGluayBFbmhhbmNlbWVudCBmb3IgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIgLz4iIC0gRXhwaXJlZAoKRW5oYW5jZWQgbGluayA8aW5wMjpsX0ZpZWxkIG5hbWU9Ik5hbWUiIC8+IGhhcyBleHBpcmVkLg== - U3ViamVjdDogTGluayBFbmhhbmNlbWVudCBSZW5ld2FsIGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIiAvPiIgLSBTdWJtaXR0ZWQKCkRlYXIgPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJGaXJzdE5hbWUiIC8+IDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iTGFzdE5hbWUiIC8+LA0KDQpUaGFuayB5b3UgZm9yIHN1Ym1pdHRpbmcgbGluayBlbmhhbmNlbWVudCByZW5ld2FsIHJlcXVlc3QgZm9yICI8aW5wMjpsX0ZpZWxkIG5hbWU9Ik5hbWUiIC8+Ii48YnIvPjxici8+DQoNCllvdSB3aWxsIGJlIG5vdGlmaWVkIHNob3J0bHkgb25jZSB5b3UgcmVxdWVzdCBpcyBwcm9jZXNzZWQuDQoNCg== - U3ViamVjdDogTGluayBFbmhhbmNlbWVudCBSZW5ld2FsIGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIiAvPiIgLSBTdWJtaXR0ZWQKCkxpbmsgZW5oYW5jZW1lbnQgcmVuZXdhbCByZXF1ZXN0IGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIiAvPiIgaGFzIGJlZW4gc3VibWl0dGVkIGJ5IHVzZXIuPGJyLz48YnIvPg0KDQpQbGVhc2UgcHJvY2VlZCB0byB0aGUgQWRtaW5pc3RyYXRpdmUgQ29uc29sZSB0byByZXZpZXcgaXQu - U3ViamVjdDogTGluayBFbmhhbmNlbWVudCBmb3IgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIgLz4iIC0gRXh0ZW5kZWQhCgpEZWFyIDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iRmlyc3ROYW1lIiAvPiA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9Ikxhc3ROYW1lIiAvPiw8YnIvPjxici8+DQoNCllvdSBsaW5rIGVuaGFuY2VtZW50IGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIiAvPiIgb24gPGlucDI6Y29uZl9Db25maWdWYWx1ZSBuYW1lPSJTaXRlX05hbWUiLz4gaGFzIGJlZW4gZXh0ZW5kZWQu - U3ViamVjdDogTGluayBFbmhhbmNlbWVudCBmb3IgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIgLz4iIC0gRXh0ZW5kZWQhCgpMaW5rIGVuaGFuY2VtZW50IGhhcyBiZWVuIGV4dGVuZGVkIGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIiAvPiIu - U3ViamVjdDogTGluayBFbmhhbmNlbWVudCBSZW5ld2FsIGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIiAvPiIgLSBGYWlsZWQKCkxpbmsgRW5oYW5jZW1lbnQgUmVuZXdhbCBmb3IgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIgLz4iIGhhcyBmYWlsZWQgb24gb24gPGlucDI6Y29uZl9Db25maWdWYWx1ZSBuYW1lPSJTaXRlX05hbWUiLz4u - U3ViamVjdDogTGluayBFbmhhbmNlbWVudCBSZW5ld2FsIGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIiAvPiIgLSBGYWlsZWQKCkxpbmsgRW5oYW5jZW1lbnQgUmVuZXdhbCBmb3IgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIgLz4iIGhhcyBmYWlsZWQu - U3ViamVjdDogTGluayBFbmhhbmNlbWVudCBSZW5ld2FsIG5vdGljZSBmb3IgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIgLz4iCgpEZWFyIDxpbnAyOnVfRmllbGQgbmFtZT0iRmlyc3ROYW1lIiAvPiA8aW5wMjp1X0ZpZWxkIG5hbWU9Ikxhc3ROYW1lIiAvPiw8YnIvPjxici8+DQoNCllvdXIgbGluayBlbmhhbmNlbWVudCBmb3IgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIgLz4iIG9uIDxpbnAyOmNvbmZfQ29uZmlnVmFsdWUgbmFtZT0iU2l0ZV9OYW1lIi8+IGlzIGFib3V0IHRvIGV4cGlyZS48YnIvPjxici8+DQoNClBsZWFzZSBsb2dpbiB0byB5b3VyIGFjY291bnQgdG8gcmVuZXcgeW91ciBsaW5rIGVuaGFuY2VtZW50Lg== - U3ViamVjdDogTGluayBFbmhhbmNlbWVudCBmb3IgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIgLz4iIGlzIGFib3V0IHRvIEV4cGlyZSEKClRoaXMgaXMgYW4gZW1haWwgbm90aWZpY2F0aW9uIHRoYXQgTGluayBFbmhhbmNlbWVudCBmb3IgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIgLz4iIGlzIGFib3V0IHRvIEV4cGlyZS48YnIvPjxici8+DQo= - U3ViamVjdDogWW91ciBMaW5rICI8aW5wMjpsX0ZpZWxkIG5hbWU9Ik5hbWUiIC8+IiBoYXMgYmVlbiBVcGRhdGVkCgpUaGFuayB5b3UgZm9yIHVwZGF0aW5nIHlvdXIgTGluayBkZXRhaWxzLg0KDQpZb3VyIExpbmsgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIgLz4iIGhhcyBiZWVuIG1vZGlmaWVk - U3ViamVjdDogTGluayAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIiAvPiIgaGFzIGJlZW4gTW9kaWZpZWQKCkxpbmsgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIgLz4iIGhhcyBiZWVuIG1vZGlmaWVkIHRvIHRoZSB1c2VyLg0K - U3ViamVjdDogWW91ciBNb2RpZmljYXRpb25zIGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIiAvPiIgYXBwcm92ZWQKCllvdXIgTW9kaWZpY2F0aW9ucyBmb3IgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIgLz4iIGxpbmsgd2VyZSBhcHByb3ZlZC4= - U3ViamVjdDogWW91ciBNb2RpZmljYXRpb25zIGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIi8+IiAtIERlY2xpbmVkCgpZb3VyIG1vZGlmaWNhdGlvbnMgZm9yICI8aW5wMjpsX0ZpZWxkIG5hbWU9Ik5hbWUiLz4iIGxpbmsgd2VyZSBkZWNsaW5lZC4= - U3ViamVjdDogTGluayBNb2RpZmljYXRpb25zIGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIi8+IiBwZW5kaW5nCgpUaGFuayB5b3UsPGJyPjxicj4NCg0KWW91ciBsaW5rIG1vZGlmaWNhdGlvbnMgZm9yICI8aW5wMjpsX0ZpZWxkIG5hbWU9Ik5hbWUiLz4iIGFyZSBwZW5kaW5nIGZvciBhZG1pbmlzdHJhdGl2ZSBhcHByb3ZhbC4= - U3ViamVjdDogTGluayBNb2RpZmljYXRpb25zIGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIi8+IiBwZW5kaW5nIGFwcHJvdmFsCgpNb2RpZmljYXRpb25zIGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIi8+IiBsaW5rIGFyZSBwZW5kaW5nIGZvciBhZG1pbmlzdHJhdGl2ZSBhcHByb3ZhbC4= - U3ViamVjdDogQ2hlY2sgZm9yIFJlY2lwcm9jYWwvQmFjayBMaW5rIG9uICI8aW5wMjpsX0ZpZWxkIG5hbWU9Ik5hbWUiLz4iIGlzIEZhaWxlZAoKQ2hlY2sgZm9yIFJlY2lwcm9jYWwvQmFjayBsaW5rIGlzIEZhaWxlZCBmb3I6PGJyLz48YnIvPg0KDQpMaW5rIElkOiA8aW5wMjpsX0ZpZWxkIG5hbWU9IkxpbmtJZCIvPjxici8+DQpMaW5rIE5hbWU6IDxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIvPjxici8+DQpMaW5rIFdlYnNpdGU6IDxhIGhyZWY9IjxpbnAyOmxfRmllbGQgbmFtZT0iVXJsIi8+Ij48aW5wMjpsX0ZpZWxkIG5hbWU9IlVybCIvPjwvYT48YnIvPg0K - U3ViamVjdDogWW91ciBDb21tZW50IGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIi8+IiBTdWJtaXR0ZWQKClRoYW5rIHlvdSwgeW91ciBjb21tZW50IGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIi8+IiBoYXMgYmVlbiBhZGRlZCB0byB0aGUgd2Vic2l0ZS4= - U3ViamVjdDogTmV3IENvbW1lbnQgZm9yICI8aW5wMjpsX0ZpZWxkIG5hbWU9Ik5hbWUiLz4iIGxpbmsgc3VibWl0dGVkCgpOZXcgY29tbWVudCBmb3IgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIvPiIgbGluayBoYXMgYmVlbiBzdWJtaXR0ZWQu - U3ViamVjdDogWW91ciBDb21tZW50IGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIi8+IiBsaW5rIGlzIHBlbmRpbmcKClRoYW5rIHlvdSBmb3Igc3VibWl0dGluZyB5b3VyIGNvbW1lbnQgZm9yICI8aW5wMjpsX0ZpZWxkIG5hbWU9Ik5hbWUiLz4iLjxicj48YnI+DQoNCkN1cnJlbnRseSBpdCdzIHBlbmRpbmcgZm9yIGFkbWluaXN0cmF0aXZlIGFwcHJvdmFsIGFuZCB3aWxsIGJlIHB1Ymxpc2hlZCBzaG9ydGx5Lg== - WC1NYWlsZXI6IEluLVBvcnRhbApTdWJqZWN0OiBZb3VyIENvbW1lbnQgZm9yICI8aW5wMjpsX0ZpZWxkIG5hbWU9Ik5hbWUiLz4iIGxpbmsgaXMgcGVuZGluZyBbYWRtaW5dCgpUaGFuayB5b3UgZm9yIHN1Ym1pdHRpbmcgeW91ciBjb21tZW50IGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIi8+Ii48YnI+PGJyPg0KDQpDdXJyZW50bHkgaXQncyBwZW5kaW5nIGZvciBhZG1pbmlzdHJhdGl2ZSBhcHByb3ZhbCBhbmQgd2lsbCBiZSBwdWJsaXNoZWQgc2hvcnRseS4= - U3ViamVjdDogWW91ciBDb21tZW50IGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIi8+IiAtIFB1Ymxpc2hlZAoKVGhhbmsgeW91IGZvciBzdWJtaXR0aW5nIHlvdXIgY29tbWVudCBmb3IgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIvPiIuPGJyLz48YnIvPg0KDQpJdCdzIGFscmVhZHkgcHVibGlzaGVkIG9uIHRoZSB3ZWJzaXRlIQ== - U3ViamVjdDogWW91ciBDb21tZW50IGZvciAiPGlucDI6bF9GaWVsZCBuYW1lPSJOYW1lIi8+IiAtIERlY2xpbmVkCgpTb3JyeSwgYnV0IHlvdXIgY29tbWVudCBmb3IgIjxpbnAyOmxfRmllbGQgbmFtZT0iTmFtZSIvPiIgbGluayBoYXMgYmVlbiBkZWNsaW5lZC4= - U3ViamVjdDogTGluayBWYWxpZGF0aW9uIFJlc3VsdHMgKDxpbnAyOmxhbmcuY3VycmVudF9DdXJyZW50RGF0ZSBmb3JtYXQ9ImQtTS1ZIi8+KQoKTGluayBWYWxpZGF0aW9uIENvbXBsZXRlZCBvbiA8aW5wMjpsYW5nLmN1cnJlbnRfQ3VycmVudERhdGUgZm9ybWF0PSJkLU0tWSIvPiBhdCA8aW5wMjpsYW5nLmN1cnJlbnRfQ3VycmVudERhdGUgZm9ybWF0PSJIOmk6cyIvPjxiciAvPjxiciAvPg0KDQo8aW5wMjpsaW5rLXZhbGlkYXRpb24uaW52YWxpZF9Jbml0TGlzdCBwZXJfcGFnZT0iLTEiLz4NCjxpbnAyOm1faWYgY2hlY2s9ImxpbmstdmFsaWRhdGlvbi5pbnZhbGlkX1RvdGFsUmVjb3JkcyI+DQoJVGhlZXNlIGxpbmtzIHdlcmUgbWFya2VkIGFzIGludmFsaWQgZHVyaW5nIHZhbGlkYXRpb24gcHJvY2Vzczo8YnIgLz4NCg0KCTxpbnAyOm1fRGVmaW5lRWxlbWVudCBuYW1lPSJsaW5rX2VsZW1lbnQiPg0KCQk8bGk+DQoJCQk8aW5wMjpGaWVsZCBuYW1lPSJMaW5rTmFtZSIvPiAoPGlucDI6Q2F0ZWdvcnlOYW1lLz4pDQoJCTwvbGk+DQoJPC9pbnAyOm1fRGVmaW5lRWxlbWVudD4NCg0KCTx1bD4NCgkJPGlucDI6bGluay12YWxpZGF0aW9uLmludmFsaWRfUHJpbnRMaXN0IHJlbmRlcl9hcz0ibGlua19lbGVtZW50Ii8+DQoJPC91bD4NCjxpbnAyOm1fZWxzZS8+DQoJQWxsIGxpbmtzIGFwcGVhciB0byBiZSB2YWxpZC4NCjwvaW5wMjptX2lmPg== - - - \ No newline at end of file Index: branches/5.0.x/in-link/install/install_schema.sql =================================================================== diff -u -N --- branches/5.0.x/in-link/install/install_schema.sql (revision 12746) +++ branches/5.0.x/in-link/install/install_schema.sql (revision 0) @@ -1,145 +0,0 @@ -CREATE TABLE Link ( - LinkId int(11) NOT NULL auto_increment, - Name varchar(255) NOT NULL default '', - l1_Name varchar(255) NOT NULL default '', - l2_Name varchar(255) NOT NULL default '', - l3_Name varchar(255) NOT NULL default '', - l4_Name varchar(255) NOT NULL default '', - l5_Name varchar(255) NOT NULL default '', - AutomaticFilename tinyint(3) unsigned NOT NULL default '1', - Description text, - l1_Description text, - l2_Description text, - l3_Description text, - l4_Description text, - l5_Description text, - MetaKeywords varchar(255) default NULL, - MetaDescription text, - Url varchar(255) NOT NULL default '', - CreatedOn int(10) unsigned default NULL, - Modified int(10) unsigned default NULL, - Expire int(10) unsigned default NULL, - Hits double(20,6) NOT NULL default '0.000000', - CachedRating varchar(10) NOT NULL default '0', - CachedVotesQty int(11) NOT NULL default '0', - CachedReviewsQty int(11) NOT NULL default '0', - CreatedById int(11) NOT NULL default '-1', - ModifiedById int(11) NOT NULL default '-1', - Priority int(11) NOT NULL default '0', - `Status` tinyint(4) NOT NULL default '2', - EditorsPick tinyint(4) NOT NULL default '0', - ResourceId int(11) default NULL, - HotItem tinyint(4) NOT NULL default '2', - PopItem tinyint(4) NOT NULL default '2', - NewItem tinyint(4) NOT NULL default '2', - OrgId int(11) default NULL, - CustomTemplate varchar(255) NOT NULL default '', - ReciprocalLinkFound tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (LinkId), - UNIQUE KEY ResourceId (ResourceId), - KEY sorting (Priority,Name), - KEY Hits (Hits), - KEY Name (Name), - KEY l1_Name (l1_Name), - KEY l2_Name (l2_Name), - KEY l3_Name (l3_Name), - KEY l4_Name (l4_Name), - KEY l5_Name (l5_Name), - KEY Description (Description(5)), - KEY l1_Description (l1_Description(5)), - KEY l2_Description (l2_Description(5)), - KEY l3_Description (l3_Description(5)), - KEY l4_Description (l4_Description(5)), - KEY l5_Description (l5_Description(5)), - KEY EditorsPick (EditorsPick), - KEY CreatedOn (CreatedOn), - KEY Modified (Modified,CreatedOn), - KEY `Status` (`Status`), - KEY HotItem (HotItem), - KEY PopItem (PopItem), - KEY NewItem (NewItem) -); - -CREATE TABLE LinkValidation ( - LinkValidationId int(11) NOT NULL AUTO_INCREMENT, - LinkId int(11) NOT NULL DEFAULT '0', - ValidationTime int(11) DEFAULT NULL, - ValidationCode varchar(50) DEFAULT NULL, - ValidationStatus tinyint(4) NOT NULL DEFAULT '0', - PRIMARY KEY (LinkValidationId), - UNIQUE KEY LinkId (LinkId), - KEY ValidationStatus (ValidationStatus), - KEY ValidationTime (ValidationTime) -); - -CREATE TABLE Listings ( - ListingId int(11) NOT NULL auto_increment, - ListingTypeId int(11) default '0', - ItemResourceId int(11) default NULL, - PurchasedOn int(11) default NULL, - ExpiresOn int(11) default NULL, - `Status` TINYINT(4) UNSIGNED NOT NULL DEFAULT '2', - PendingRenewal tinyint(4) NOT NULL default '0', - RenewalReminderSent tinyint(4) NOT NULL default '0', - PRIMARY KEY (ListingId), - KEY ListingTypeId (ListingTypeId), - KEY ItemResourceId (ItemResourceId), - KEY PurchasedOn (PurchasedOn), - KEY ExpiresOn (ExpiresOn), - KEY Status (Status), - KEY RenewalReminderSent (RenewalReminderSent) -); - -CREATE TABLE ListingTypes ( - ListingTypeId int(11) NOT NULL AUTO_INCREMENT, - `Name` varchar(255) NOT NULL DEFAULT '', - Description text, - Duration int(11) NOT NULL DEFAULT '0', - DurationType int(11) NOT NULL DEFAULT '0', - OnPurchaseEdPick tinyint(4) NOT NULL DEFAULT '3', - OnPurchaseNew tinyint(4) NOT NULL DEFAULT '3', - OnPurchasePop tinyint(4) NOT NULL DEFAULT '3', - OnPurchaseHot tinyint(4) NOT NULL DEFAULT '3', - OnPurchasePriorityAction tinyint(4) NOT NULL DEFAULT '0', - OnPurchasePriorityValue tinyint(4) NOT NULL DEFAULT '1', - OnPurchaseAddToCatEnabled tinyint(4) NOT NULL DEFAULT '0', - OnPurchaseAddToCat int(11) NOT NULL DEFAULT '0', - OnPurchaseCustomTemplate varchar(255) NOT NULL DEFAULT '', - OnPurchaseStatus tinyint(4) NOT NULL DEFAULT '3', - OnExpireEdPick tinyint(4) NOT NULL DEFAULT '3', - OnExpireNew tinyint(4) NOT NULL DEFAULT '3', - OnExpirePop tinyint(4) NOT NULL DEFAULT '3', - OnExpireHot tinyint(4) NOT NULL DEFAULT '3', - OnExpirePriorityAction tinyint(4) NOT NULL DEFAULT '0', - OnExpirePriorityValue tinyint(4) NOT NULL DEFAULT '1', - OnExpireRemoveFromCatEnabled tinyint(4) NOT NULL DEFAULT '0', - OnExpireRemoveFromCat int(11) NOT NULL DEFAULT '0', - OnExpireCustomTemplate varchar(255) NOT NULL DEFAULT '', - OnExpireStatus tinyint(4) NOT NULL DEFAULT '3', - RenewalReminder int(11) NOT NULL DEFAULT '0', - EnableBuying tinyint(4) NOT NULL DEFAULT '0', - ShopCartName varchar(255) DEFAULT NULL, - Price double DEFAULT NULL, - Recurring tinyint(4) NOT NULL DEFAULT '0', - VirtualProductId int(11) NOT NULL DEFAULT '0', - PRIMARY KEY (ListingTypeId), - KEY VirtualProductId (VirtualProductId) -); - -CREATE TABLE LinkCustomData ( - CustomDataId int(11) NOT NULL auto_increment, - ResourceId int(10) unsigned NOT NULL default '0', - KEY ResourceId (ResourceId), - PRIMARY KEY (CustomDataId) -); - -CREATE TABLE LinkVisits ( - VisitId int(11) NOT NULL AUTO_INCREMENT, - ResourceId int(11) DEFAULT NULL, - PortalUserId int(11) NOT NULL DEFAULT '0', - VisitTimestamp int(11) DEFAULT NULL, - PRIMARY KEY (VisitId), - KEY ResourceId (ResourceId), - KEY PortalUserId (PortalUserId), - KEY VisitTimestamp (VisitTimestamp) -); Index: branches/5.0.x/in-link/install/remove_schema.sql =================================================================== diff -u -N --- branches/5.0.x/in-link/install/remove_schema.sql (revision 12746) +++ branches/5.0.x/in-link/install/remove_schema.sql (revision 0) @@ -1,6 +0,0 @@ -DROP TABLE Link; -DROP TABLE LinkValidation; -DROP TABLE Listings; -DROP TABLE ListingTypes; -DROP TABLE LinkCustomData; -DROP TABLE LinkVisits; \ No newline at end of file Index: branches/5.0.x/in-link/install/upgrades.php =================================================================== diff -u -N --- branches/5.0.x/in-link/install/upgrades.php (revision 12746) +++ branches/5.0.x/in-link/install/upgrades.php (revision 0) @@ -1,141 +0,0 @@ -_toolkit =& $instance; - } - - /** - * Changes table structure, where multilingual fields of TEXT type are present - * - * @param string $mode when called mode {before, after) - */ - function Upgrade_5_0_0($mode) - { - if ($mode == 'after') { - $root_category = $this->Application->findModule('Name', 'In-Link', 'RootCat'); - - $sql = 'UPDATE ' . $this->Application->getUnitOption('c', 'TableName') . ' - SET UseMenuIconUrl = 1, MenuIconUrl = "in-link/img/menu_links.gif" - WHERE ' . $this->Application->getUnitOption('c', 'IDField') . ' = ' . $root_category; - $this->Conn->Query($sql); - - $this->_updateDetailTemplate('l', 'inlink/detail', 'in-link/designs/detail'); - - // copy link name and description to their multilingual equivalents - $this->_copyToMultilingual(); - } - } - - /** - * Copy link values from normal fields to multilingual - * - */ - function _copyToMultilingual() - { - $fields = Array ('Name', 'Description'); - $primary_language = $this->Application->GetDefaultLanguageId(); - - $set_clause = Array (); - foreach ($fields as $field) { - $set_clause[] = 'l' . $primary_language . '_' . $field . ' = ' . $field; - } - - $sql = 'UPDATE ' . TABLE_PREFIX . 'Link - SET ' . implode(', ', $set_clause); - $this->Conn->Query($sql); - } - - /** - * Replaces deprecated detail template design with new one - * - * @param string $prefix - * @param string $from_template - * @param string $to_template - */ - function _updateDetailTemplate($prefix, $from_template, $to_template) - { - $sql = 'SELECT CustomFieldId - FROM ' . TABLE_PREFIX . 'CustomField - WHERE FieldName = "' . $prefix . '_ItemTemplate"'; - $custom_field_id = $this->Conn->GetOne($sql); - - $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); - /* @var $ml_formatter kMultiLanguage */ - - $field = $ml_formatter->LangFieldName('cust_' . $custom_field_id, true); - - $sql = 'UPDATE ' . TABLE_PREFIX . 'CategoryCustomData - SET ' . $field . ' = "' . $to_template . '" - WHERE ' . $field . ' = "' . $from_template . '"'; - $this->Conn->Query($sql); - } - - /** - * Update to 5.0.1 - * - * @param string $mode when called mode {before, after) - */ - function Upgrade_5_0_1($mode) - { - if ($mode == 'after') { - $this->_updateDetailTemplate('l', 'in-link/designs/detail', 'in-link/links/link_detail'); - - // delete old events - $events_to_delete = Array ( 'LINK.OWNER.MODIFY.PENDING', 'LINK.OWNER.MODIFY' ); - - $sql = 'SELECT EventId FROM ' . TABLE_PREFIX . 'Events - WHERE Event IN ("' . implode('","', $events_to_delete) . '")'; - $event_ids = $this->Conn->GetCol($sql); - - if ($event_ids) { - $sql = 'DELETE FROM ' . TABLE_PREFIX . 'EmailMessage - WHERE EventId IN (' . implode(',', $event_ids) . ')'; - $this->Conn->Query($sql); - - $sql = 'DELETE FROM ' . TABLE_PREFIX . 'Events - WHERE EventId IN (' . implode(',', $event_ids) . ')'; - $this->Conn->Query($sql); - - $sql = 'DELETE FROM ' . TABLE_PREFIX . 'Phrase - WHERE Phrase IN ("la_event_link.owner.modify", "la_event_link.owner.modify.pending")'; - $this->Conn->Query($sql); - } - } - } - - } \ No newline at end of file Index: branches/5.0.x/in-link/install/upgrades.sql =================================================================== diff -u -N --- branches/5.0.x/in-link/install/upgrades.sql (revision 12746) +++ branches/5.0.x/in-link/install/upgrades.sql (revision 0) @@ -1,58 +0,0 @@ -# ===== v 4.3.9 ===== -INSERT INTO Events VALUES (DEFAULT, 'LINK.VALIDATION.RESULTS', NULL, 1, 0, 'In-Link', 'la_event_link.validation.results', 1); - -INSERT INTO ImportScripts VALUES (DEFAULT, 'Links from CSV file [In-Link]', '', 'l', 'In-Link', '', 'CSV', '1'); - -UPDATE CustomField -SET ValueList = '=+||SELECT DestAbbr AS OptionValue, DestName AS OptionName FROM StdDestinations WHERE DestType = 2 AND (DestParentId = 225 OR DestParentId = 38) ORDER BY DestParentId DESC, DestAbbr ASC' -WHERE FieldName = 'LinkState'; - -UPDATE CustomField -SET ValueList = '=+||SELECT DestAbbr AS OptionValue, DestName AS OptionName FROM StdDestinations WHERE DestType = 1 ORDER BY DestAbbr ASC' -WHERE FieldName = 'LinkCountry'; - -# ===== v 5.0.0 ===== -INSERT INTO Counters VALUES (DEFAULT, 'linkhits_count', 'SELECT ROUND(SUM(Hits)) FROM <%PREFIX%>Link', NULL, NULL, '300', '0', '|Link|'); -UPDATE Category SET Template = '/in-link/designs/section' WHERE Template = 'inlink/index'; -UPDATE Category SET CachedTemplate = '/in-link/designs/section' WHERE CachedTemplate = 'inlink/index'; - -UPDATE ConfigurationValues SET VariableValue = '/in-link/designs/section' WHERE VariableName = 'l_CategoryTemplate'; -UPDATE ConfigurationValues SET VariableValue = 'in-link/designs/detail' WHERE VariableName = 'l_ItemTemplate'; - -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:links.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:setting_folder.view', 11, 1, 1, 0); -DELETE FROM Permissions WHERE Permission LIKE 'in-link:inlink_general.%'; - -UPDATE Events SET Description = 'la_event_link.owner.modify' WHERE Description = 'la_event_link.modify.modify'; -UPDATE Events SET Description = 'la_event_link.owner.modify.pending' WHERE Description = 'la_event_link.modify.modify.pending'; - -UPDATE Phrase SET Module = 'In-Link' WHERE ((Phrase LIKE '%Links%' OR Phrase LIKE '%Listing%') AND (Module = 'Core') AND Phrase NOT IN ('la_section_QuickLinks')); - -UPDATE Phrase SET Module = 'In-Link', PhraseType = 1 WHERE ( (Phrase LIKE '%Validation%' OR Phrase LIKE 'la_title_In-Link') AND (Module = 'Core') AND Phrase NOT IN ('la_ValidationEmail', 'la_prompt_validation')); - -# ===== v 5.0.1 ===== -UPDATE ConfigurationValues SET VariableValue = 'in-link/links/link_detail' WHERE VariableName = 'l_ItemTemplate'; - -UPDATE ConfigurationAdmin SET ValueList = 'ReviewText=la_opt_CommentText,CreatedOn=la_opt_CreatedOn' -WHERE VariableName IN ('Link_ReviewsSort', 'Link_ReviewsSort2'); - -UPDATE ConfigurationAdmin SET ValueList = 'ASC=la_common_Ascending,DESC=la_common_Descending' -WHERE VariableName IN ('Link_ReviewsOrder', 'Link_ReviewsOrder2'); - -UPDATE ConfigurationAdmin SET ValueList = 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_opt_CreatedOn,Hits=la_Link_Hits,CachedRating=la_opt_Rating,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 4) AND (IsSystem = 0)' -WHERE VariableName IN ('Link_SortField', 'Link_SortField2'); - -UPDATE ConfigurationAdmin -SET ValueList = '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year' -WHERE VariableName IN ('link_ReviewDelay_Interval', 'link_RatingDelay_Interval'); - -UPDATE CustomField SET FieldLabel = 'la_fld_cust_l_ItemTemplate', Prompt = 'la_fld_cust_l_ItemTemplate' WHERE FieldName = 'l_ItemTemplate'; - -INSERT INTO Events VALUES(DEFAULT, 'LINK.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-Link', 'la_event_link.review.add.pending', 1); - -UPDATE ConfigurationAdmin SET ValueList = 'style="width: 50px;"' WHERE VariableName IN ('link_ReviewDelay_Value', 'link_RatingDelay_Value'); - -# ===== v 5.0.2-B1 ===== -ALTER TABLE ListingTypes CHANGE Description Description text NULL; -ALTER TABLE LinkValidation CHANGE ValidationTime ValidationTime INT NULL DEFAULT NULL; -ALTER TABLE LinkVisits CHANGE VisitTimestamp VisitTimestamp INT(11) NULL DEFAULT NULL; \ No newline at end of file Index: branches/5.0.x/in-link/constants.php =================================================================== diff -u -N --- branches/5.0.x/in-link/constants.php (revision 12746) +++ branches/5.0.x/in-link/constants.php (revision 0) @@ -1,29 +0,0 @@ -toolkit; - /* @var $toolkit kInstallToolkit */ - } - - $application =& kApplication::Instance(); - $application->Init(); - - if ($application->RecallVar('user_id') != -1) { - die('restricted access!'); - } - - $category =& $toolkit->createModuleCategory('Directory', 'Link Directory', '/in-link/designs/section', 'in-link/img/menu_links.gif'); - - $toolkit->RunSQL('/' . $module_folder . '/install/install_schema.sql'); - $toolkit->RunSQL('/' . $module_folder . '/install/install_data.sql', '{LinkCatId}', $category->GetID()); - $toolkit->ImportLanguage('/' . $module_folder . '/install/english'); - - $toolkit->SetModuleRootCategory($module_folder, $category->GetID()); - - $toolkit->linkCustomFields($module_folder, 'l', 4); // to create Custom Fields for Links - $toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field - $toolkit->setModuleItemTemplate($category, 'l', 'in-link/links/link_detail'); - - $toolkit->finalizeModuleInstall($module_folder, true); \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/import.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/import.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/import.tpl (revision 0) @@ -1,229 +0,0 @@ - - - - - - - - - - - - - -
    - -
    - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - -
    - " id="_1" checked value="1" /> - - - - " id="" onclick="check_radio('_1');"> -
    - " id="_2" checked value="2" /> - - - - -
    -
    - - - - - - - - - - - -
    - " id="btn_move_up" onclick="move_options_up('', 1)" class="button"> - " id="btn_move_down" onclick="move_options_down('', 1)" class="button">
    -
    -

    :
    - - " value="" /> - - ', '')" class="button">
    -
    - ', ''); select_sort('');" class="button"> -
    - -
    -
    - - - ', 'ImportCategory', null, 'OnSaveSettings');"> -
    - - - - - - - - - - -
    - checked name="" id="_1" value="1" /> - - -
    - checked name="" id="_2" value="2" /> - - - - - -
    -
    -
    - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/export_progress.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/export_progress.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/export_progress.tpl (revision 0) @@ -1,14 +0,0 @@ - - - - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/paid_listings/paid_listing_edit.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/paid_listings/paid_listing_edit.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/paid_listings/paid_listing_edit.tpl (revision 0) @@ -1,113 +0,0 @@ - - - - - - - - - - -
    - -
    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    - - -
    -
    - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/paid_listings/paid_listing_types_tabs.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/paid_listings/paid_listing_types_tabs.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/paid_listings/paid_listing_types_tabs.tpl (revision 0) @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/paid_listings/paid_listing_type_edit.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/paid_listings/paid_listing_type_edit.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/paid_listings/paid_listing_type_edit.tpl (revision 0) @@ -1,307 +0,0 @@ - - - - - - - - - - - - -
    - -
    - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - " value="" /> - - - - ', '', null, 'OnPreSaveListingType');"> - - - - - - - - - - - - - - - - - -
    - " id="" value="" tabindex="" size="5"> - -
    - " id="" value="" tabindex="" size="5"> - -
       - - - - - -
    - - - -
    -
      - - - - - -
    - - - -
    -
      - - - - - -
    - - - -
    -
      - - - - - -
    - - - -
    -
      - - - - - -
    - - - -
    -
      - - - - - -
    - - - -
    -
      - - - - - -
    - - " id="" value="" tabindex="" size="5"> - - - " id="" value="" tabindex="" size="5"> -
    -
      - - - - - -
    - " id="" value="" tabindex="" size="40"> - - " id="" value="" tabindex="" size="40"> -
    -
      - - - - - -
    - " name="" value=""> - " type="checkbox" id="_cb_" name="_cb_" onclick="update_checkbox(this, document.getElementById(''))"> - - - - - - - " name="" value=""> - " type="checkbox" id="_cb_" name="_cb_" onclick="update_checkbox(this, document.getElementById(''))"> - - - - - -
    -
    -
    - - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/paid_listings/paid_listing_types_list.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/paid_listings/paid_listing_types_list.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/paid_listings/paid_listing_types_list.tpl (revision 0) @@ -1,54 +0,0 @@ - - - - - - - - - - - - -
    - -
    - - -   - - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/paid_listings/paid_listings_list.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/paid_listings/paid_listings_list.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/paid_listings/paid_listings_list.tpl (revision 0) @@ -1,75 +0,0 @@ - - - - - - - - - - - - -
    - -
    - - -   - - - - "> - - - - "> - - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/link_validation/link_validation_progress.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/link_validation/link_validation_progress.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/link_validation/link_validation_progress.tpl (revision 0) @@ -1,14 +0,0 @@ - - - - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/link_validation/link_validation_list.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/link_validation/link_validation_list.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/link_validation/link_validation_list.tpl (revision 0) @@ -1,134 +0,0 @@ - - - - - - - - - - - -
    - -
    - - - - - - -
    - - - : "> - -
    - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/duplicate_checker.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/duplicate_checker.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/duplicate_checker.tpl (revision 0) @@ -1,73 +0,0 @@ - - - - - - - - - - - - - -
    - -
    - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/import_progress.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/import_progress.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/import_progress.tpl (revision 0) @@ -1,14 +0,0 @@ - - - - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/catalog_tab.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/catalog_tab.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/catalog_tab.tpl (revision 0) @@ -1,55 +0,0 @@ - - - - - a_toolbar.AddButton( - new ToolBarButton( - 'in-link:new_link', - '', - add_item, - true - ) - ); - - - - - - - - - $Catalog.setItemCount('', ''); - - - - - - - - - - $Catalog.setItemCount('', ''); - $Catalog.setCurrentCategory('', ); - $Catalog.saveSearch('', '', ''); - - - - - Grids[''].AddAlternativeGrid('', true); - - Grids[''].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','sep3','cut','copy','move_up','move_down','sep6')); - $Catalog.reflectPasteButton(); - $Catalog.setViewMenu(''); - - Grids[''].DblClick = function() {return false}; - - #separator# - - - - - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/export.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/export.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/export.tpl (revision 0) @@ -1,126 +0,0 @@ - - - - - - - - - - - - -
    - -
    - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - -
    - " onclick="move_options_up('', 1)" class="button"> - " onclick="move_options_down('', 1)" class="button">
    -
    -

    :
    - - " value="" /> - - ', '')" class="button">
    -
    - ', ''); select_sort('');" class="button"> -
    - -
    -
    - - - - - - - - - - - - - -
    - checked name="" id="_1" value="1" /> - - -
    - error"> *: - " id="" value="" size="2" maxlength="1" />
    - (will look like "Category:Sub-category:Sub-sub-category") - -
    - checked name="" id="_2" value="2" /> - -
    - (the fields will be titled Category1..CategoryN accordingly) -
    -
    -
    - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/category_properties.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/category_properties.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/category_properties.tpl (revision 0) @@ -1,2 +0,0 @@ - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/duplicate_checker/duplicate_link_view.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/duplicate_checker/duplicate_link_view.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/duplicate_checker/duplicate_link_view.tpl (revision 0) @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - -
    - -
    - - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/links/relations_edit.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/links/relations_edit.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/links/relations_edit.tpl (revision 0) @@ -1,49 +0,0 @@ - - - - - - - - - - -
    - -
    - - - - - - -
    - - - - - - - - - - - - - -
    -
    - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/links/file_edit.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/links/file_edit.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/links/file_edit.tpl (revision 0) @@ -1,41 +0,0 @@ - - - - - - - - - - -
    - -
    - - - - -
    - - - - - - - -
    -
    - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/links/links_edit.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/links/links_edit.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/links/links_edit.tpl (revision 0) @@ -1,128 +0,0 @@ - - - - - - - - - - - - - - -
    - -
    - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -   -
    -
    - - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/links/links_custom.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/links/links_custom.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/links/links_custom.tpl (revision 0) @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/links/links_categories.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/links/links_categories.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/links/links_categories.tpl (revision 0) @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/links/links_images.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/links/links_images.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/links/links_images.tpl (revision 0) @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - -
    - -
    - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/links/images_edit.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/links/images_edit.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/links/images_edit.tpl (revision 0) @@ -1,60 +0,0 @@ - - - - - - - - - - - - -
    - -
    - - - - -
    - - - - - - - - - - - - - - - - - - - -
    -
    - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/links/links_relations.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/links/links_relations.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/links/links_relations.tpl (revision 0) @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - -
    - -
    - - - -"> -"> - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/links/links_reviews.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/links/links_reviews.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/links/links_reviews.tpl (revision 0) @@ -1,114 +0,0 @@ - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/links/review_edit.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/links/review_edit.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/links/review_edit.tpl (revision 0) @@ -1,60 +0,0 @@ - - - - - - - - - - -
    - -
    - - - - -
    - - - - - - - - - - - - - -
    -
    - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/links/inlink_redirect.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/links/inlink_redirect.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/links/inlink_redirect.tpl (revision 0) @@ -1 +0,0 @@ - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/links/links_files.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/links/links_files.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/links/links_files.tpl (revision 0) @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - -
    - -
    - - - - - \ No newline at end of file Index: branches/5.0.x/in-link/admin_templates/user_item_tab.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/user_item_tab.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/user_item_tab.tpl (revision 0) @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - $Catalog.setItemCount('', ''); - $Catalog.setCurrentCategory('', ); - $Catalog.saveSearch('', '', ''); - - - - Grids[''].SetDependantToolbarButtons( new Array('edit','delete')); - $Catalog.setViewMenu(''); - #separator# - - - - - - - - - \ No newline at end of file Index: branches/RC/in-link/admin_templates/img/link_arrow.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/logo_bg.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_invalid_disabled.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_valid.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_listing_pending.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_valid_disabled.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_link_new.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_listing_type.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_link_pick.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_link.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_listing_disabled.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_valid_pend.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_listing.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_not_validated.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_link_disabled.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_link_hot.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_custom.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_link_pending.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_invalid_pend.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_not_validated_disabled.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_link_pop.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_invalid.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/itemicons/icon16_not_validated_pend.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/icons/icon24_settings_in-link.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/icons/icon46_list_settings_in-link.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/icons/icon46_list_validate.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/icons/icon46_paid_listings.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/icons/icon46_validate.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/icons/icon24_paid_listings.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/icons/icon24_duplicate_checker.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/icons/icon24_validate.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/icons/icon46_list_duplicate_checker.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/icons/icon46_duplicate_checker.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/icons/icon46_settings_in-link.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/icons/icon46_list_paid_listings.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/icons/icon46_listing_types.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/icons/icon46_links.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_validate_restart.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_new_link_f3.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_merge_links.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_new_listing_type.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_new_link.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_new_listing_f2.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_validate_restart_f3.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_validate_f3.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_validate_continue_f3.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_validate_f2.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_validate_continue.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_validate.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_validate_reset_f3.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_validate_reset_f2.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_new_listing_type_f2.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_merge_links_f2.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_new_link_f2.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_merge_links_f3.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_new_listing.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_validate_continue_f2.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_validate_reset.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/RC/in-link/admin_templates/img/toolbar/tool_validate_restart_f2.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/5.0.x/in-link/admin_templates/export_finish.tpl =================================================================== diff -u -N --- branches/5.0.x/in-link/admin_templates/export_finish.tpl (revision 12746) +++ branches/5.0.x/in-link/admin_templates/export_finish.tpl (revision 0) @@ -1,43 +0,0 @@ - - - - - - - - - - -
    - -
    - -
    - - - - - - - - - - - -
    - -   - "> -
    -
    - - \ No newline at end of file Index: branches/5.0.x/in-link/units/link_validation/link_validation_tp.php =================================================================== diff -u -N --- branches/5.0.x/in-link/units/link_validation/link_validation_tp.php (revision 12746) +++ branches/5.0.x/in-link/units/link_validation/link_validation_tp.php (revision 0) @@ -1,58 +0,0 @@ -getObject($params); - - $url = $object->GetDBField($params['field']); - if (!preg_match('/^(http|ftp|mailto:)(.*)/U', $url)) { - $url = 'http://' . $url; - } - - return $url; - } - - /** - * Show CachedNavbar of current item primary category - * - * @param Array $params - * @return string - */ - function CategoryName($params) - { - // show category cachednavbar of - $object =& $this->getObject($params); - $category_id = isset($params['cat_id']) ? $params['cat_id'] : $object->GetDBField('CategoryId'); - - $category_path = $this->Application->getCache('category_paths', $category_id); - if ($category_path === false) { - // not chached - if ($category_id > 0) { - - $cached_navbar = preg_replace('/^(Content&\|&|Content)/i', '', $object->GetDBField('CachedNavbar')); - $category_path = trim($this->CategoryName( Array('cat_id' => 0) ).' > '.str_replace('&|&', ' > ', $cached_navbar), ' > '); - } - else { - $category_path = $this->Application->Phrase( $this->Application->ConfigValue('Root_Name') ); - } - $this->Application->setCache('category_paths', $category_id, $category_path); - } - return $category_path; - } - } \ No newline at end of file Index: branches/5.0.x/in-link/units/link_validation/link_validation_config.php =================================================================== diff -u -N --- branches/5.0.x/in-link/units/link_validation/link_validation_config.php (revision 12746) +++ branches/5.0.x/in-link/units/link_validation/link_validation_config.php (revision 0) @@ -1,182 +0,0 @@ - 'link-validation', - 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), - 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'), - 'EventHandlerClass' => Array ('class' => 'LinkValidationEventHandler', 'file' => 'link_validation_eh.php', 'build_event' => 'OnBuild'), - 'TagProcessorClass' => Array ('class' => 'LinkValidationTagProcessor', 'file' => 'link_validation_tp.php', 'build_event' => 'OnBuild'), - - 'AutoLoad' => true, - - 'Hooks' => Array ( - Array ( - 'Mode' => hAFTER, - 'Conditional' => true, - 'HookToPrefix' => 'l', - 'HookToSpecial' => '*', - 'HookToEvent' => Array('OnAfterConfigRead'), - 'DoPrefix' => '', - 'DoSpecial' => '*', - 'DoEvent' => 'OnPrepareLinkEditing', - ), - ), - - 'QueryString' => Array ( - 1 => 'id', - 2 => 'Page', - 3 => 'event', - 4 => 'mode', - ), - - 'RegularEvents' => Array ( - 'link_validation' => Array ('EventName' => 'OnCronValidation', 'RunInterval' => 3600*24, 'Type' => reAFTER), - ), - - 'IDField' => 'LinkValidationId', - - 'TableName' => TABLE_PREFIX.'LinkValidation', - - 'StatusField' => Array ('ValidationStatus', 'LinkStatus'), - - 'TitlePresets' => Array ( - 'link_validation_list' => Array ('prefixes' => Array ('link-validation_List'), 'format' => "!la_tab_LinkValidation!"), - 'link_validation_progress' => Array ('format' => '!la_tab_ValidatingLinks!'), - ), - - 'PermSection' => Array('main' => 'in-link:link_validation'), - - 'Sections' => Array ( - 'in-link:link_validation' => Array ( - 'parent' => 'in-link', - 'icon' => 'in-link:validate', - 'label' => 'la_tab_LinkValidation', - 'url' => Array('t' => 'in-link/link_validation/link_validation_list', 'pass' => 'm'), - 'permissions' => Array('view', 'advanced:continue', 'advanced:restart', 'advanced:validate', 'advanced:reset'), - 'priority' => 3, - 'type' => stTREE, - ), - ), - - 'FilterMenu' => Array ( - 'Groups' => Array( - Array('mode' => 'AND', 'filters' => Array('show_valid', 'show_invalid', 'show_not_validated'), 'type' => WHERE_FILTER), - ), - - 'Filters' => Array ( - 'show_valid' => Array ('label' =>'la_Text_Valid', 'on_sql' => '', 'off_sql' => '%1$s.ValidationStatus != ' . LINK_VALIDATION_VALID . ' OR %1$s.ValidationStatus IS NULL'), - 'show_invalid' => Array ('label' => 'la_Text_Invalid', 'on_sql' => '', 'off_sql' => '%1$s.ValidationStatus != ' . LINK_VALIDATION_INVALID . ' OR %1$s.ValidationStatus IS NULL'), - 'show_not_validated' => Array ('label' => 'la_Text_Not_Validated', 'on_sql' => '', 'off_sql' => '%1$s.ValidationStatus != ' . LINK_VALIDATION_NOT_VALIDATED . ' OR %1$s.ValidationStatus IS NOT NULL'), - ) - ), - - 'ListSQLs' => Array ( - '' => ' SELECT %1$s.* %2$s - FROM ' . TABLE_PREFIX . 'Link l - LEFT JOIN %1$s ON %1$s.LinkId = l.LinkId - LEFT JOIN ' . TABLE_PREFIX . 'CategoryItems ci ON ci.ItemResourceId = l.ResourceId - LEFT JOIN '.TABLE_PREFIX.'Category c ON c.CategoryId = ci.CategoryId', - ), - - 'ListSortings' => Array ( - '' => Array ( - 'Sorting' => Array ('LinkValidationId' => 'desc'), - ) - ), - - 'CalculatedFields' => Array ( - '' => Array ( - 'ForeignLinkId' => 'l.LinkId', - 'LinkName' => 'l.Name', - 'LinkUrl' => 'l.Url', - 'LinkCreatedOn' => 'l.CreatedOn', - 'LinkStatus' => 'l.Status', - 'LinkValidationStatus' => 'IF(%1$s.ValidationStatus IS NULL, ' . LINK_VALIDATION_NOT_VALIDATED . ', %1$s.ValidationStatus)', - - 'CategoryId' => 'ci.CategoryId', - ), - ), - - 'Fields' => Array ( - 'LinkValidationId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'LinkId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'ValidationTime' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => NULL), - 'ValidationCode' => Array ( - 'type' => 'string', - 'formatter' => 'kOptionsFormatter', 'options' => Array (200 => '200 OK', 301 => '301 Moved Permanently', 302 => '302 Found', 400 => '400 Bad Request', 403 => '403 Forbidden', 404 => '404 Not Found', 500 => '500 Internal Server Error'), - 'max_len' => 50, 'default' => NULL - ), - 'ValidationStatus' => Array ( - 'type' => 'int', - 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_Text_Not_Validated', 1 => 'la_Text_Valid', 2 => 'la_Text_Invalid'), 'use_phrases' => 1, - 'not_null' => 1, 'default' => 0 - ), - ), - - 'VirtualFields' => Array ( - 'ForeignLinkId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'LinkName' => Array('type' => 'string', /*'formatter' => 'kMultiLanguage',*/ 'not_null' => 1, 'max_len' => 255, 'default' => ''), - 'LinkUrl' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''), - 'LinkCreatedOn' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'), - 'LinkStatus' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), - 'LinkValidationStatus' => Array ( - 'type' => 'int', - 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_Text_Not_Validated', 1 => 'la_Text_Valid', 2 => 'la_Text_Invalid'), 'use_phrases' => 1, - 'not_null' => 1, 'default' => 0 - ), - - // for category path drawing - 'CategoryId' => Array ('type' => 'int', 'default' => 0), - 'CachedNavbar' => Array ('type' => 'string', 'default' => ''), - ), - - 'Grids' => Array ( - 'Default' => Array ( - 'Icons' => Array ( - 'default' => 'icon16_link.png', - // for valid links - LINK_VALIDATION_VALID . '_' . STATUS_DISABLED => 'icon16_valid_disabled.gif', - LINK_VALIDATION_VALID . '_' . STATUS_ACTIVE => 'icon16_valid.gif', - LINK_VALIDATION_VALID . '_' . STATUS_PENDING => 'icon16_valid_pend.gif', - - // for invalid links - LINK_VALIDATION_INVALID . '_' . STATUS_DISABLED => 'icon16_invalid_disabled.gif', - LINK_VALIDATION_INVALID . '_' . STATUS_ACTIVE => 'icon16_invalid.gif', - LINK_VALIDATION_INVALID . '_' . STATUS_PENDING => 'icon16_invalid_pend.gif', - - // for not validated links - LINK_VALIDATION_NOT_VALIDATED . '_' . STATUS_DISABLED => 'icon16_not_validated_disabled.gif', - LINK_VALIDATION_NOT_VALIDATED . '_' . STATUS_ACTIVE => 'icon16_not_validated.gif', - LINK_VALIDATION_NOT_VALIDATED . '_' . STATUS_PENDING => 'icon16_not_validated_pend.gif', - - '_' . STATUS_DISABLED => 'icon16_not_validated_disabled.gif', - '_' . STATUS_ACTIVE => 'icon16_not_validated.gif', - '_' . STATUS_PENDING => 'icon16_not_validated_pend.gif', - ), - - 'Fields' => Array ( - 'ForeignLinkId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'module' => 'In-Link', 'width' => 60, ), - 'LinkName' => Array ('title' => 'la_col_LinkName', 'data_block' => 'grid_link_name_td', 'filter_block' => 'grid_like_filter', 'first_chars' => 30, 'width' => 180, ), - 'LinkUrl' => Array ('title' => 'la_col_LinkUrl', 'data_block' => 'grid_url_td', 'filter_block' => 'grid_like_filter', 'width' => 200, ), - 'LinkValidationStatus' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 87, ), - 'ValidationCode' => Array ('title' => 'la_col_ValidationCode', 'filter_block' => 'grid_options_filter', 'width' => 155, ), - 'ValidationTime' => Array ('title' => 'la_col_ValidatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ), - 'LinkCreatedOn' => Array ('title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ), - ), - ), - ), - ); \ No newline at end of file Index: branches/5.0.x/in-link/units/link_validation/link_validation_eh.php =================================================================== diff -u -N --- branches/5.0.x/in-link/units/link_validation/link_validation_eh.php (revision 12746) +++ branches/5.0.x/in-link/units/link_validation/link_validation_eh.php (revision 0) @@ -1,544 +0,0 @@ - Array ('self' => 'advanced:reset',), - 'OnRestartValidation' => Array ('self' => 'advanced:restart',), - 'OnContinueValidation' => Array ('self' => 'advanced:continue',), - 'OnValidateSelected' => Array ('self' => 'advanced:validate',), - 'OnValidateProgress' => Array ('self' => 'advanced:validate|advanced:continue|advanced:restart|advanced:reset',), - 'OnCancelValidation' => Array ('self' => 'advanced:validate|advanced:continue|advanced:restart|advanced:reset',), - 'OnCronValidation' => Array ('self' => 'advanced:validate|advanced:continue|advanced:restart|advanced:reset',), - ); - - $this->permMapping = array_merge($this->permMapping, $permissions); - } - - function mapEvents() - { - parent::mapEvents(); - - $events_map = Array ( - 'OnApproveLinks' => 'iterateItems', - 'OnDeclineLinks' => 'iterateItems', - ); - - $this->eventMethods = array_merge($this->eventMethods, $events_map); - } - - /** - * Checks permissions of user - * - * @param kEvent $event - */ - function CheckPermission(&$event) - { - $check_events = Array ('OnApproveLinks', 'OnDeclineLinks', 'OnDeleteLinks'); - if (in_array($event->Name, $check_events)) { - $ids = $this->_getSelectedIds($event); - - $perm_value = true; - if ($ids) { - $perm_helper =& $this->Application->recallObject('PermissionsHelper'); - /* @var $perm_helper kPermissionsHelper */ - - $items = $perm_helper->GetCategoryItemData('l', $ids); - $check_method = $event->Name == 'OnDeleteLinks' ? 'DeleteCheckPermission' : 'ModifyCheckPermission'; - foreach ($items as $item_id => $item_data) { - if ($perm_helper->$check_method($item_data['CreatedById'], $item_data['CategoryId'], 'l') == 0) { - // one of items selected has no permission - $perm_value = false; - break; - } - } - - if (!$perm_value) { - $event->status = erPERM_FAIL; - } - } - - return $perm_value; - } - - return parent::CheckPermission($event); - } - - /** - * Adds calculates fields for category name - * - * @param kDBItem $object - * @param kEvent $event - */ - function prepareObject(&$object, &$event) - { - parent::prepareObject($object, $event); - - $object->addCalculatedField('CachedNavbar', 'c.l'.$this->Application->GetVar('m_lang').'_CachedNavbar'); - } - - /** - * Allows to show only invalid links - * - * @param kEvent $event - */ - function SetCustomQuery(&$event) - { - $object =& $event->getObject(); - /* @var $object kDBList */ - - $object->addFilter('primary_category_filter', 'ci.PrimaryCat = 1'); - - if ($event->Special == 'invalid') { - $object->addFilter('status_filter', '%1$s.ValidationStatus = ' . LINK_VALIDATION_INVALID); - } - } - - /** - * Restarts link validation process - * - * @param kEvent $event - */ - function OnRestartValidation(&$event) - { - $this->_resetValidation($event); - - $this->OnContinueValidation($event); - } - - /** - * Restarts link validation process - * - * @param kEvent $event - */ - function _resetValidation(&$event) - { - // 1. delete previous validation results - $sql = 'SELECT ' . $this->Application->getUnitOption($event->Prefix, 'IDField') . ' - FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName'); - $ids = $this->Conn->GetCol($sql); - - if ($ids) { - $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); - /* @var $temp_handler kTempTablesHandler */ - - $temp_handler->DeleteItems($event->Prefix, $event->Special, $ids); - } - } - - /** - * Validates only selected links - * - * @param kEvent $event - */ - function OnValidateSelected(&$event) - { - $link_ids = $this->_getSelectedIds($event); - if (!$link_ids) { - return ; - } - - $validation_data = Array ( - 'processed' => 0, - 'total' => count($link_ids), - 'items' => $link_ids, - ); - $this->Application->StoreVar($event->Prefix . '_status', serialize($validation_data)); - - $event->redirect = $this->Application->GetVar('progress_template'); - } - - /** - * Validates only links, that were not previously validated - * - * @param kEvent $event - */ - function OnContinueValidation(&$event) - { - $have_data = $this->_prepareValidation($event); - if ($have_data) { - $event->redirect = $this->Application->GetVar('progress_template'); - } - } - - /** - * Performs validation - * - * @param kEvent $event - * @param bool $from_ajax - */ - function _validate(&$event, $from_ajax = true) - { - $validation_data = unserialize( $this->Application->RecallVar($event->Prefix . '_status') ); - - $i = 0; - $link_ids = $validation_data['items']; - $per_page = count($link_ids) >= LINK_VALIDATION_PER_PAGE ? LINK_VALIDATION_PER_PAGE : count($link_ids); - - while ($i < $per_page) { - $this->_validateLink($link_ids[$i]); - $i++; - } - - // remove processed links from array - array_splice($link_ids, 0, LINK_VALIDATION_PER_PAGE); - - // store validation progress - $validation_data['processed'] += $i; - $validation_data['items'] = $link_ids; - - if ($validation_data['processed'] >= $validation_data['total']) { - // finished - $this->Application->EmailEventAdmin('LINK.VALIDATION.RESULTS'); - - $this->Application->RemoveVar($event->Prefix . '_status'); - return true; - } - - // show progress, proceed to next step - $this->Application->StoreVar($event->Prefix . '_status', serialize($validation_data)); - - if ($from_ajax) { - echo $validation_data['processed'] / $validation_data['total'] * 100; - $event->status = erSTOP; - } - - return false; - } - - /** - * Performs validation of links (called from AjaxProgressBar) - * - * @param kEvent $event - */ - function OnValidateProgress(&$event) - { - $done = $this->_validate($event, true); - - if ($done) { - $this->Application->Redirect( $this->Application->GetVar('finish_template') ); - } - } - - /** - * Returns categories, that are located inside recycle bin category - * - * @return Array - */ - function _getRecycleBinCategories() - { - $recycle_bin = $this->Application->ConfigValue('RecycleBinFolder'); - if (!is_numeric($recycle_bin)) { - return Array (); - } - - $recycle_categories = $this->Application->RecallVar('recycle_categories'); - if ($recycle_categories === false) { - $tree_indexes = $this->Application->getTreeIndex($recycle_bin); - - $sql = 'SELECT ' . $this->Application->getUnitOption('c', 'IDField') . ' - FROM ' . $this->Application->getUnitOption('c', 'TableName') . ' - WHERE TreeLeft BETWEEN ' . $tree_indexes['TreeLeft'] . ' AND ' . $tree_indexes['TreeRight']; - $recycle_categories = serialize( $this->Conn->GetCol($sql) ); - - // store recycle bin categories in session to prevent query below happening on each link validation step - $this->Application->StoreVar('recycle_categories', $recycle_categories); - } - - return unserialize($recycle_categories); - - } - - /** - * Checks, that link is located in one of RecycleBin subcategories - * - * @param unknown_type $resource_id - * @return unknown - */ - function _inRecycleBin($resource_id) - { - static $recycle_bin = null; - - if (!isset($recycle_bin)) { - $recycle_bin = $this->_getRecycleBinCategories(); - } - - if (!$recycle_bin) { - // Recycle Bin not used in system -> link is 100% not there - return false; - } - - $sql = 'SELECT CategoryId - FROM ' . $this->Application->getUnitOption('l-ci', 'TableName') . ' - WHERE ItemResourceId = ' . $resource_id . ' AND PrimaryCat = 1'; - - return in_array( $this->Conn->GetOne($sql), $recycle_bin); - } - - function _validateLink($link_id) - { - $curl_helper =& $this->Application->recallObject('CurlHelper'); - /* @var $curl_helper kCurlHelper */ - - $sql = 'SELECT Url, ResourceId - FROM ' . $this->Application->getUnitOption('l', 'TableName') . ' - WHERE ' . $this->Application->getUnitOption('l', 'IDField') . ' = ' . $link_id; - $link_data = $this->Conn->GetRow($sql); - - if (!preg_match('/^(http|https):\/\/(.*)/U', $link_data['Url']) || $this->_inRecycleBin($link_data['ResourceId'])) { - return ; - } - - $curl_helper->timeout = LINK_VALIDATION_TIMEOUT; - - $result = $curl_helper->Send($link_data['Url']); - if ($result === false || $curl_helper->lastErrorMsg != '') { - $curl_helper->lastErrorCode = 500; - } - - $link_validation =& $this->Application->recallObject($this->Prefix . '.-item', null, Array ('skip_autoload' => true)); - /* @var $link_validation kDBItem */ - - $link_validation->Load($link_id, 'LinkId'); - - $now = adodb_mktime(); - - $fields_hash = Array ( - 'LinkId' => $link_id, - 'ValidationTime_date' => $now, - 'ValidationTime_time' => $now, - 'ValidationCode' => $curl_helper->lastHTTPCode, - 'ValidationStatus' => $curl_helper->lastHTTPCode < 400 ? LINK_VALIDATION_VALID : LINK_VALIDATION_INVALID, - ); - $link_validation->SetDBFieldsFromHash($fields_hash); - - return $link_validation->isLoaded() ? $link_validation->Update() : $link_validation->Create(); - } - - /** - * Cancels validation (from validation progress bar) - * - * @param kEvent $event - */ - function OnCancelValidation(&$event) - { - $this->Application->RemoveVar($event->Prefix . '_status'); - } - - /** - * Resets validation status for selected - * - * @param kEvent $event - */ - function OnResetValidationStatus(&$event) - { - $ids = $this->_getSelectedIds($event, true); - if (!$ids) { - return ; - } - - $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); - /* @var $temp_handler kTempTablesHandler */ - - $temp_handler->DeleteItems($event->Prefix, $event->Special, $ids); - } - - /** - * Returns ids, that user has checked in grid - * - * @param kEvent $event - * @param bool $transform convert link ids to link validation ids - * @return Array - */ - function _getSelectedIds(&$event, $transform = false) - { - $ids = Array(); - - $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); - if ($items_info) { - foreach ($items_info as $id => $field_values) { - if ( getArrayValue($field_values, 'ForeignLinkId') ) { - // we are not gathering ids by unit idfield here! - array_push($ids, $id); - } - } - } - - if ($transform && $ids) { - $sql = 'SELECT ' . $this->Application->getUnitOption($event->Prefix, 'IDField') . ' - FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName') . ' - WHERE LinkId IN (' . implode(',', $ids) . ')'; - $ids = $this->Conn->GetCol($sql); - } - - return $ids; - } - - /** - * Approves/declines selected links - * - * @param kEvent $event - */ - function iterateItems(&$event) - { - if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { - return; - } - - $ids = $this->_getSelectedIds($event); - if (!$ids) { - return ; - } - - $object =& $this->Application->recallObject('l.-item', null, Array ('skip_autoload' => true)); - /* @var $object kCatDBItem */ - - foreach ($ids as $id) { - $object->Load($id); - - switch ($event->Name) { - case 'OnApproveLinks': - $ret = $object->ApproveChanges(); - break; - - case 'OnDeclineLinks': - $ret = $object->DeclineChanges(); - break; - } - - if (!$ret) { - $event->status = erFAIL; - $event->redirect = false; - break; - } - } - } - - /** - * Deletes selected links - * - * @param kEvent $event - */ - function OnDeleteLinks(&$event) - { - if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { - return; - } - - $ids = $this->_getSelectedIds($event); - if (!$ids) { - return ; - } - - $temp_handler =& $this->Application->recallObject('l_TempHandler', 'kTempTablesHandler'); - /* @var $temp_handler kTempTablesHandler */ - - $temp_handler->DeleteItems('l', '', $ids); - } - - /** - * [HOOK] Allows to edit links, used in selected link validation records - * - * @param kEvent $event - */ - function OnPrepareLinkEditing(&$event) - { - // hook to OnAfterConfigRead instead of OnEdit, because fake ids should be available in CheckPermission - if ($this->Application->GetVar('l_event') != 'OnEdit') { - return ; - } - - $ids = $this->_getSelectedIds($event); - $id_field = $this->Application->getUnitOption('l', 'IDField'); - - $items_info = Array (); - foreach ($ids as $id) { - $items_info[$id][$id_field] = 'on'; - } - - $this->Application->SetVar('l', $items_info); - } - - /** - * Gets all links, that are not yet validated and prepare data - * - * @param kEvent $event - * - * @return bool - */ - function _prepareValidation(&$event) - { - // 2. get ids of all links and put them into validation queue - $id_field = $this->Application->getUnitOption('l', 'IDField'); - $sql = 'SELECT ' . $id_field . ' - FROM ' . $this->Application->getUnitOption('l', 'TableName') . ' - WHERE LinkId NOT IN (SELECT LinkId FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName') . ')'; - $link_ids = $this->Conn->GetCol($sql); - - if ($link_ids) { - $validation_data = Array ( - 'processed' => 0, - 'total' => count($link_ids), - 'items' => $link_ids, - ); - $this->Application->StoreVar($event->Prefix . '_status', serialize($validation_data)); // 4K links will be 78KB serialized - return true; - } - - return false; - } - - /** - * [REGULAR EVENT] Performs link validation throught cron - * - * @param kEvent $event - */ - function OnCronValidation(&$event) - { - $this->_resetValidation($event); // remove this for continuing to non validated before links - - $have_data = $this->_prepareValidation($event); - if ($have_data) { - do { - $done = $this->_validate($event, false); - } while (!$done); - } - } - - /** - * Makes calcualated fields to go to multilingual link fields - * - * @param kEvent $event - */ - function OnAfterConfigRead(&$event) - { - parent::OnAfterConfigRead($event); - - $calculated_fields = $this->Application->getUnitOption($event->Prefix, 'CalculatedFields'); - $calculated_fields['']['LinkName'] = 'l.l' . $this->Application->GetVar('m_lang') . '_Name'; - $this->Application->setUnitOption($event->Prefix, 'CalculatedFields', $calculated_fields); - } - - } \ No newline at end of file Index: branches/5.0.x/in-link/units/listing_types/listing_types_tag_processor.php =================================================================== diff -u -N --- branches/5.0.x/in-link/units/listing_types/listing_types_tag_processor.php (revision 12746) +++ branches/5.0.x/in-link/units/listing_types/listing_types_tag_processor.php (revision 0) @@ -1,46 +0,0 @@ -getObject($params); - $params['cat_id'] = $object->GetDBField($params['field']); - - return $this->Application->ProcessParsedTag('c', 'CategoryPath', $params); - } - - /** - * Makes 1st listing type default - * - * @param Array $params - * @return bool - */ - function IsDefault($params) - { - static $listing_type_id = null; - - $object =& $this->getObject(); - /* @var $object kDBItem */ - - if (!isset($listing_type_id)) { - $listing_type_id = $object->GetID(); - } - - return $listing_type_id == $object->GetID(); - } - } \ No newline at end of file Index: branches/5.0.x/in-link/units/listing_types/listing_types_event_handler.php =================================================================== diff -u -N --- branches/5.0.x/in-link/units/listing_types/listing_types_event_handler.php (revision 12746) +++ branches/5.0.x/in-link/units/listing_types/listing_types_event_handler.php (revision 0) @@ -1,84 +0,0 @@ - Array('self' => true), - ); - - $this->permMapping = array_merge($this->permMapping, $permissions); - } - - /** - * Set's selected category to listing type - * - * @param kEvent $event - */ - function OnProcessSelected(&$event) - { - $object =& $event->getObject(); - $selected_ids = $this->Application->GetVar('selected_ids'); - - $object->SetDBField($this->Application->RecallVar('dst_field'), $selected_ids['c']); - $this->RemoveRequiredFields($object); - $object->Update(); - - $this->finalizePopup($event); - } - - - function OnPreSaveListingType(&$event) - { - $event->redirect = false; - $object =& $event->getObject( Array('skip_autoload' => true) ); - $this->RemoveRequiredFields($object); - $event->CallSubEvent('OnPreSave'); - $this->Application->SetVar($event->getPrefixSpecial(true).'_id', $object->GetID()); - } - - function OnPreSave(&$event) - { - $object =& $event->getObject(); - $item_info = $this->Application->GetVar($event->Prefix); - if(is_array($item_info)) - { - $item_info = array_shift($item_info); - if( getArrayValue($item_info, 'EnableBuying') ) - { - $options = $object->GetFieldOptions('ShopCartName'); - $options['required'] = 1; - $object->SetFieldOptions('ShopCartName', $options); - } - } - parent::OnPreSave($event); - } - - function OnEdit(&$event) - { - if ($this->Application->prefixRegistred('p')) { - $this->Application->recallObject('p', null, Array('skip_autoload' => true)); - } - parent::OnEdit($event); - } - } \ No newline at end of file Index: branches/5.0.x/in-link/units/listing_types/listing_types_config.php =================================================================== diff -u -N --- branches/5.0.x/in-link/units/listing_types/listing_types_config.php (revision 12746) +++ branches/5.0.x/in-link/units/listing_types/listing_types_config.php (revision 0) @@ -1,152 +0,0 @@ - 'lst', - 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'), - 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'), - 'EventHandlerClass' => Array('class'=>'ListingTypesEventHandler','file'=>'listing_types_event_handler.php','build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'ListingTypesTagProcessor','file'=>'listing_types_tag_processor.php','build_event'=>'OnBuild'), - 'AutoLoad' => true, - 'AggregateTags' => Array( - Array( - 'AggregateTo' => 'l', - 'AggregatedTagName' => 'ListListingTypes', - 'LocalTagName' => 'PrintList', - ), - Array( - 'AggregateTo' => 'l', - 'AggregatedTagName' => 'ListingTypeField', - 'LocalTagName' => 'Field', - ), - ), - 'Hooks' => Array(), - 'QueryString' => Array( - 1 => 'id', - 2 => 'page', - 3 => 'event', - 4 => 'mode', - ), - 'IDField' => 'ListingTypeId', - 'TitleField' => 'Name', - 'TitlePresets' => Array( - 'default' => Array( 'new_status_labels' => Array('lst'=>'!la_title_AddingPaidListingType!'), - 'edit_status_labels' => Array('lst'=>'!la_title_EditingPaidListingType!'), - 'new_titlefield' => Array('lst'=>'!la_title_NewPaidListingType!'), - ), - 'listing_type_list'=>Array( 'prefixes' => Array('lst_List'), - 'format' => "!la_title_PaidListingTypes!", - ), - 'listing_type_edit'=>Array( 'prefixes' => Array('lst'), - 'new_titlefield' => Array('lst'=>'!la_title_NewPaidListingType!'), - 'format' => "#lst_status# '#lst_titlefield#' - !la_title_General!", - ), - 'listing_type_shop_cart'=>Array( 'prefixes' => Array('lst'), - 'new_titlefield' => Array('lst'=>'!la_title_NewPaidListingType!'), - 'format' => "#lst_status# '#lst_titlefield#' - !la_title_ShopCartEntry!", - ), - - - ), - - 'EditTabPresets' => Array ( - 'Default' => Array ( - 'general' => Array ('title' => 'la_tab_General', 't' => 'in-link/paid_listings/paid_listing_type_edit', 'priority' => 1), - ), - ), - - 'PermSection' => Array('main' => 'in-link:listing_types'), - - 'Sections' => Array( - 'in-link:listing_types' => Array( - 'parent' => 'in-link:paid_listings_folder', - 'icon' => 'paid_listings', - 'label' => 'la_tab_ListingTypes', - 'url' => Array('t' => 'in-link/paid_listings/paid_listing_types_list', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit', 'delete'), - 'priority' => 1.2, // ., because this section replaces parent in tree - 'type' => stTAB, - ), - ), - - 'TableName' => TABLE_PREFIX.'ListingTypes', - - 'ListSQLs' => Array( ''=>'SELECT * FROM %s',), // key - special, value - list select sql - - 'ItemSQLs' => Array( ''=>'SELECT * FROM %s',), - - 'ListSortings' => Array( - '' => Array( - 'Sorting' => Array('ListingTypeId' => 'asc'), - ) - ), - - 'Fields' => Array - ( - 'ListingTypeId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,), - 'Name' => Array('type' => 'string','not_null' => '1','default' => '','required' => '1'), - 'Description' => Array('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => NULL), - 'Duration' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), - 'DurationType' => Array('type' => 'int', 'not_null' => 1, 'default' => 0, 'formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(1 => 'la_opt_sec', 2 => 'la_opt_min', 3 => 'la_opt_hour', 4 => 'la_opt_day', 5 => 'la_opt_week', 6 => 'la_opt_month', 7 => 'la_opt_year')), - 'OnPurchaseEdPick' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off'), 'default' => 3), - - 'OnPurchaseStatus' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_Enabled', 0 => 'la_Disabled', 2 => 'la_Pending'),'default' => 3), - - 'OnPurchaseNew' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off', 2 => 'la_Auto'),'default' => 3), - 'OnPurchasePop' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off', 2 => 'la_Auto'),'default' => 3), - 'OnPurchaseHot' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off', 2 => 'la_Auto'),'default' => 3), - 'OnPurchasePriorityAction' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(0 => 'la_DontChange', 1 => 'la_SetEqualTo', 2 => 'la_IncreaseBy', 3 => 'la_DecreaseBy'),'default' => 0), - 'OnPurchasePriorityValue' => Array('type' => 'int','not_null' => '1','default' => 1), - 'OnPurchaseAddToCatEnabled' => Array('type' => 'int','not_null' => '1','default' => 0), - 'OnPurchaseAddToCat' => Array('type' => 'int','not_null' => '1','default' => 0), - 'OnPurchaseCustomTemplate' => Array('type' => 'string','not_null' => 1,'default' => ''), - - 'OnExpireEdPick' => Array('type' => 'int','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off'),'not_null' => '1','default' => 3), - 'OnExpireNew' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off', 2 => 'la_Auto'),'default' => 3), - 'OnExpirePop' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off', 2 => 'la_Auto'),'default' => 3), - 'OnExpireHot' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off', 2 => 'la_Auto'),'default' => 3), - 'OnExpirePriorityAction' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(0 => 'la_DontChange', 1 => 'la_SetEqualTo', 2 => 'la_IncreaseBy', 3 => 'la_DecreaseBy'),'default' => 0), - 'OnExpirePriorityValue' => Array('type' => 'int','not_null' => '1','default' => 1), - 'OnExpireRemoveFromCatEnabled' => Array('type' => 'int','not_null' => '1','default' => 0), - 'OnExpireRemoveFromCat' => Array('type' => 'int','not_null' => '1','default' => 0), - 'OnExpireCustomTemplate' => Array('type' => 'string','not_null' => 1,'default' => ''), - - 'OnExpireStatus' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_Enabled', 0 => 'la_Disabled', 2 => 'la_Pending'),'default' => 3), - 'RenewalReminder' => Array('type' => 'int','not_null' => '1','default' => 0), - 'EnableBuying' => Array('type' => 'int','not_null' => '1','default' => 0), - 'ShopCartName' => Array('type' => 'string', 'default' => null), - 'Price' => Array('type' => 'double','default' => ''), - 'Recurring' => Array('type' => 'int','not_null' => '1','default' => 0), - 'VirtualProductId' => Array('type' => 'int','not_null' => '1','default' => 0), - ), - - 'Grids' => Array( - 'Default' => Array( - 'Icons' => Array( - 'default' => 'icon16_item.png', - 0 => 'icon16_disbaled.png', - 1 => 'icon16_item.png', - 'module' => 'core', - ), - 'Fields' => Array( - 'ListingTypeId' => Array( 'title'=>'la_col_Id' , 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60), - 'Name' => Array( 'title'=>'la_col_Name', 'filter_block' => 'grid_like_filter', 'width' => 250), - 'Duration' => Array( 'title'=>'la_col_Duration' , 'data_block' => 'duration_td', 'filter_block' => 'grid_like_filter', 'width' => 100), - ), - - ), - ), - ); \ No newline at end of file Index: branches/5.0.x/in-link/units/listings/listings_event_handler.php =================================================================== diff -u -N --- branches/5.0.x/in-link/units/listings/listings_event_handler.php (revision 12746) +++ branches/5.0.x/in-link/units/listings/listings_event_handler.php (revision 0) @@ -1,770 +0,0 @@ - Array ('self' => true), - 'OnCancelEnhancement' => Array ('self' => true), - 'OnExtendEnhancement' => Array ('self' => true), - - ); - $this->permMapping = array_merge($this->permMapping, $permissions); - } - - /** - * Adds selected link to listing - * - * @param kEvent $event - */ - function OnProcessSelected(&$event) - { - $object =& $event->getObject(); - - $selected_ids = $this->Application->GetVar('selected_ids'); - if ($selected_ids['l']) { - $link_id = $selected_ids['l']; - $sql = 'SELECT ResourceId - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE '.$this->Application->getUnitOption('l', 'IDField').' = '.$link_id; - - $object->SetDBField($this->Application->RecallVar('dst_field'), $this->Conn->GetOne($sql)); - $object->IgnoreValidation = true; - // $this->RemoveRequiredFields($object); - $object->Update(); - } - - $this->finalizePopup($event); - } - - function OnPreSaveListing(&$event) - { - $event->redirect=false; - $object =& $event->getObject( Array('skip_autoload' => true) ); - $object->IgnoreValidation = true; - // $this->RemoveRequiredFields($object); - $event->CallSubEvent('OnPreSave'); - $this->Application->SetVar($event->getPrefixSpecial(true).'_id', $object->GetId()); - return; - } - - function OnBeforeItemUpdate(&$event) - { - $object =& $event->getObject(); - if ($object->IgnoreValidation) { - $object->UpdateFormattersMasterFields(); - } - } - - function OnBeforeItemCreate(&$event) - { - $object =& $event->getObject(); - if ($object->IgnoreValidation) { - $object->UpdateFormattersMasterFields(); - } - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnBeforeDeleteFromLive(&$event) - { - $object =& $event->getObject(); - $sql = 'SELECT * FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ListingId = '.$object->GetId(); - $original_values = $this->Conn->GetRow($sql); - - $type_modified = ($object->GetDBField('ListingTypeId') != $original_values['ListingTypeId']); - $link_modified = ($object->GetDBField('ItemResourceId') != $original_values['ItemResourceId']); - $status_modified = ($object->GetDBField('Status') != $original_values['Status']); - - if ($status_modified) { - $email_event = $object->GetDBField('Status') ? 'LINK.ENHANCE.APPROVE' : 'LINK.ENHANCE.DENY'; - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - - $email_event_user =& $this->Application->EmailEventUser($email_event, $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin($email_event); - } - - if ( $type_modified || $link_modified ) { - $this->ResetLink($original_values); - } - - if ( $status_modified || $type_modified || $link_modified ) { - $this->EnhanceLink($object, $original_values); - } - - if ( $status_modified && !($type_modified || $link_modified) ) { - $this->ResetLink($original_values); - } - } - - function EnhanceLink(&$object, $original_values) - { - if ($object->GetDBField('Status') != STATUS_ACTIVE) { - return false; - } - - if ($object->GetDBField('ExpiresOn') < adodb_mktime()) { - $object->SetDBField('Status', STATUS_PENDING); - $object->Update(); - $this->ResetLink($original_values); - return false; - } - - $this->UpdateLink('OnPurchase', $object->GetDBField('ItemResourceId'), $object->GetDBField('ListingTypeId')); - - $listtype_object =& $this->Application->recallObject('lst'); - if ( $listtype_object->GetDBField('OnPurchaseAddToCatEnabled') ) - { - $link_object =& $this->Application->recallObject('l'); - $add_to_cat = (int)$listtype_object->GetDBField('OnPurchaseAddToCat'); - $sql = 'DELETE FROM '.$this->Application->getUnitOption('l-ci', 'TableName').' - WHERE CategoryId = '.$add_to_cat.' - AND ItemResourceId = '.$link_object->GetDBField('ResourceId').' - AND PrimaryCat = 0'; - $this->Conn->Query($sql); - $sql = 'INSERT INTO '.$this->Application->getUnitOption('l-ci', 'TableName').' - (CategoryId, ItemResourceId, PrimaryCat) - VALUES ('.$add_to_cat.', '.$link_object->GetDBField('ResourceId').', 0)'; - $this->Conn->Query($sql); - } - } - - function ResetLink($original_values) - { - static $has_been_reset = Array(); - - if( $original_values['Status'] != STATUS_ACTIVE || - getArrayValue($has_been_reset, $original_values['ListingId']) ) - { - return; - } - - $has_been_reset[$original_values['ListingId']] = 1; - - $this->UpdateLink('OnExpire', $original_values['ItemResourceId'], $original_values['ListingTypeId']); - - $listtype_object =& $this->Application->recallObject('lst'); - if( $listtype_object->GetDBField('OnExpireRemoveFromCatEnabled') ) - { - $remove_from_cat = $listtype_object->GetDBField('OnExpireRemoveFromCat'); - $sql = 'DELETE FROM '.$this->Application->getUnitOption('l-ci', 'TableName').' - WHERE ItemResourceId = '.$original_values['ItemResourceId'].' - AND CategoryId = '.$remove_from_cat.' - AND PrimaryCat = 0'; - $this->Conn->Query($sql); - } - } - - function UpdateLink($action_prefix, $resource_id, $listtype_id) - { - - $link_object =& $this->Application->recallObject('l', null, Array('skip_autoload' => true)); - $link_object->Load($resource_id, 'ResourceId'); - - // "-item", because can be called as regular after event, and just "lst" recalls list instead - $listtype_object =& $this->Application->recallObject('lst.-item', null, Array('skip_autoload' => true)); - $listtype_object->Load($listtype_id); - - $action_fields = Array( 'EdPick' => 'EditorsPick', - 'New' => 'NewItem', - 'Hot' => 'HotItem', - 'Pop' => 'PopItem', - 'Status' => 'Status', - 'CustomTemplate' => 'CustomTemplate', - ); - // $action_prefix = 'OnPurchase'; - - foreach($action_fields as $action => $field) - { - $action_value = $listtype_object->GetDBField($action_prefix.$action); - if( $action_value != 3 ) - { - $link_object->SetDBField($field, $action_value); - } - } - - $priority_value = $listtype_object->GetDBField($action_prefix.'PriorityValue'); - switch( $listtype_object->GetDBField($action_prefix.'PriorityAction') ) - { - case 1: // equal - $link_object->SetDBField('Priority', $priority_value); - break; - case 2: // increase - $original_priority = $link_object->GetDBField('Priority'); - $link_object->SetDBField('Priority', $original_priority + $priority_value); - break; - case 3: // decrease - $original_priority = $link_object->GetDBField('Priority'); - $link_object->SetDBField('Priority', $original_priority - $priority_value); - break; - default: - } - - $link_object->Update(); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnRequestEnhancement(&$event) - { - if ($this->Application->isModuleEnabled('In-Commerce')) { - $l_info = $this->Application->GetVar('l'); - if (!$l_info) { - return false; - } - - list ($link_id, $link_info) = each($l_info); - $listing_type_id = $link_info['ListingTypeId']; - - $listing_type =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing_type->Load($listing_type_id); - - if ($listing_type->GetDBField('EnableBuying')) { - $add_to_cart_event = new kEvent('ord:OnAddVirtualProductToCart'); - $this->Application->HandleEvent($add_to_cart_event); - - if ($add_to_cart_event->redirect) { - $event->SetRedirectParam('pass', 'm'); - $event->redirect = $add_to_cart_event->redirect; - } - return true; - } - } - - $event->CallSubEvent('OnListingCreate'); - } - - /** - * Create listing or extend existing listing period - * - * @param kEvent $event - */ - function OnListingCreate(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - - switch ($event->Name) { - case 'EnhanceLinkAfterOrderApprove': - case 'EnhancedLinkOnCompleteOrder': - // when order with listing virtual product is approved - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $listing_type_id = $item_data['ListingTypeId']; - $link_id = $item_data['LinkId']; - - $new_processing = getArrayValue($item_data, 'HasNewProcessing'); - break; - - case 'OnListingCreate': - // when requesting enhancement from front (and not via in-commerce) - $links_info = $this->Application->GetVar('l'); - if (!$links_info) return false; - - $event->redirect = false; - list($link_id, $link_info) = each($links_info); - $listing_type_id = $link_info['ListingTypeId']; - - $new_processing = false; - break; - } - - if (!$listing_type_id) { - // free or invalid listing type selected - return false; - } - - // get resource_id of link beeing enhanced - $sql = 'SELECT ResourceId - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $resource_id = $this->Conn->GetOne($sql); - - // get listing by link's resource_id - $object->Load($resource_id, 'ItemResourceId'); - if ($object->isLoaded()) { - $original_values = $object->FieldValues; - } - else { - // set initial fields to listing - $object->SetDBField('ListingTypeId', $listing_type_id); - $object->SetDBField('ItemResourceId', $resource_id); - - if ($event->Name == 'OnListingCreate' || $new_processing) { - $item_status = STATUS_PENDING; - } - else { - $item_status = STATUS_ACTIVE; - } - - $object->SetDBField('Status', $item_status); - } - - // set date of purchase for new listings - $purchased_on = max(adodb_mktime(), $object->GetDBField('ExpiresOn')); - if (!$object->isLoaded()) { - $object->SetDBField('PurchasedOn_date', $purchased_on); - $object->SetDBField('PurchasedOn_time', $purchased_on); - } - - // set expiration time for listing - $listing_type =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing_type->Load($listing_type_id); - - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $listing_type->GetDBField('Duration'); - $duration_type = $listing_type->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $expiration_date = $purchased_on + $expiration_interval; - $object->SetDBField('ExpiresOn_date', $expiration_date); - $object->SetDBField('ExpiresOn_time', $expiration_date); - - // when extending enhancement mark listing as non-received renewal reminder - $object->SetDBField('RenewalReminderSent', 0); - - $action = $object->isLoaded() ? 'Update' : 'Create'; - if ($object->$action()) { - $event->status = erSUCCESS; - switch ($event->Name) { - case 'EnhanceLinkAfterOrderApprove': - case 'EnhancedLinkOnCompleteOrder': - // when order with listing virtual product is approved - if (getArrayValue($original_values, 'Status') != STATUS_ACTIVE) { - $this->EnhanceLink($object, Array()); - } - break; - - case 'OnListingCreate': - // when requesting enhancement from front (and not via in-commerce) - $event->redirect = $this->Application->GetVar('success_template'); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE'); - break; - } - - - } - else { - $event->status = erFAIL; - } - - - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function EnhancedLinkOnCompleteOrder(&$event) - { - // create enhancement, but pending - $this->OnListingCreate($event); - - // save created listing_id back to itemdata - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - unset($item_data['ListingTypeId']); - $item_data['ListingId'] = $object->GetID(); - - $orditems_idfield = $this->Application->getUnitOption('orditems', 'IDField'); - $orditems_table = $this->Application->getUnitOption('orditems', 'TableName'); - - $this->Conn->doUpdate( Array('ItemData' => serialize($item_data)), $orditems_table, $orditems_idfield.' = '.$fields['OrderItemId'] ); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function EnhanceLinkAfterOrderApprove(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - - if ( getArrayValue($item_data, 'HasNewProcessing') ) { - // new processing: just approve created listing here - $listing_id = $item_data['ListingId']; - $object->Load($listing_id); - - // moved enhancement period to time admin approved enhancement - $time_diff = adodb_mktime() - $object->GetDBField('PurchasedOn'); - $object->SetDBField('PurchasedOn_date', $object->GetDBField('PurchasedOn_date') + $time_diff); - $object->SetDBField('PurchasedOn_time', $object->GetDBField('PurchasedOn_time') + $time_diff); - $object->SetDBField('ExpiresOn_date', $object->GetDBField('ExpiresOn_date') + $time_diff); - $object->SetDBField('ExpiresOn_time', $object->GetDBField('ExpiresOn_time') + $time_diff); - - $object->SetDBField('Status', STATUS_ACTIVE); - $object->Update(); - - $this->EnhanceLink($object, Array()); - return true; - } - else { - // create listing & approve it at the same time - $this->OnListingCreate($event); - } - } - - /** - * Delete listing - * - * @param kEvent $event - */ - function EnhanceLinkAfterOrderDeny(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $listing_id = $item_data['ListingId']; - - $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); - $temp_handler->DeleteItems($event->Prefix, $event->Special, Array($listing_id)); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function ExpireLink(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$item_data['LinkId']; - $listing_id = $this->Conn->GetOne($sql); - $object->Load($listing_id); - $original_values = $object->FieldValues; - $object->SetDBField('Status', 2); - - if($object->Update()) - { - $event->status = erSUCCESS; - $this->ResetLink($original_values); - } - else - { - $event->status = erFAIL; - } - } - - function iterateItems(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $ids = $this->StoreSelectedIDs($event); - - if ($event->Name == 'OnMassApprove') { - foreach ($ids as $id) { - $object->Load($id); - if ($object->GetDBField('Status') != STATUS_ACTIVE) { - $original_values = $object->FieldValues; - $object->SetDBField('Status', STATUS_ACTIVE); - $this->EnhanceLink($object, $original_values); - } - } - } - - if ($event->Name == 'OnMassDecline') { - foreach ($ids as $id) { - $object->Load($id); - if ($object->GetDBField('Status') == STATUS_ACTIVE) { - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - - $sql = 'SELECT CreatedById - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.DENY', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.DENY'); - } - } - } - - parent::iterateItems($event); - - // extend period for pending/renewal links (if owner has agreed) - if ($event->Name == 'OnMassApprove') { - $lst_object =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - - foreach ($ids as $id) { - $object->Load($id); - $sql = 'SELECT CreatedById - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $owner_id = $this->Conn->GetOne($sql); - - if ($object->GetDBField('PendingRenewal') == 1) { - $lst_object->Load( $object->GetDBField('ListingTypeId') ); - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $lst_object->GetDBField('Duration'); - $duration_type = $lst_object->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $renewal_begins = max( adodb_mktime(), $object->GetDBField('ExpiresOn') ); - $expiration_date = $renewal_begins + $expiration_interval; - - $object->SetDBField('ExpiresOn_date', $expiration_date); - $object->SetDBField('ExpiresOn_time', $expiration_date); - - $object->SetDBField('RenewalReminderSent', 0); - $object->SetDBField('PendingRenewal', 0); - - if ($object->Update()) { - $event->status = erSUCCESS; - $event->redirect_params = Array('opener' => 's'); //stay! - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.RENEW', $owner_id); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.RENEW'); - } - else { - $event->status=erFAIL; - $event->redirect=false; - break; - } - } - else { - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.APPROVE', $owner_id); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.APPROVE'); - } - } - } - } - - /** - * Redirects to cancel template on front-end - * - * @param kEvent $event - */ - function OnCancel(&$event) - { - parent::OnCancel($event); - - if (!$this->Application->isAdmin) { - $event->SetRedirectParam('opener', 's'); - $event->redirect = $this->Application->GetVar('cancel_template'); - } - } - - /** - * Checks that user is owner of link & returns listing id if permissions are ok - * - * @param kEvent $event - * @return mixed - */ - function verifyListingOwner(&$event) - { - $link_id = $this->Application->GetVar('l_id'); - $user_id = $this->Application->RecallVar('user_id'); - $sql = 'SELECT ResourceId - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE (LinkId = '.$link_id.') AND (CreatedById = '.$user_id.')'; - $resource_id = $this->Conn->GetOne($sql); - - if (!$resource_id) { - $event->status = erFAIL; - return false; - } - - $sql = 'SELECT ListingId - FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$resource_id; - - return $this->Conn->GetOne($sql); - } - - function OnExtendEnhancement(&$event) - { - $listing_id = $this->verifyListingOwner($event); - if (!$listing_id) { - return ; - } - - $object =& $event->getObject( Array('skip_autoload' => true) ); - $object->Load($listing_id); - - $object->SetDBField('PendingRenewal', 1); - $object->Update(); - $event->redirect = $this->Application->GetVar('success_template'); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.EXTEND', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.EXTEND'); - } - - function OnCancelEnhancement(&$event) - { - $listing_id = $this->verifyListingOwner($event); - if (!$listing_id) { - return ; - } - - $object =& $event->getObject( Array('skip_autoload' => true) ); - $object->Load($listing_id); - - $original_values = $object->FieldValues; - $original_values['Status'] = 1; - $this->ResetLink($original_values); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.CANCEL', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.CANCEL'); - - $object->Delete(); - $event->redirect = $this->Application->GetVar('success_template'); - } - - function OnCheckExpiredPaidListings(&$event) - { - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ExpiresOn < '.adodb_mktime().' AND Status = 1'; - $expired_listings = $this->Conn->GetCol($sql); - if(is_array($expired_listings) && count($expired_listings) > 0) - { - $object =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true)); - foreach($expired_listings as $listing_id) - { - $object->Load($listing_id); - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - $object->SetDBField('Status', 2); - $object->Update(); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.EXPIRE', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.EXPIRE'); - } - } - - $sql = 'SELECT ls.ListingId, l.CreatedById FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' ls - LEFT JOIN '.$this->Application->getUnitOption('lst', 'TableName').' lst - ON ls.ListingTypeId = lst.ListingTypeId - LEFT JOIN '.$this->Application->getUnitOption('l', 'TableName').' l - ON ls.ItemResourceId = l.ResourceId - WHERE ls.Status = 1 - AND ls.ExpiresOn < '.adodb_mktime().' + lst.RenewalReminder * 3600 *24 - AND ls.RenewalReminderSent = 0'; - $res = $this->Conn->Query($sql); - if(is_array($res) && count($res) > 0) - { - $listing_ids = Array(); - foreach($res as $record) - { - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.RENEWAL.NOTICE', $record['CreatedById']); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.RENEWAL.NOTICE'); - $listing_ids[] = $record['ListingId']; - } - $sql = 'UPDATE '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - SET RenewalReminderSent = 1 - WHERE ListingId IN ('.implode(',', $listing_ids).')'; - $this->Conn->Query($sql); - } - } - - function OnMassDelete(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $ids = $this->StoreSelectedIDs($event); - - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') == 1) - { - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - } - } - parent::OnMassDelete($event); - } - - /** - * Moves enhancement from original link to it's pending copy, that is going to be approved - * - * @param kEvent $event - */ - function OnMoveEnhancement(&$event) - { - $id_field = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'IDField'); - $item_table_name = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'TableName'); - - $pending_id = $event->MasterEvent->getEventParam('id'); - $original_id = $event->MasterEvent->getEventParam('original_id'); - - $sql = 'SELECT ResourceId, '.$id_field.' - FROM '.$item_table_name.' - WHERE '.$id_field.' IN ('.$pending_id.','.$original_id.')'; - $resource_ids = $this->Conn->GetCol($sql, $id_field); - - $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); - $sql = 'UPDATE '.$table_name.' - SET ItemResourceId = '.$resource_ids[$pending_id].' - WHERE ItemResourceId = '.$resource_ids[$original_id]; - $this->Conn->Query($sql); - } - - /** - * Makes calcualated fields to go to multilingual link fields - * - * @param kEvent $event - */ - function OnAfterConfigRead(&$event) - { - parent::OnAfterConfigRead($event); - - $language_id = $this->Application->GetVar('m_lang'); - $calculated_fields = $this->Application->getUnitOption($event->Prefix, 'CalculatedFields'); - $calculated_fields['']['LinkName'] = 'CONCAT(item_table.l' . $language_id . '_Name, " (", item_table.Url, ")")'; - $this->Application->setUnitOption($event->Prefix, 'CalculatedFields', $calculated_fields); - } -} \ No newline at end of file Index: branches/5.0.x/in-link/units/listings/listings_config.php =================================================================== diff -u -N --- branches/5.0.x/in-link/units/listings/listings_config.php (revision 12746) +++ branches/5.0.x/in-link/units/listings/listings_config.php (revision 0) @@ -1,166 +0,0 @@ - 'ls', - 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'), - 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'), - 'EventHandlerClass' => Array('class'=>'ListingsEventHandler','file'=>'listings_event_handler.php','build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'ListingsTagProcessor','file'=>'listings_tag_processor.php','build_event'=>'OnBuild'), - 'AutoLoad' => true, - - 'Hooks' => Array( - Array( - 'Mode' => hAFTER, - 'Conditional' => false, - 'HookToPrefix' => 'l', - 'HookToSpecial' => '*', - 'HookToEvent' => Array('OnBeforeDeleteOriginal'), - 'DoPrefix' => '', - 'DoSpecial' => '*', - 'DoEvent' => 'OnMoveEnhancement', - ), - ), - - 'QueryString' => Array( - 1 => 'id', - 2 => 'page', - 3 => 'event', - 4 => 'mode', - ), - - 'RegularEvents' => Array( - 'listings_expiration' => Array('EventName' => 'OnCheckExpiredPaidListings', 'RunInterval' => 1800, 'Type' => reAFTER), - ), - - 'IDField' => 'ListingId', - 'StatusField' => Array('Status', 'PendingRenewal'), - 'TitleField' => 'LinkName', - - 'TitlePresets' => Array( - 'default' => Array( 'new_status_labels' => Array('ls'=>'!la_title_AddingListing!'), - 'edit_status_labels' => Array('ls'=>'!la_title_EditingListing!'), - 'new_titlefield' => Array('ls'=>'!la_title_NewListing!'), - ), - - 'listing_list' => Array('prefixes' => Array('ls_List'), 'format' => "!la_title_PaidListings!",), - 'listing_edit' => Array('prefixes' => Array('ls'), 'format' => "#ls_status# '#ls_titlefield#' - !la_title_General!",), - ), - - 'PermSection' => Array('main' => 'in-link:paid_listings'), - - 'Sections' => Array( - 'in-link:paid_listings_folder' => Array( - 'parent' => 'in-link', - 'icon' => 'paid_listings', - 'label' => 'la_tab_PaidListings', - 'use_parent_header' => 1, - 'permissions' => Array(), - 'priority' => 1, - 'type' => stTREE, - ), - - 'in-link:paid_listings' => Array( - 'parent' => 'in-link:paid_listings_folder', - 'icon' => 'paid_listings', - 'label' => 'la_tab_Listings', - 'url' => Array('t' => 'in-link/paid_listings/paid_listings_list', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:approve', 'advanced:decline'), - 'priority' => 1.1, // ., because this section replaces parent in tree - 'type' => stTAB, - ), - ), - - 'TableName' => TABLE_PREFIX.'Listings', - - 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'Link item_table ON item_table.ResourceId = %1$s.ItemResourceId - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON u.PortalUserId = item_table.CreatedById'), - - 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'Link item_table ON item_table.ResourceId = %1$s.ItemResourceId - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON u.PortalUserId = item_table.CreatedById'), - - 'ListSortings' => Array( - '' => Array( - 'Sorting' => Array('PurchasedOn' => 'desc'), - ) - ), - - 'CalculatedFields' => Array ( - '' => Array ( - 'LinkName' => 'CONCAT(item_table.Name, " (", item_table.Url, ")")', - 'LinkOwner' => 'IF (ISNULL(u.Login), IF (item_table.CreatedById = -1, "root", IF (item_table.CreatedById = -2, "Guest", "n/a")), u.Login)', - ), - ), - 'Fields' => Array - ( - 'ListingId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,), - 'ListingTypeId' => Array('type' => 'int', 'formatter'=>'kOptionsFormatter', 'options_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'ListingTypes ORDER BY Name', 'option_key_field'=>'ListingTypeId', 'option_title_field'=>'Name', 'default' => 0,), - 'ItemResourceId' => Array('type' => 'int', 'required' => 1, 'unique' => Array('ItemResourceId'), 'error_field' => 'LinkName', 'default' => NULL), - 'PurchasedOn' => Array('type' => 'int', 'formatter'=>'kDateFormatter','default'=>'#NOW#'), - 'ExpiresOn' => Array('type' => 'int', 'formatter'=>'kDateFormatter','default' => '#NOW#','required'=>1), - 'Status' => Array('type' => 'int', 'not_null' => 1, 'default' => 2, 'formatter'=>'kOptionsFormatter','options' => Array(1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'),'use_phrases' => 1), - 'PendingRenewal' => Array('type' => 'int','formatter'=>'kOptionsFormatter','options' => Array(0 => 'la_NotPendingRenewal', 1 => 'la_PendingRenewal'),'use_phrases' => 1, 'not_null' => 1, 'default' => 0), - 'RenewalReminderSent' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), - ), - - 'VirtualFields' => Array ( - 'LinkName' => Array ('type' => 'string'), - 'LinkOwner' => Array ('type' => 'string'), - ), - - 'FilterMenu' => Array( - 'Groups' => Array( - Array('mode' => 'AND', 'filters' => Array(0,1,2), 'type' => WHERE_FILTER), - Array('mode' => 'AND', 'filters' => Array(3), 'type' => WHERE_FILTER), - ), - - 'Filters' => Array( - 0 => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), - 1 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), - 2 => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ), - 3 => Array('label' => 'la_PendingRenewal', 'on_sql' => '', 'off_sql' => '%1$s.PendingRenewal != 1' ), - ) - ), - - 'Grids' => Array( - 'Default' => Array( - 'Icons' => Array( - 'default' => 'icon16_item.png', - '1_0' => 'icon16_link.png', - '0_0' => 'icon16_link_disabled.png', - '2_0' => 'icon16_link_pending.png', - '1_1' => 'icon16_link_pending.png', - '0_1' => 'icon16_link_disabled.png', - '2_1' => 'icon16_link_pending.png'), - 'module' => 'core', - - 'Fields' => Array( - 'ListingId' => Array( 'title'=>'la_col_Id' , 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ), - 'LinkName' => Array( 'title'=>'la_col_LinkName' , 'data_block' => 'link_td', 'filter_block' => 'grid_like_filter', 'width' => 170, ), - 'ListingTypeId' => Array( 'title'=>'la_col_ListingTypeName' , 'data_block' => 'listing_type_td', 'filter_block' => 'grid_like_filter', 'width' => 100, ), - 'LinkOwner' => Array( 'title'=>'la_col_LinkOwner', 'filter_block' => 'grid_like_filter', 'width' => 115, ), - 'PendingRenewal' => Array( 'title'=>'la_col_PendingRenewal', 'filter_block' => 'grid_options_filter', 'width' => 143, ), - 'PurchasedOn' => Array( 'title'=>'la_col_PurchasedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ), - 'ExpiresOn' => Array( 'title'=>'la_col_ExpiresOn', 'filter_block' => 'grid_date_range_filter', 'width' => 140, ), - ), - ), - ), - - ); \ No newline at end of file Index: branches/5.0.x/in-link/units/listings/listings_tag_processor.php =================================================================== diff -u -N --- branches/5.0.x/in-link/units/listings/listings_tag_processor.php (revision 12746) +++ branches/5.0.x/in-link/units/listings/listings_tag_processor.php (revision 0) @@ -1,104 +0,0 @@ -Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params); - - return $this->Application->HREF($params['edit_template'],'', Array( - 'm_opener' => 'd', - 'lst_mode' => 't', - 'lst_event' => 'OnEdit', - 'lst_id' => $object->GetDBField('ListingTypeId'), - 'pass' => 'all,lst' - ), 'index.php'); - } - - function LinkEditLink($params) - { - $object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params ); - - $sql = 'SELECT '.$this->Application->getUnitOption('l', 'IDField').' - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - - return $this->Application->HREF($params['edit_template'],'', Array( - 'm_opener' => 'd', - 'l_mode' => 't', - 'l_event' => 'OnEdit', - 'l_id' => $this->Conn->GetOne($sql), - 'pass' => 'all,l' - )); - } - - function ExpirationDate($params) - { - $object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params ); - $listing_type =& $this->Application->recallObject( 'lst', 'lst', $params ); - - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $listing_type->GetDBField('Duration'); - $duration_type = $listing_type->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $expiration_date = adodb_mktime() + $expiration_interval; - - $lang =& $this->Application->recallObject('lang.current'); - $format = $lang->GetDBField('DateFormat'); - $expiration_date = adodb_date($format, $expiration_date); - - return $expiration_date; - } - - function ExpirationTime($params) - { - $object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params ); - $listing_type =& $this->Application->recallObject( 'lst', 'lst', $params ); - - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $listing_type->GetDBField('Duration'); - $duration_type = $listing_type->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $expiration_date = adodb_mktime() + $expiration_interval; - - $lang =& $this->Application->recallObject('lang.current'); - $format = $lang->GetDBField('TimeFormat'); - $expiration_date = adodb_date($format, $expiration_date); - - return $expiration_date; - } -} \ No newline at end of file Index: branches/5.0.x/in-link/units/l-visits/l-visits_config.php =================================================================== diff -u -N --- branches/5.0.x/in-link/units/l-visits/l-visits_config.php (revision 12746) +++ branches/5.0.x/in-link/units/l-visits/l-visits_config.php (revision 0) @@ -1,85 +0,0 @@ - 'l-visit', - 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'), - 'EventHandlerClass' => Array('class' => 'LinkVisitEventHandler', 'file' => 'l-visit_eh.php', 'build_event' => 'OnBuild'), - - 'AutoLoad' => true, - - 'Hooks' => Array ( - Array ( - 'Mode' => hAFTER, - 'Conditional' => false, - 'HookToPrefix' => 'u', - 'HookToSpecial' => '-item', // from OnMassDelete event - 'HookToEvent' => Array('OnAfterItemDelete'), - 'DoPrefix' => '', - 'DoSpecial' => '*', - 'DoEvent' => 'OnDeleteVisits', - ), - - Array ( - 'Mode' => hAFTER, - 'Conditional' => false, - 'HookToPrefix' => 'l', - 'HookToSpecial' => '-item', // from "Catalog" - 'HookToEvent' => Array('OnAfterItemDelete'), - 'DoPrefix' => '', - 'DoSpecial' => '*', - 'DoEvent' => 'OnDeleteVisits', - ), - - Array ( - 'Mode' => hAFTER, - 'Conditional' => false, - 'HookToPrefix' => 'l', - 'HookToSpecial' => 'showall-item', // from "Advanced View" - 'HookToEvent' => Array('OnAfterItemDelete'), - 'DoPrefix' => '', - 'DoSpecial' => '*', - 'DoEvent' => 'OnDeleteVisits', - ), - ), - - 'QueryString' => Array ( - 1 => 'id', - 2 => 'page', - 3 => 'event', - ), - - 'IDField' => 'VisitId', - 'TableName' => TABLE_PREFIX.'LinkVisits', - - 'AutoDelete' => true, - - 'ListSQLs' => Array ('' => 'SELECT * FROM %s'), - 'ItemSQLs' => Array ('' => 'SELECT * FROM %s'), - - 'ListSortings' => Array ( - '' => Array( - 'Sorting' => Array('VisitTimestamp' => 'desc'), - ) - ), - - 'Fields' => Array ( - 'VisitId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'ResourceId' => Array ('type' => 'int', 'default' => NULL), - 'PortalUserId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0), - 'VisitTimestamp' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'), - ), - ); \ No newline at end of file Index: branches/5.0.x/in-link/units/l-visits/l-visit_eh.php =================================================================== diff -u -N --- branches/5.0.x/in-link/units/l-visits/l-visit_eh.php (revision 12746) +++ branches/5.0.x/in-link/units/l-visits/l-visit_eh.php (revision 0) @@ -1,35 +0,0 @@ -MasterEvent->Prefix == 'u' ? 'PortalUserId' : 'ResourceId'; - $table_name = $this->Application->getUnitOption($this->Prefix, 'TableName'); - - $object =& $event->MasterEvent->getObject(); - - $sql = 'DELETE FROM '.$table_name.' - WHERE '.$key_field.' = '.$object->GetDBField($key_field); - $this->Conn->Query($sql); - } -} \ No newline at end of file Index: branches/5.0.x/in-link/units/links/link_tag_processor.php =================================================================== diff -u -N --- branches/5.0.x/in-link/units/links/link_tag_processor.php (revision 12746) +++ branches/5.0.x/in-link/units/links/link_tag_processor.php (revision 0) @@ -1,459 +0,0 @@ -Application->GetVar($this->Prefix.'_id'); - if ($object->isLoaded() && $id && ($object->GetID() != $id)) { - $object->Load($id); - } - } - - return $object; - }*/ - - function getListingInfo($resource_id, $field = null) - { - $sql = 'SELECT * - FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$resource_id; - $listing_info = $this->Conn->GetRow($sql); - return isset($field) ? $listing_info[$field] : $listing_info; - } - - /** - * Detects listing enhancement status (enhanced or not) - * - * @param Array $params - * @return int - */ - function LinkIsEnhanced($params) - { - $object =& $this->getObject(); - /* @var $object kDBItem */ - - if ($object->GetDBField('Status') == STATUS_PENDING || $object->GetDBField('Status') == STATUS_PENDING_EDITING) { - return false; - } - - $listing_type_id = $this->getListingInfo($object->GetDBField('ResourceId'), 'ListingTypeId'); - - $this->Application->SetVar('lst_id', $listing_type_id); // compatibility with old-theme - return $listing_type_id ? 1 : 0; - } - - /** - * Detects if enhancement is pending approval - * - * @param Array $params - * @return int - */ - function EnhancementIsPending($params) - { - $object =& $this->getObject(); - /* @var $object kDBItem */ - - $status = $this->getListingInfo($object->GetDBField('ResourceId'), 'Status'); - - return $status == STATUS_PENDING ? 1 : 0; - } - - function ListingTypeField($params) - { - $object =& $this->getObject(); - /* @var $object kDBItem */ - - $lst_id = $this->getListingInfo($object->GetDBField('ResourceId'), 'ListingTypeId'); - - $lst_object =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $lst_object->Load($lst_id); - - return $lst_object->GetField( $this->SelectParam($params, 'name,field') ); - } - - function EnhancementField($params) - { - $object =& $this->getObject(); - /* @var $object kDBItem */ - - $listing_id = $this->getListingInfo($object->GetDBField('ResourceId'), 'ListingId'); - - $listing_object =& $this->Application->recallObject('ls', null, Array('skip_autoload' => true)); - $listing_object->Load($listing_id); - - return $listing_object->GetField( $this->SelectParam($params, 'name,field') ); - } - - function IsRenewalPeriod($params) - { - $object =& $this->getObject(); - /* @var $object kDBItem */ - - $listing_info = $this->getListingInfo($object->GetDBField('ResourceId')); - - $sql = 'SELECT RenewalReminder - FROM '.$this->Application->getUnitOption('lst', 'TableName').' - WHERE ListingTypeId = '.$listing_info['ListingTypeId']; - $renewal_interval = $this->Conn->GetOne($sql) * 3600 * 24; - - return ($listing_info['ExpiresOn'] - adodb_mktime() < $renewal_interval) ? 1 : 0; - } - - function FirstListingType($params) - { - static $first = true; - if ($first) { - $first = false; - return true; - } - else { - return false; - } - } - - function IsReocurringEnhancement($params) - { - $params['name'] = 'Recurring'; - return $this->ListingTypeField($params); - } - - function EnhanceUsingInCommerce($params) - { - if (!$this->Application->isModuleEnabled('In-Commerce')) { - return 0; - } - - $object =& $this->getObject(); - /* @var $object kDBItem */ - - $listtype_id = $this->getListingInfo($object->GetDBField('ResourceId'), 'ListingTypeId'); - - $lst_object =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $lst_object->Load($listtype_id); - - return $lst_object->GetDBField('EnableBuying'); - } - - function ClickLink($params) - { - $object =& $this->getObject($params); - - return $this->Application->HREF($params['t'], '', Array('l_id' => $object->GetID(), 'pass'=>'all,l' )); - } - - function ListRelatedLinks($params) - { - return $this->PrintList2($params); - } - - function LinkLink($params) - { - return $this->ItemLink($params, 'link'); - } - - function ListingDescription($params) - { - $listing_type =& $this->Application->recallObject('lst'); - /* @var $listing_type kDBItem */ - - return $listing_type->GetDBField('Description'); - } - - function ListingTypeDetailsLink($params) - { - $listing_type =& $this->Application->recallObject('lst', null, Array ('raise_warnings' => 0)); - /* @var $listing_type kDBList */ - - $params['lst_id'] = $listing_type->isLoaded() ? $listing_type->GetID() : $this->Application->Parser->GetParam('key'); - - return $this->Application->ProcessParsedTag('m', 'Link', $params); - } - - /** - * Register hit & go to link url - * - * @param Array $params - */ - function FollowLocation($params) - { - $object =& $this->getObject(); - /* @var $object kCatDBItem */ - - if (!$object->isLoaded()) { - trigger_error('No Link ID for redirect', E_USER_ERROR); - } - - $object->RegisterHit(); - - // save user and time - if (!$this->Application->isAdmin && $this->Application->LoggedIn()) { - $resource_id = $object->GetDBField('ResourceId'); - $user_id = $this->Application->RecallVar('user_id'); - - $link_visit = $this->Application->recallObject('l-visit', null, Array ('skip_autoload' => true)); - /* @var $link_visit kDBItem */ - - $link_visit->Load( Array ('ResourceId' => $resource_id, 'PortalUserId' => $user_id) ); - if ($link_visit->isLoaded()) { - // for existing visits update date - $link_visit->SetDBField('VisitTimestamp_date', adodb_mktime()); - $link_visit->SetDBField('VisitTimestamp_time', adodb_mktime()); - } - else { - // for new visits set user & link, visit will be set as default value - $link_visit->SetDBField('ResourceId', $resource_id); - $link_visit->SetDBField('PortalUserId', $user_id); - } - - $status = $link_visit->isLoaded() ? $link_visit->Update() : $link_visit->Create(); - } - - $url = $object->GetDBField('Url'); - if (!preg_match('/^(http|ftp|mailto:)(.*)/U', $url)) { - $url = 'http://'.$url; - } - - $this->Application->Redirect('external:'.$url); - } - - /** - * Returns formatted address (from custom fields) for using with google - * - * @param Array $params - * @return string - */ - function GetGoogleAddress($params) - { - $object =& $this->getObject(); - - if (isset($params['display_info']) && $params['display_info']) { - $ret = $object->GetField('cust_LinkAddress') ? $object->GetField('cust_LinkAddress').'
    ' : ''; - $ret .= $object->GetField('cust_LinkCity') ? $object->GetField('cust_LinkCity').',' : ''; - $ret .= $object->GetField('cust_LinkState') ? $object->GetField('cust_LinkState') : ''; - $ret .= $object->GetField('cust_LinkZipCode') ? $object->GetField('cust_LinkZipCode').'
    ' : ''; - $ret .= $object->GetField('cust_LinkCountry') ? $object->GetField('cust_LinkCountry').'
    ' : ''; - $ret .= $object->GetField('cust_LinkPhone') ? ''.$this->Application->Phrase('lu_fld_LinkPhone').': '.$object->GetField('cust_LinkPhone') : ''; - - return $ret; - } - - $ret = $object->GetField('cust_LinkAddress') ? $object->GetField('cust_LinkAddress').',' : ''; - $ret .= $object->GetField('cust_LinkCity') ? $object->GetField('cust_LinkCity').',' : ''; - $ret .= $object->GetField('cust_LinkState') ? $object->GetField('cust_LinkState').',' : ''; - $ret .= $object->GetField('cust_LinkZipCode') ? $object->GetField('cust_LinkZipCode').',' : ''; - $ret .= $object->GetField('cust_LinkCountry') ? $object->GetField('cust_LinkCountry') : ''; - - return $ret; - } - - /** - * Returns timestamp of last link visit for logged in users only. - * - * @param Array $params - * @return string - */ - function LastVisited($params) - { - if (!$this->Application->LoggedIn()) { - // we don't gather link visit statistics for Guests - return ''; - } - - static $link_visited = Array (); - - $object =& $this->getObject(); - /* @var $object kDBList */ - - if (!isset($link_visited[$this->Special])) { - $resource_ids = $object->GetCol('ResourceId'); - $user_id = $this->Application->RecallVar('user_id'); - - $table_name = $this->Application->getUnitOption('l-visit', 'TableName'); - $sql = 'SELECT VisitTimestamp, ResourceId - FROM '.$table_name.' - WHERE (PortalUserId = '.$user_id.') AND (ResourceId IN ('.implode(',', $resource_ids).'))'; - $link_visited[$this->Special] = $this->Conn->GetCol($sql, 'ResourceId'); - } - - if (!isset($link_visited[$this->Special][$object->GetDBField('ResourceId')])) { - // link has no visit information for current user - return ''; - } - - $link_visit = $link_visited[$this->Special][$object->GetDBField('ResourceId')]; - - if (isset($params['formatted']) && $params['formatted']) { - // format the date - $lang =& $this->Application->recallObject('lang.current'); - - if (isset($params['display_time']) && $params['display_time']) { - $display_format = $lang->GetDBField('DateFormat').' @ '.$lang->GetDBField('TimeFormat'); - } - else { - $display_format = $lang->GetDBField('DateFormat'); - } - - return adodb_date($display_format, $link_visit); - } - - return $link_visit; - } - - /** - * Checks if specified Custom Fields and condition are true - * - * @param Array $params - * @return string - */ - function HasValue($params) - { - $condition = isset($params['condition']) ? strtolower($params['condition']) : false; - $fields = isset($params['fields']) ? $params['fields'] : false; - if (!$fields || !in_array($condition, Array('or', 'and'))) { - // required parameters not passed - return false; - } - - $fields = explode(',', $fields); - - $object =& $this->getObject(); - /* @var $object kDBList */ - - switch ($condition) { - case 'or': - foreach ($fields as $field) { - if (strlen($object->GetDBField($field))) { - return true; - } - } - break; - - case 'and': - foreach ($fields as $field) { - if (!strlen($object->GetDBField($field))) { - return false; - } - } - break; - } - - return $condition == 'and' ? true : false; - } - - /** - * Gets and parses custom details template or default one - * - * @param Array $params - * @return string - */ - function DisplayDetailTemplate($params) - { - $object =& $this->getObject($params); - /* @var $object kDBItem */ - - $template_name = $object->GetDBField('CustomTemplate'); - if (!$template_name || !$this->Application->TemplatesCache->TemplateExists($template_name)) { - $template_name = $params['default_template']; - } - - $block_params['name'] = $template_name; - - // parse template - return $this->Application->ParseBlock($block_params); - } - - /** - * Changes title preset of "Duplicate checker" section to show current grouping - * - * @param Array $params - */ - function ModifyUnitConfig($params) - { - $grid = array_key_exists('grid', $params) ? $params['grid'] : false; - if ($grid != 'Duplicates') { - // only for "Duplicate Checker" section - return ; - } - - $link_helper =& $this->Application->recallObject('LinkHelper'); - /* @var $link_helper LinkHelper */ - - // 1. get current grouping - $grouping = $link_helper->getGrouping( $this->getPrefixSpecial() ); - - // 2. replace field names in grouping with their corresponding column titles - $grids = $this->Application->getUnitOption($this->Prefix, 'Grids'); - foreach ($grouping as $index => $group_field) { - $group_field = preg_replace('/^l[\d]+_/', '', $group_field); // remove ml prefix - $grouping[$index] = $this->Application->Phrase($grids[$grid]['Fields'][$group_field]['title']); - } - - // 3. patch resulting title preset - $concat_with = "' " . $this->Application->Phrase('la_and') . " '"; - $title_presets = $this->Application->getUnitOption($this->Prefix, 'TitlePresets'); - $title_presets['duplicate_links'] = str_replace('%s', "'" . implode($concat_with, $grouping) . "'", $title_presets['duplicate_links']); - - $this->Application->setUnitOption($this->Prefix, 'TitlePresets', $title_presets); - } - - /** - * Allows to modify block params & current list record before PrintList parses record - * - * @param kDBList $object - * @param Array $block_params - */ - function PrepareListElementParams(&$object, &$block_params) - { - $grid = array_key_exists('grid', $block_params) ? $block_params['grid'] : false; - if ($grid != 'Duplicates') { - // only for "Duplicate Checker" section - return ; - } - - static $grouping = null; - - if (!isset($grouping)) { - $link_helper =& $this->Application->recallObject('LinkHelper'); - /* @var $link_helper LinkHelper */ - - // 1. get current grouping - $grouping = $link_helper->getGrouping( $this->getPrefixSpecial() ); - } - - $fields_hash =& $object->getCurrentRecord(); - - $key_fields = Array (); - foreach ($grouping as $group_field) { - $key_fields[$group_field] = $fields_hash[$group_field]; - } - - $fields_hash['LinkId'] = base64_encode( serialize($key_fields) ); - } -} \ No newline at end of file Index: branches/5.0.x/in-link/units/links/links_config.php =================================================================== diff -u -N --- branches/5.0.x/in-link/units/links/links_config.php (revision 12746) +++ branches/5.0.x/in-link/units/links/links_config.php (revision 0) @@ -1,571 +0,0 @@ - 'l', - 'ItemClass' => Array('class'=>'kCatDBItem','file'=>'','build_event'=>'OnItemBuild'), - 'ListClass' => Array('class'=>'kCatDBList','file'=>'','build_event'=>'OnListBuild'), - 'EventHandlerClass' => Array('class' => 'LinksEventHandler', 'file' => 'links_event_handler.php', 'require_classes' => Array('kCatDBEventHandler'), 'build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'LinkTagProcessor','file'=>'link_tag_processor.php', 'require_classes' => Array('kCatDBTagProcessor'), 'build_event'=>'OnBuild'), - 'AutoLoad' => true, - - 'ConfigPriority' => 0, - - 'RewritePriority' => 101, - 'RewriteListener' => 'ModRewriteHelper:CategoryItemRewriteListener', - - 'Hooks' => Array ( - Array ( - 'Mode' => hBEFORE, - 'Conditional' => false, - 'HookToPrefix' => '', - 'HookToSpecial' => '*', - 'HookToEvent' => Array('OnAfterConfigRead'), - 'DoPrefix' => 'cdata', - 'DoSpecial' => '*', - 'DoEvent' => 'OnDefineCustomFields', - ), - - Array ( - 'Mode' => hBEFORE, - 'Conditional' => false, - 'HookToPrefix' => '', - 'HookToSpecial' => '*', - 'HookToEvent' => Array('OnAfterConfigRead'), - 'DoPrefix' => '#file', - 'DoSpecial' => '*', - 'DoEvent' => 'OnDefineFiles', - ), - Array ( - 'Mode' => hAFTER, - 'Conditional' => false, - 'HookToPrefix' => '', - 'HookToSpecial' => '*', - 'HookToEvent' => Array('OnAfterConfigRead'), - 'DoPrefix' => 'captcha', - 'DoSpecial' => '*', - 'DoEvent' => 'OnPrepareCaptcha', - ), - ), - - 'QueryString' => Array( - 1 => 'id', - 2 => 'Page', - 3 => 'event', - 4 => 'mode', - ), - - 'AggregateTags' => Array ( - Array ( - 'AggregateTo' => 'l', - 'AggregatedTagName' => 'ListLinks', - 'LocalTagName' => 'PrintList2', - ), - ), - - 'CatalogItem' => true, - 'AdminTemplatePath' => 'links', - 'AdminTemplatePrefix' => 'links_', - 'SearchConfigPostfix' => 'links', - - 'IDField' => 'LinkId', - 'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events - - 'ItemType' => 4, - - 'StatisticsInfo' => Array( - 'pending' => Array( - 'icon' => 'icon16_link_pending.png', - 'label' => 'la_Text_Links', - 'js_url' => '#url#', - 'url' => Array('t' => 'catalog/advanced_view', 'SetTab' => 'l', 'pass' => 'm,l.showall', 'l.showall_event' => 'OnSetFilterPattern', 'l.showall_filters' => 'show_active=0,show_pending=1,show_disabled=0,show_new=1,show_hot=1,show_pop=1,show_pick=1'), - 'status' => STATUS_PENDING, - ), - ), - - 'TitlePhrase' => 'la_Text_Link', // phrase used to specify item type in relationship list - - 'ViewMenuPhrase' => 'la_title_Links', - 'CatalogTabIcon' => 'in-link:icon16_links.png', - 'UsePendingEditing' => true, // item editing is controlled by LINK.ADD/EDIT, LINK.ADD/EDIT.PENDING permissions - - 'CatalogSelectorName' => 'linklist', // used in old catalog section - - 'ItemPropertyMappings' => Array( - 'NewDays' => 'Link_NewDays', // number of days item to be NEW - 'MinPopVotes' => 'Link_MinPopVotes', // minimum number of votes for an item to be POP - 'MinPopRating' => 'Link_MinPopRating', // minimum rating for an item to be POP - 'MaxHotNumber' => 'Link_MaxHotNumber', // maximum number of HOT items - - 'HotLimit' => 'Link_HotLimit', // variable name in inp_Cache table - 'ClickField' => 'Hits', // item click count is stored here (in item table) - ), - - 'TitleField' => 'Name', - - 'TitlePresets' => Array( - 'default' => Array( - 'new_status_labels' => Array('l' => '!la_title_AddingLink!'), - 'edit_status_labels' => Array('l'=>'!la_title_EditingLink!'), - 'new_titlefield' => Array('l'=>'!la_title_NewLink!'), - ), - - 'links_edit' => Array( - 'prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_General!", - 'toolbar_buttons' => Array ('select', 'cancel', 'prev', 'next'), - ), - - 'link_list' => Array( - 'prefixes' => Array('c_List', 'l_List'), - 'format' => "!la_title_Categories! (#c_recordcount#) - !la_title_Links!", - 'toolbar_buttons' => Array (), - ), - - 'links_categories' => Array( - 'prefixes' => Array('l','l-ci_List'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Categories!", - 'toolbar_buttons' => Array ('select', 'cancel', 'prev', 'next', 'new_item', 'delete', 'setprimary',), - ), - - 'links_relations' => Array( - 'prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Relations!", - 'toolbar_buttons' => Array ('select', 'cancel', 'prev', 'next', 'new_item', 'edit', 'delete', 'approve', 'decline', 'view', 'dbl-click'), - ), - - 'links_images' => Array( - 'prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Images!", - 'toolbar_buttons' => Array ('select', 'cancel', 'prev', 'next', 'new_item', 'edit', 'delete', 'move_up', 'move_down', 'setprimary', 'view', 'dbl-click'), - ), - - 'links_files' => Array( - 'prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Files!", - 'toolbar_buttons' => Array ('select', 'cancel', 'prev', 'next', 'new_item', 'edit', 'delete', 'view', 'dbl-click'), - ), - - 'links_reviews' => Array( - 'prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Reviews!", - 'toolbar_buttons' => Array ('select', 'cancel', 'prev', 'next', 'new_item', 'edit', 'delete', 'approve', 'decline', 'move_up', 'move_down', 'view', 'dbl-click'), - ), - - 'links_custom' => Array( - 'prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Custom!", - 'toolbar_buttons' => Array ('select', 'cancel', 'prev', 'next'), - ), - - 'images_edit' => Array( - 'prefixes' => Array('l', 'l-img'), - 'new_status_labels' => Array('l-img' => '!la_title_Adding_Image!'), - 'edit_status_labels' => Array('l-img' => '!la_title_Editing_Image!'), - 'new_titlefield' => Array('l-img' => '!la_title_New_Image!'), - 'format' => "#l_status# '#l_titlefield#' - #l-img_status# '#l-img_titlefield#'", - 'toolbar_buttons' => Array ('select', 'cancel'), - ), - - 'file_edit' => Array ( - 'prefixes' => Array ('l', 'l-file'), - 'new_status_labels' => Array ('l-file' => "!la_title_AddingFile!"), - 'edit_status_labels' => Array ('l-file' => '!la_title_EditingFile!'), - 'new_titlefield' => Array ('l-file' => '!la_title_NewFile!'), - 'format' => "#l_status# '#l_titlefield#' - #l-file_status# '#l-file_titlefield#'", - 'toolbar_buttons' => Array ('select', 'cancel'), - ), - - 'reviews_edit' => Array( - 'prefixes' => Array('l', 'l-rev'), - 'new_status_labels' => Array('l-rev'=>"!la_title_Adding_Review! '!la_title_New_Review!'"), - 'edit_status_labels' => Array('l-rev'=>'!la_title_Editing_Review!'), - 'format' => "#l_status# '#l_titlefield#' - #l-rev_status#", - 'toolbar_buttons' => Array ('select', 'cancel'), - ), - - 'relations_edit' => Array( - 'prefixes' => Array('l', 'l-rel'), - 'new_status_labels' => Array('l-rel'=>"!la_title_Adding_Relationship! '!la_title_New_Relationship!'"), - 'edit_status_labels' => Array('l-rel'=>'!la_title_Editing_Relationship!'), - 'format' => "#l_status# '#l_titlefield#' - #l-rel_status#", - 'toolbar_buttons' => Array ('select', 'cancel'), - ), - - 'links_export' => Array('format' => '!la_title_LinksExport!'), - - 'links_import' => Array('format' => '!la_title_ImportLinks!'), - - 'duplicate_links' => Array( - 'prefixes' => Array('l.duplicates_List'), 'format' => "!la_title_DuplicateLinks! - %s", - 'toolbar_buttons' => Array ('edit', 'view', 'dbl-click'), - ), - - 'duplicate_links_view' => Array( - 'prefixes' => Array('l.duplicates-sub_List'), 'format' => "!la_title_Links!", - 'toolbar_buttons' => Array ('cancel', 'edit', 'delete', 'merge_links', 'view', 'dbl-click'), - ), - - 'tree_in-link' => Array('format' => '!la_Text_Version! '.$this->Application->findModule('Name', 'In-Link', 'Version')), - ), - - 'EditTabPresets' => Array ( - 'Default' => Array ( - 'general' => Array ('title' => 'la_tab_General', 't' => 'in-link/links/links_edit', 'priority' => 1), - 'categories' => Array ('title' => 'la_tab_Categories', 't' => 'in-link/links/links_categories', 'priority' => 2), - 'relations' => Array ('title' => 'la_tab_Relations', 't' => 'in-link/links/links_relations', 'priority' => 3), - 'images' => Array ('title' => 'la_tab_Images', 't' => 'in-link/links/links_images', 'priority' => 4), - 'files' => Array ('title' => 'la_tab_Files', 't' => 'in-link/links/links_files', 'priority' => 5), - 'reviews' => Array ('title' => 'la_tab_Reviews', 't' => 'in-link/links/links_reviews', 'priority' => 6), - 'custom' => Array ('title' => 'la_tab_Custom', 't' => 'in-link/links/links_custom', 'priority' => 7), - ), - ), - - 'PermItemPrefix' => 'LINK', - - 'PermTabText' => 'In-Link', - 'PermSection' => Array('main' => 'CATEGORY:in-link:links_list', 'search' => 'in-link:configuration_search', 'email' => 'in-link:configuration_email', 'custom' => 'in-link:configuration_custom'), - - 'Sections' => Array( - 'in-link' => Array( - 'parent' => 'in-portal:root', - 'icon' => 'settings_in-link', - 'label' => 'la_title_In-Link', - 'url' => Array('t' => 'index', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view'), - 'priority' => 2.3, - 'container' => true, - 'type' => stTREE, - ), - - 'in-link:links' => Array( - 'parent' => 'in-portal:site', - 'icon' => 'links', - 'label' => 'la_tab_Links', - 'url' => Array('t' => 'catalog/advanced_view', 'anchor' => 'tab-l.showall', 'pass' => 'm'), - 'onclick' => 'setCatalogTab(\'l.showall\')', - 'permissions' => Array('view'), - 'priority' => 3.1, - 'type' => stTREE, - ), - - 'in-link:duplicate_checker' => Array( - 'parent' => 'in-link', - 'icon' => 'duplicate_checker', - 'label' => 'la_tab_DuplicateChecker', - 'url' => Array('t' => 'in-link/duplicate_checker', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit', 'delete'), - 'priority' => 2, - 'type' => stTREE, - ), - - // link settings - 'in-link:setting_folder' => Array ( - 'parent' => 'in-portal:system', - 'icon' => 'conf_directory', - 'label' => 'la_title_In-Link', - 'url' => Array ('t' => 'index', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array ('view'), - 'priority' => 3.3, - 'container' => true, - 'type' => stTREE, - ), - - /*'in-link:inlink_general' => Array( - 'parent' => 'in-link:setting_folder', - 'icon' => 'core:settings_general', - 'label' => 'la_tab_GeneralSettings', - 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 0.9, - 'type' => stTREE, - ),*/ - - 'in-link:configuration_output' => Array( - 'parent' => 'in-link:setting_folder', - 'icon' => 'core:conf_output', - 'label' => 'la_tab_ConfigOutput', - 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 1, - 'type' => stTREE, - ), - - 'in-link:configuration_search' => Array( - 'parent' => 'in-link:setting_folder', - 'icon' => 'core:conf_search', - 'label' => 'la_tab_ConfigSearch', - 'url' => Array('t' => 'config/config_search', 'module_key' => 'links', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 2, - 'type' => stTREE, - ), - - 'in-link:configuration_email' => Array( - 'parent' => 'in-link:setting_folder', - 'icon' => 'core:conf_email', - 'label' => 'la_tab_ConfigE-mail', - 'url' => Array('t' => 'config/config_email', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 3, - 'type' => stTREE, - ), - - 'in-link:configuration_custom' => Array( - 'parent' => 'in-link:setting_folder', - 'icon' => 'core:conf_customfields', - 'label' => 'la_tab_ConfigCustom', - 'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 4, 'pass_section' => true, 'pass' => 'm,cf'), - 'permissions' => Array('view', 'add', 'edit', 'delete'), - 'priority' => 4, - 'type' => stTREE, - ), - ), - - 'FilterMenu' => Array( - 'Groups' => Array( - Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_new'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_hot'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_pop'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_pick'), 'type' => WHERE_FILTER), - ), - 'Filters' => Array( - 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), - 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ), - 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), - 's1' => Array(), - 'show_new' => Array('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ), - 'show_hot' => Array('label' => 'la_Text_Hot', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ), - 'show_pop' => Array('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ), - 'show_pick' => Array('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '%1$s.`EditorsPick` != 1' ), - ) - ), - - 'TableName' => TABLE_PREFIX.'Link', - - 'CalculatedFields' => Array ( - '' => Array ( - 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.CreatedById = -1, "root", IF (%1$s.CreatedById = -2, "Guest", "n/a")), u.Login)', - 'CategoryId' => TABLE_PREFIX.'%3$sCategoryItems.CategoryId', - 'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename', - 'CategoryFilename' => TABLE_PREFIX.'Category.NamedParentPath', - 'PrimaryCat' => TABLE_PREFIX.'%3$sCategoryItems.PrimaryCat', - 'ParentPath' => TABLE_PREFIX.'Category.ParentPath', - - 'SameImages' => 'img.SameImages', - 'LocalThumb' => 'img.LocalThumb', - 'ThumbPath' => 'img.ThumbPath', - 'ThumbUrl' => 'img.ThumbUrl', - 'LocalImage' => 'img.LocalImage', - 'LocalPath' => 'img.LocalPath', - 'FullUrl' => 'img.Url', - ), - ), - - 'CacheModRewrite' => true, - - 'AggregatedCalculatedFields' => Array( - - 'duplicates' => Array ( - 'DupeCount' => 'COUNT(*)', - ), - ), - - - 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId - LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'Images img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1 - LEFT JOIN '.TABLE_PREFIX.'PermCache perm ON perm.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId - LEFT JOIN '.TABLE_PREFIX.'%3$sLinkCustomData cust ON %1$s.ResourceId = cust.ResourceId', - - ), // key - special, value - list select sql - - 'ListSortings' => Array( - '' => Array( - 'ForcedSorting' => Array('Priority' => 'desc'), - 'Sorting' => Array('Name' => 'asc', 'Description' => 'desc'), - ) - ), - 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId - LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'Images img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1 - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId - LEFT JOIN '.TABLE_PREFIX.'%3$sLinkCustomData cust ON %1$s.ResourceId = cust.ResourceId'), - - 'SubItems' => Array('l-rev', 'l-ci', 'l-rel', 'l-img', 'l-cdata', 'l-fav', 'l-file'), - - 'Fields' => Array ( - 'LinkId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,), - 'Name' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'not_null' => 1, 'required' => 1, 'max_len' => 255, 'default' => ''), - 'AutomaticFilename' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1), - 'Description' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'using_fck' => 1, 'default' => null), - 'Url' => Array('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''), - 'CreatedOn' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'), - 'Modified' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'), - 'Expire' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null), - 'Hits' => Array('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0), - 'CachedRating' => Array('type' => 'string', 'not_null' => 1, 'formatter' => 'kFormatter', 'default' => 0), - 'CachedVotesQty' => Array('type' => 'int', 'formatter' => 'kFormatter', 'not_null' => 1, 'default' => 0), - 'CachedReviewsQty' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), - 'CreatedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => -1), - 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => -1), - 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), - 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), - 'EditorsPick' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), - 'ResourceId' => Array('type' => 'int', 'default' => null), - 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'OrgId' => Array('type' => 'int', 'default' => null), - 'CustomTemplate' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), - 'MetaKeywords' => Array('type' => 'string', 'default' => null), - 'MetaDescription' => Array('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null), - 'ReciprocalLinkFound' => Array ( - 'type' => 'int', - 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_NotChecked', 1 => 'la_Yes', 2 => 'la_No'), 'use_phrases' => 1, - 'not_null' => 1, 'default' => 0 - ), - ), - - 'VirtualFields' => Array( - 'UserName' => Array('type' => 'string', 'default' => ''), - 'DupeCount' => Array('type' => 'string', 'default' => ''), - - 'ListingTypeId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %1$s FROM '.TABLE_PREFIX.'ListingTypes ORDER BY Name', 'option_title_field' => 'Name', 'option_key_field' => 'ListingTypeId', 'default' => 0), - - 'MoreCategories' => Array ('type' => 'string', 'default' => ''), - - // export related fields: begin - 'CategoryId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => 0), - 'ExportFormat' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'CSV', /*2 => 'XML'*/), 'default' => 1), - 'ExportFilename' => Array('type' => 'string', 'default' => ''), - 'FieldsSeparatedBy' => Array('type' => 'string', 'default' => ','), - 'FieldsEnclosedBy' => Array('type' => 'string', 'default' => '"'), - 'LineEndings' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'Windows', 2 => 'UNIX'), 'default' => 1), - 'LineEndingsInside' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'CRLF', 2 => 'LF'), 'default' => 2), - 'IncludeFieldTitles' => Array('type' => 'int', 'default' => 1), - 'ExportColumns' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array()), - 'AvailableColumns' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array()), - 'CategoryFormat' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_MixedCategoryPath', 2 => 'la_SeparatedCategoryPath'), 'use_phrases' => 1, 'default' => 1), - 'CategorySeparator' => Array('type' => 'string', 'error_field' => 'CategoryFormat', 'default' => ':'), - 'IsBaseCategory' => Array('type' => 'int', 'default' => 0), - // export related fields: end - - // import related fields: begin - 'FieldTitles' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Automatic', 2 => 'la_Manual'), 'use_phrases' => 1, 'default' => 1), - 'ImportSource' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Upload', 2 => 'la_Local'), 'use_phrases' => 1, 'default' => 2), - 'ImportFilename' => Array('type' => 'string', 'formatter' => 'kUploadFormatter', 'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => (defined('EXPORT_BASE_PATH') ? EXPORT_BASE_PATH : '/system/export') . '/'), - 'ImportLocalFilename' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'default' => ''), - 'CheckDuplicatesMethod' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_IDField', 2 => 'la_OtherFields'), 'use_phrases' => 1, 'default' => 1), - 'ReplaceDuplicates' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 0), - 'DuplicateCheckFields' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('Name' => 'NAME', 'Url' => 'URL'), 'default' => '|Name|Url|'), - 'SkipFirstRow' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 1), - // import related fields: end - - 'ThumbnailImage' => Array('type' => 'string', 'default' => ''), - 'FullImage' => Array('type' => 'string', 'default' => ''), - 'ImageAlt' => Array('type' => 'string', 'default' => ''), - - 'Filename' => Array('type' => 'string','not_null' => 1,'default' => ''), - 'CachedNavbar' => Array('type' => 'string', 'default' => ''), - 'ParentPath' => Array('type' => 'string', 'default' => ''), - - // for primary image - 'SameImages' => Array('type' => 'string', 'default' => ''), - 'LocalThumb' => Array('type' => 'string', 'default' => ''), - 'ThumbPath' => Array('type' => 'string', 'default' => ''), - 'ThumbUrl' => Array('type' => 'string', 'default' => ''), - 'LocalImage' => Array('type' => 'string', 'default' => ''), - 'LocalPath' => Array('type' => 'string', 'default' => ''), - 'FullUrl' => Array('type' => 'string', 'default' => ''), - ), - - 'Grids' => Array ( - 'Default' => Array ( - 'Icons' => Array ( - 0 => 'icon16_link_disabled.png', - 1 => 'icon16_link.png', - 2 => 'icon16_link_pending.png', - 'NEW' => 'icon16_link_new.png', - ), - 'Fields' => Array ( - 'LinkId' => Array ('title'=>'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ), - 'Name' => Array ('title'=>'la_col_LinkName', 'data_block' => 'grid_catitem_td', 'width' => 200, ), - 'Url' => Array ('title' => 'la_col_LinkUrl', 'width' => 200, ), - 'Description' => Array ('title' => 'la_col_Description', 'first_chars' => 100, 'width' => 100, ), - 'CreatedOn' => Array ('title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ), - 'Modified' => Array ('title' => 'la_col_Modified', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ), - 'Status' => Array('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 70, ), - 'Hits' => Array ('title' => 'la_col_Hits', 'filter_block' => 'grid_range_filter', 'width' => 60, ), - 'CachedRating' => Array ('title' => 'la_col_Rating', 'filter_block' => 'grid_range_filter', 'width' => 70, ), - 'CachedVotesQty' => Array ('title' => 'la_col_VoteCount', 'filter_block' => 'grid_range_filter', 'width' => 70, ), - 'CachedReviewsQty' => Array ('title' => 'la_col_ReviewCount', 'filter_block' => 'grid_range_filter', 'width' => 85, ), - ), - ), - - 'Radio' => Array ( - 'Icons' => Array ( - 0 => 'icon16_link_disabled.png', - 1 => 'icon16_link.png', - 2 => 'icon16_link_pending.png', - 'NEW' => 'icon16_link_new.png', - ), - 'Selector' => 'radio', - 'Fields' => Array ( - 'LinkId' => Array ('title'=>'la_col_Id', 'data_block' => 'grid_radio_td', 'filter_block' => 'grid_range_filter', 'width' => 70, ), - 'Name' => Array ('title'=>'la_col_LinkName', 'data_block' => 'grid_catitem_td', 'width' => 200, ), - 'Url' => Array ('title' => 'la_col_LinkUrl', 'width' => 200, ), - 'Description' => Array ('title' => 'la_col_Description', 'first_chars' => 100, 'width' => 100, ), - 'CreatedOn' => Array ('title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ), - 'Modified' => Array ('title' => 'la_col_Modified', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ), - 'Status' => Array('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 70, ), - 'Hits' => Array ('title' => 'la_col_Hits', 'filter_block' => 'grid_range_filter', 'width' => 60, ), - 'CachedRating' => Array ('title' => 'la_col_Rating', 'filter_block' => 'grid_range_filter', 'width' => 70, ), - 'CachedVotesQty' => Array ('title' => 'la_col_VoteCount', 'filter_block' => 'grid_range_filter', 'width' => 70, ), - 'CachedReviewsQty' => Array ('title' => 'la_col_ReviewCount', 'filter_block' => 'grid_range_filter', 'width' => 85, ), - ), - ), - - 'Duplicates' => Array ( - 'Icons' => Array ( - 0 => 'icon16_link_disabled.png', - 1 => 'icon16_link.png', - 2 => 'icon16_link_pending.png', - 'NEW' => 'icon16_link_new.png', - ), - - 'Fields' => Array ( - 'Name' => Array ('title' => 'la_col_LinkName', 'filter_block' => 'grid_like_filter', 'width' => 250, ), - 'Url' => Array ('title' => 'la_col_LinkUrl', 'filter_block' => 'grid_like_filter', 'width' => 300, ), - 'DupeCount' => Array ('title' => 'la_col_DupeCount', 'filter_block' => 'grid_range_filter', 'width' => 100, ), - ), - ), - ), - - - 'ConfigMapping' => Array( - 'PerPage' => 'Perpage_Links', - 'ShortListPerPage' => 'Perpage_Links_Short', - 'ForceEditorPick' => 'Link_ShowPick', - 'DefaultSorting1Field' => 'Link_SortField', - 'DefaultSorting2Field' => 'Link_SortField2', - 'DefaultSorting1Dir' => 'Link_SortOrder', - 'DefaultSorting2Dir' => 'Link_SortOrder2', - - 'RatingDelayValue' => 'link_RatingDelay_Value', - 'RatingDelayInterval' => 'link_RatingDelay_Interval', - - ), - ); \ No newline at end of file Index: branches/5.0.x/in-link/units/links/links_event_handler.php =================================================================== diff -u -N --- branches/5.0.x/in-link/units/links/links_event_handler.php (revision 12746) +++ branches/5.0.x/in-link/units/links/links_event_handler.php (revision 0) @@ -1,488 +0,0 @@ - Array('self' => true), - 'OnProcessReciprocalLinks' => Array('self' => true), - 'OnSetGrouping' => Array('self' => 'view'), - 'OnStoreSelected' => Array('self' => 'view'), - 'OnMerge' => Array('self' => 'edit'), - ); - $this->permMapping = array_merge($this->permMapping, $permissions); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function SetCustomQuery(&$event) - { - parent::SetCustomQuery($event); - - $object =& $event->getObject(); - - if (!$this->Application->isAdminUser) { - $object->addFilter('expire_filter', '(Expire > '.adodb_mktime().' OR Expire IS NULL)'); - } - - if (substr($event->Special, 0, 10) == 'duplicates') { - $object->removeFilter('category_filter'); - - $link_helper =& $this->Application->recallObject('LinkHelper'); - /* @var $link_helper LinkHelper */ - - $grouping = $link_helper->getGrouping( $event->getPrefixSpecial() ); - switch ($event->Special) { - case 'duplicates': - foreach ($grouping as $group_field) { - $object->AddGroupByField($object->TableName.'.'.$group_field); - } - $object->addFilter('has_dupes_filter', 'DupeCount > 1', AGGREGATE_FILTER, FLT_SYSTEM); - break; - - case 'duplicates-sub': - $main_object =& $this->Application->recallObject($event->Prefix.'.duplicates'); - foreach ($grouping as $field_index => $group_field) { - $object->addFilter('dupe_filter_'.$field_index, '%1$s.`'.$group_field.'` = '.$this->Conn->qstr($main_object->GetDBField($group_field)) ); - } - break; - } - $object->addFilter('primary_filter', TABLE_PREFIX.'CategoryItems.PrimaryCat = 1'); - } - - } - - /** - * Set groping fields for link duplicate checker - * - * @param kEvent $event - */ - function OnSetGrouping(&$event) - { - $this->Application->LinkVar($event->getPrefixSpecial(true).'_dupe_fields', $event->getPrefixSpecial().'_dupe_fields'); - } - - /** - * Merge duplicate links together (only categories) & delete duplicates - * - * @param kEvent $event - */ - function OnMerge(&$event) - { - $link_helper =& $this->Application->recallObject('LinkHelper'); - /* @var $link_helper LinkHelper */ - - $grouping = $link_helper->getGrouping( $event->getPrefixSpecial() ); - - $ids = $this->StoreSelectedIDs($event); - if (!$ids) { - return true; - } - - // check, that user has not selected multiple links from same group - $primary_links = Array(); - - $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField'); - $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); - $sql = 'SELECT * - FROM '.$table_name.' - WHERE '.$id_field.' IN ('.implode(',', $ids).')'; - $links = $this->Conn->Query($sql, $id_field); - - $groping_error = false; - foreach ($links as $link_id => $link_data) { - $group_key = ''; - foreach ($grouping as $grouping_field) { - $group_key .= 'main_table.`'.$grouping_field.'` = '.$this->Conn->qstr($link_data[$grouping_field]).' AND '; - } - $group_key = substr($group_key, 0, -5); - - if (isset($primary_links[$group_key])) { - $groping_error = true; - break; - } - else { - $primary_links[$group_key] = $link_data['ResourceId']; - } - } - - if (!$groping_error) { - $temp =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); - - $categories_sql = 'SELECT main_table.ResourceId, ci.CategoryId, main_table.'.$id_field.' - FROM '.$table_name.' main_table - LEFT JOIN '.TABLE_PREFIX.'CategoryItems ci ON main_table.ResourceId = ci.ItemResourceId - WHERE %s'; - - foreach ($primary_links as $group_key => $primary_resource_id) { - $categories = Array(); - $group_links = Array(); - $group_categories = $this->Conn->Query(sprintf($categories_sql, $group_key)); - foreach ($group_categories as $category_data) { - $group_links[ $category_data['ResourceId'] ] = $category_data[$id_field]; - $categories[$category_data['ResourceId'] == $primary_resource_id ? 'remove' : 'add'][] = $category_data['CategoryId']; - } - unset($group_links[$primary_resource_id]); - $categories = array_unique( array_diff($categories['add'], $categories['remove']) ); - if ($categories) { - // add link to other link categories - $values_sql = ''; - foreach ($categories as $category_id) { - $values_sql .= '('.$category_id.','.$primary_resource_id.',0),'; - } - $values_sql = substr($values_sql, 0, -1); - $insert_sql = 'INSERT INTO '.TABLE_PREFIX.'CategoryItems (CategoryId,ItemResourceId,PrimaryCat) VALUES '.$values_sql; - $this->Conn->Query($insert_sql); - } - - // delete all links from group except primary - $temp->DeleteItems($event->Prefix, $event->Special, array_values($group_links)); - } - - - } - else { - $event->status = erFAIL; - $event->redirect = false; - $this->Application->SetVar($event->getPrefixSpecial().'_error', 1); - } - - } - - /** - * Stores ids, that were selected in duplicate checker - * - * @param kEvent $event - */ - function OnStoreSelected(&$event) - { - $this->StoreSelectedIDs($event); - - $event->SetRedirectParam('pass', 'm,' . $event->getPrefixSpecial()); - } - - /** - * Allows to enhance link after creation - * - * @param kEvent $event - */ - function OnCreate(&$event) - { - parent::OnCreate($event); - - if ($event->status == erSUCCESS) { - $object =& $event->getObject(); - /* @var $object kDBItem */ - - // replace 0 id in post with actual created id (used in enhancement process) - $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); - array_rename_key($items_info, 0, $object->GetID()); - $this->Application->SetVar($event->getPrefixSpecial(true), $items_info); - - // listing was created -> enhance it right away - $enhancement_event = new kEvent('ls:OnRequestEnhancement'); - $this->Application->HandleEvent($enhancement_event); - if (($enhancement_event->status == erSUCCESS) && strlen($enhancement_event->redirect)) { - $event->SetRedirectParam('next_template', $event->redirect); - $event->redirect = $enhancement_event->redirect; - } - } - } - - /** - * Adds free listing option to listing type selection - * - * @param kEvent $event - */ - function OnAfterConfigRead(&$event) - { - parent::OnAfterConfigRead($event); - - if (defined('IS_INSTALL') && IS_INSTALL) { - return ; - } - - $free_listings = $this->Application->ConfigValue('Link_AllowFreeListings'); - - $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields'); - $virtual_fields['ListingTypeId']['options'] = $free_listings ? Array (0 => 'lu_free_listing') : Array (); - - $language_id = $this->Application->GetVar('m_lang'); - $duplicate_options = array_flip($virtual_fields['DuplicateCheckFields']['options']); - $duplicate_options['NAME'] = 'l' . $language_id . '_Name'; - $virtual_fields['DuplicateCheckFields']['options'] = array_flip($duplicate_options); - $default = $virtual_fields['DuplicateCheckFields']['default']; - $virtual_fields['DuplicateCheckFields']['default'] = str_replace('|Name|', '|l' . $language_id . '_Name|', $default); - - $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields); - - if (!$this->Application->isAdminUser) { - // for now only on Front-End - $this->Application->setUnitOption($event->Prefix, 'PopulateMlFields', true); - } - } - - /** - * contact us form submitted on link details page - * - * @param kEvent $event - */ - function OnContactFormSubmit(&$event) - { - $fields = Array ( - 'ContactFormFullName', 'ContactFormEmail', 'ContactFormSubject', 'ContactFormBody', 'ContactFormCaptcha' - ); - - // reset errors var - $this->Application->SetVar('ContactForm_HasErrors', ''); - - // 1. validate form fields - $required_fields = $this->Application->GetVar('FormRequiredFields'); - foreach ($fields as $field_name) { - $field_value = trim($this->Application->GetVar($field_name)); - if (in_array($field_name, $required_fields)) { - // custom captcha validation - if ($field_name == 'ContactFormCaptcha') { - if (!strlen($field_value) || ($field_value != $this->Application->RecallVar($event->Prefix . '_captcha_code'))) { - $this->Application->SetVar('error_'.$field_name, 1); - - $captcha_helper =& $this->Application->recallObject('CaptchaHelper'); - /* @var $captcha_helper kCaptchaHelper */ - $this->Application->StoreVar($event->Prefix . '_captcha_code', $captcha_helper->GenerateCaptchaCode()); - - $event->status = erFAIL; - $event->redirect = false; - } - } - // email validation - elseif (!strlen($field_value) || ($field_name == 'ContactFormEmail' && !preg_match('/'.REGEX_EMAIL_USER.'@'.REGEX_EMAIL_DOMAIN.'/', $field_value))) { - $this->Application->SetVar('error_'.$field_name, 1); - $event->status = erFAIL; - $event->redirect = false; - } - - } - } - - if ($event->status != erSUCCESS) { - // set errors var - $this->Application->SetVar('ContactForm_HasErrors', 1); - return ; - } - - $object =& $event->getObject(); // get link object - /* @var $object kDBItem */ - - $send_params = Array( - 'from_name' => $this->Application->GetVar('ContactFormFullName'), - 'from_email' => $this->Application->GetVar('ContactFormEmail'), - 'from_subject' => $this->Application->GetVar('ContactFormSubject'), - 'message' => $this->Application->GetVar('ContactFormBody'), - 'to_linkname' => $object->GetField('Name'), - ); - - $email_event =& $this->Application->EmailEventUser('LINK.CONTACTFORM', $object->GetDBField('CreatedById'), $send_params); - - if ($email_event->status == erSUCCESS) { - $event->redirect = $this->Application->GetVar('success_template'); - - $redirect_params = Array ( - 'opener' => 's', - 'pass' => 'all', - 'thankyou_header' => $this->Application->GetVar('success_label_header'), - 'thankyou_text' => $this->Application->GetVar('success_label_body') - ); - $event->setRedirectParams($redirect_params); - - $this->Application->EmailEventAdmin('LINK.CONTACTFORM', null, $send_params); - } - else { - $this->Application->SetVar('error_ContactFormEmail', 1); - $event->status = erFAIL; - $event->redirect = false; - } - } - - /** - * Makes reciprocal check on link, when it is created - * - * @param kEvent $event - */ - function OnBeforeItemCreate(&$event) - { - parent::OnBeforeItemCreate($event); - - $this->_checkLink($event); - } - - /** - * Makes reciprocal check on link, when it is updated - * - * @param kEvent $event - */ - function OnBeforeItemUpdate(&$event) - { - parent::OnBeforeItemUpdate($event); - - $this->_checkLink($event); - } - - /** - * Makes reciprocal check on link & saves results - * - * @param kEvent $event - */ - function _checkLink(&$event) - { - if (!$this->Application->ConfigValue('ReciprocalLinkChecking')) { - return ; - } - - $object =& $event->getObject(); - /* @var $object kDBItem */ - - if ($object->GetDBField('Url') != $object->GetOriginalField('Url')) { - // check only when url was changed - - $link_helper =& $this->Application->recallObject('LinkHelper'); - /* @var $link_helper LinkHelper */ - - $link_checked = $link_helper->CheckReciprocalURL($object->GetDBField('Url')); - - $object->SetDBField('ReciprocalLinkFound', $link_checked ? LINK_IS_RECIPROCAL : LINK_IS_NOT_RECIPROCAL); - - if (!$link_checked) { - $this->Application->EmailEventAdmin('LINK.RECIPROCAL.CHECK.FAILED'); - } - } - } - - /** - * Update links status by their reciprocal status - * - * @param kEvent $event - */ - function OnProcessReciprocalLinks(&$event) - { - if (!$this->Application->ConfigValue('ReciprocalLinkChecking')) { - return ; - } - - $object =& $event->getObject( Array('skip_autoload' => true) ); - /* @var $object kDBItem */ - - $link_helper =& $this->Application->recallObject('LinkHelper'); - /* @var $link_helper LinkHelper */ - - // 1. verify all links, that were not verified previously - $sql = 'SELECT ' . $id_field . ' - FROM ' . $table_name . ' - WHERE (ReciprocalLinkFound = 0)'; - $not_checked_links = $this->Conn->GetCol($sql); - - foreach ($not_checked_links as $link_id) { - $object->Load($link_id); - - $link_checked = $link_helper->CheckReciprocalURL($object->GetDBField('Url')); - - $object->SetDBField('ReciprocalLinkFound', $link_checked ? LINK_IS_RECIPROCAL : LINK_IS_NOT_RECIPROCAL); - $object->Update(); - - if ($link_checked) { - $object->ApproveChanges(); - } - else { - $object->DeclineChanges(); - $this->Application->EmailEventAdmin('LINK.RECIPROCAL.CHECK.FAILED'); - } - } - - // 2. approve all links, that have succeeded in reciprocal check (during adding/changing on front-end) - $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField'); - $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); - - $sql = 'SELECT ' . $id_field . ' - FROM ' . $table_name . ' - WHERE (ReciprocalLinkFound = ' . LINK_IS_RECIPROCAL . ') AND (Status <> ' . STATUS_ACTIVE . ')'; - $verified_links = $this->Conn->GetCol($sql); - - foreach ($verified_links as $link_id) { - $object->Load($link_id); - $object->ApproveChanges(); - } - - // 3. decline all links, that failed in reciprocal check (during adding/changing on front-end) - $sql = 'SELECT ' . $id_field . ' - FROM ' . $table_name . ' - WHERE (ReciprocalLinkFound = ' . LINK_IS_NOT_RECIPROCAL . ') AND (Status <> ' . STATUS_DISABLED . ')'; - $not_verified_links = $this->Conn->GetCol($sql); - - foreach ($not_verified_links as $link_id) { - $object->Load($link_id); - $object->DeclineChanges(); - } - } - - /** - * Allows to load duplicate link by special id - * - * @param kEvent $event - * @return int - */ - function getPassedID(&$event) - { - $id = parent::getPassedID($event); - - if (($event->Special == 'duplicates') && !is_numeric($id)) { - $load_keys = unserialize( base64_decode($id) ); - // can't return $load_keys as $id, because "kCatDBItem::GetKeyClause" will ignore them - - foreach ($load_keys as $field => $value) { - $load_keys[$field] = $field . ' = ' . $this->Conn->qstr($value); - } - - $sql = 'SELECT ' . $this->Application->getUnitOption($event->Prefix, 'IDField') . ' - FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName') . ' - WHERE (' . implode(') AND (', $load_keys) . ')'; - $id = $this->Conn->GetOne($sql); - } - - return $id; - } - - /** - * Returns events, that require item-based (not just event-name based) permission check - * - * @return Array - */ - function _getMassPermissionEvents() - { - $events = parent::_getMassPermissionEvents(); - $events[] = 'OnMerge'; - - return $events; - } - } \ No newline at end of file Index: branches/5.0.x/in-link/units/helpers/link_helper.php =================================================================== diff -u -N --- branches/5.0.x/in-link/units/helpers/link_helper.php (revision 12746) +++ branches/5.0.x/in-link/units/helpers/link_helper.php (revision 0) @@ -1,77 +0,0 @@ -Application->BaseURL()); - - if (preg_match('/(.*)<\\/a.*>/sUi', $html, $ret)) { - return true; - } - - return false; - } - - - /** - * Returns grouping fields for "Duplicate Checker" section - * - * @param string $prefix_special - * @return Array - */ - function getGrouping($prefix_special) - { - // cut "sub" postfix from special - $prefix_special = preg_replace('/(.*)-sub$/', '\\1', $prefix_special); - $grouping = $this->Application->RecallVar($prefix_special . '_dupe_fields'); - - if (!$grouping) { - $grouping = '|Url|'; - $this->Application->StoreVar($prefix_special . '_dupe_fields', $grouping); - } - - return explode('|', substr($grouping, 1, -1)); - } - - } \ No newline at end of file Index: branches/5.0.x/in-link/units/helpers/helpers_config.php =================================================================== diff -u -N --- branches/5.0.x/in-link/units/helpers/helpers_config.php (revision 12746) +++ branches/5.0.x/in-link/units/helpers/helpers_config.php (revision 0) @@ -1,24 +0,0 @@ - 'in-link-helpers', - 'EventHandlerClass' => Array ('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'), - - 'RegisterClasses' => Array ( - Array ('pseudo' => 'LinkHelper', 'class' => 'LinkHelper', 'file' => 'link_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - ), - ); \ No newline at end of file Index: branches/unlabeled/unlabeled-1.5.2/themes/default/inlink/search_results/search_results_element.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.5.2/themes/default/inlink/search_results/search_results_element.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.5.2/themes/default/inlink/search_results/search_results_element.tpl (revision 0) @@ -1,64 +0,0 @@ - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - -


    - "> - <inp:m_language _Phrase=" /> - <inp:m_language _Phrase=" /> - <inp:m_language _Phrase=" /> - <inp:m_language _Phrase=" /> - -
    : - "> -
      

       - : ; - : , - : , - : , - : -
       - - - - - - - - - - - - - - - - - - -






    ">
    -
    - Index: branches/unlabeled/unlabeled-1.5.2/in-link/admin_templates/export_progress.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.5.2/in-link/admin_templates/export_progress.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.5.2/in-link/admin_templates/export_progress.tpl (revision 0) @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.5.2/in-link/admin_templates/paid_listings/paid_listing_types_tabs.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.5.2/in-link/admin_templates/paid_listings/paid_listing_types_tabs.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.5.2/in-link/admin_templates/paid_listings/paid_listing_types_tabs.tpl (revision 0) @@ -1,11 +0,0 @@ - - - - -
    - - - - -
    -
    \ No newline at end of file Index: branches/unlabeled/unlabeled-1.5.2/in-link/admin_templates/import_progress.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.5.2/in-link/admin_templates/import_progress.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.5.2/in-link/admin_templates/import_progress.tpl (revision 0) @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - Index: branches/unlabeled/unlabeled-1.5.2/in-link/admin_templates/export.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.5.2/in-link/admin_templates/export.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.5.2/in-link/admin_templates/export.tpl (revision 0) @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - - - - - - "> - - - - - - - "> - - - - - - - - - - -
    - - - - - - - - - - - -
    - " onclick="move_options_up('', 1)" class="button"> - " onclick="move_options_down('', 1)" class="button">
    -
    -

    :
    - - " value="" /> - - ', '')" class="button">
    -
    - ', ''); select_sort('');" class="button"> -
    - -
    -
     
    - - - - - - - - - - - - - -
    - checked name="" id="_1" value="1" /> - - -
    - error"> *: - " id="" value="" size="2" maxlength="1" />
    - (will look like "Category:Sub-category:Sub-sub-category") - -
    - checked name="" id="_2" value="2" /> - -
    - (the fields will be titled Category1..CategoryN accordingly) -
    -
     
    - - Index: branches/unlabeled/unlabeled-1.40.2/in-link/admin/install/inportal_data.sql =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.40.2/in-link/admin/install/inportal_data.sql (revision 12746) +++ branches/unlabeled/unlabeled-1.40.2/in-link/admin/install/inportal_data.sql (revision 0) @@ -1,265 +0,0 @@ -INSERT INTO ConfigurationAdmin VALUES ('Link_SortField', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 4) AND (IsSystem = 0)', 10.01, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.01, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortField2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 4) AND (IsSystem = 0)', 10.02, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.02, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links', 'la_Text_Links', 'la_link_perpage_prompt', 'text', '', '', 10.03, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_NewDays', 'la_Text_Links', 'la_link_newdays_prompt', 'text', '', '', 10.05, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MinPopRating', 'la_Text_Links', 'la_fld_Link_MinPopRating', 'text', '', '', 10.06, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MaxHotNumber', 'la_Text_Links', 'la_fld_Link_MaxHotNumber', 'text', '', '', 10.08, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_EnhancedLinks', 'la_Text_Links', 'la_link_EnhancedLinks', 'checkbox', '', '', 10.09, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_AllowFreeListings', 'la_Text_Links', 'la_link_AllowFreeListings', 'checkbox', '', '', 10.1, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ShowPick', 'la_Text_Links', 'la_link_editorspick_prompt', 'checkbox', '', '', 10.11, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_UrlStatus', 'la_Text_Links', 'la_link_urlstatus_prompt', 'checkbox', '', '', 10.12, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'ReviewText=la_common_ReviewText,CreatedOn=la_common_CreatedOn', 20.01, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 20.01, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'ReviewText=la_common_ReviewText,date=la_common_CreatedOn', 20.02, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 20.02, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MinPopVotes', 'la_Text_Links', 'la_fld_Link_MinPopVotes', 'text', '', '', 10.07, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_LinkReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 20.03, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links_Short', 'la_Text_Links', 'la_link_perpage_short_prompt', 'text', '', '', 10.04, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Name', 'la_Text_Link_Search', 'la_Link_Name', 'checkbox', '', '', 2, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Description', 'la_Text_Link_Search', 'la_Link_Description', 'checkbox', '', '', 1, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Url', 'la_Text_Link_Search', 'la_Link_Url', 'checkbox', '', '', 5, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CreatedOn', 'la_Text_Link_Search', 'la_Link_CreatedOn', 'checkbox', '', '', 5, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Hits', 'la_Text_Link_Search', 'la_Link_Hits', 'checkbox', '', '', 6, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedRating', 'la_Text_Link_Search', 'la_Link_CatchedRating', 'checkbox', '', '', 7, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedVotesQty', 'la_Text_Link_Search', 'la_Link_CatchedVotesQty', 'checkbox', '', '', 8, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedReviewsQty', 'la_Text_Link_Search', 'la_Link_CatchedReviewsQty', 'checkbox', '', '', 9, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Value', 'la_Text_Links', 'la_prompt_DupReviews', 'text', '', '', 10.13, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Interval', 'la_Text_Links', 'la_prompt_DupReviews', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.13, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Value', 'la_Text_Links', 'la_prompt_DupRating', 'text', '', '', 10.14, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Interval', 'la_Text_Links', 'la_prompt_DupRating', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.14, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('l_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 30.01, 0, 0); -INSERT INTO ConfigurationAdmin VALUES ('l_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 30.02, 0, 0); - -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_links', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_links', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_links', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_links', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_links', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 0, 1); - -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Links', '10', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortField', 'Name', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortOrder', 'asc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortField2', 'Description', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortOrder2', 'desc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_NewDays', '100', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_MinPopRating', '5', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_MaxHotNumber', '5', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_EnhancedLinks', '0', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_AllowFreeListings', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ShowPick', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_UrlStatus', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsSort', 'CreatedOn', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsOrder', 'desc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsSort2', 'ReviewText', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsOrder2', 'asc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_MinPopVotes', '20', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_LinkId', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Name', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Description', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Url', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CreatedOn', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Hits', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CatchedRating', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CatchedVotesQty', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CatchedReviewsQty', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_ReviewById', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Priority', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Status', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_EditorsPick', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_ResourceId', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_HotItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_PopItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_NewItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_ReviewDelay_Value', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_ReviewDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_RatingDelay_Value', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_RatingDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_Root', '{LinkCatId}', 'In-Portal', '') -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Links_Short', '3', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_Highlight_OpenTag', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_Highlight_CloseTag', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LinkReviews_Short', '3', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LinkReviews', '10', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'l_CategoryTemplate', 'inlink/index', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (NULL, 'l_ItemTemplate', 'inlink/detail', 'In-Link', 'in-link:configuration_output'); - -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Keyword_links', '90', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Pop_links', '5', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Rating_links', '5', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Increase_links', '30', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_ShowMultiple_links', '0', 'In-Link', 'in-link:configuration_search'); - -INSERT INTO ConfigurationValues VALUES (NULL, 'StartValidationTime', '0', 'In-Link', ''); -INSERT INTO ConfigurationValues VALUES (NULL, 'LastExpirationTime', '0', 'In-Link', ''); -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_RatingToPop', '5', 'In-Link', 'in-link:configuration_output'); - -INSERT INTO Events VALUES (7, 'LINK.ADD', 2, 0, 'In-Link', 'la_event_link.add', 1) -INSERT INTO Events VALUES (8, 'LINK.MODIFY', 2, 0, 'In-Link', 'la_event_link.modify', 1) -INSERT INTO Events VALUES (9, 'LINK.REVIEW.ADD', 2, 0, 'In-Link', 'la_event_link.review.add', 1) -INSERT INTO Events VALUES (10, 'LINK.ADD', 1, 0, 'In-Link', 'la_event_link.add', 0) -INSERT INTO Events VALUES (11, 'LINK.APPROVE', 1, 0, 'In-Link', 'la_event_link.approve', 0) -INSERT INTO Events VALUES (12, 'LINK.DENY', 1, 0, 'In-Link', 'la_event_link.deny', 0) -INSERT INTO Events VALUES (13, 'LINK.MODIFY', 1, 0, 'In-Link', 'la_event_link.modify', 0) -INSERT INTO Events VALUES (14, 'LINK.MODIFY.APPROVE', 1, 0, 'In-Link', 'la_event_link.modify.approve', 0) -INSERT INTO Events VALUES (15, 'LINK.REVIEW.ADD', 1, 0, 'In-Link', 'la_event_link.review.add', 0) -INSERT INTO Events VALUES (16, 'LINK.REVIEW.APPROVE', 1, 0, 'In-Link', 'la_event_link.review.approve', 0) -INSERT INTO Events VALUES (17, 'LINK.REVIEW.DENY', 1, 0, 'In-Link', 'la_event_link.review.deny', 0) -INSERT INTO Events VALUES (40, 'LINK.ADD.PENDING', 1, 0, 'In-Link', 'la_event_link.add.pending', 0) -INSERT INTO Events VALUES (42, 'LINK.MODIFY.PENDING', 1, 0, 'In-Link', 'la_event_link.modify.pending', 0) -INSERT INTO Events VALUES (43, 'LINK.REVIEW.ADD.PENDING', 1, 0, 'In-Link', 'la_event_link.review.add.pending', 0) -INSERT INTO Events VALUES (46, 'LINK.MODIFY.DENY', 1, 0, 'In-Link', 'la_event_link.modify.deny', 0) -INSERT INTO Events VALUES ('', 'LINK.ENHANCE', '1', '0', 'In-Link', 'la_event_link.link.enhance', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE', '1', '0', 'In-Link', 'la_event_link.link.enhance', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.APPROVE', '0', '0', 'In-Link', 'la_event_link.link.enhance.approve', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.APPROVE', '1', '0', 'In-Link', 'la_event_link.link.enhance.approve', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.DENY', '0', '0', 'In-Link', 'la_event_link.link.enhance.deny', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.DENY', '1', '0', 'In-Link', 'la_event_link.link.enhance.deny', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXPIRE', '1', '0', 'In-Link', 'la_event_link.link.enhance.expire', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXPIRE', '1', '0', 'In-Link', 'la_event_link.link.enhance.expire', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXTEND', '1', '0', 'In-Link', 'la_event_link.link.enhance.extend', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXTEND', '1', '0', 'In-Link', 'la_event_link.link.enhance.extend', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW', '0', '0', 'In-Link', 'la_event_link.link.enhance.renew', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW.FAILED', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_failed', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW.FAILED', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_failed', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.CANCEL', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_cancel', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.CANCEL', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_cancel', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEWAL.NOTICE', '1', '0', 'In-Link', 'la_event_link.link.enhance.renewal_notice', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEWAL.NOTICE', '1', '0', 'In-Link', 'la_event_link.link.enhance.renewal_notice', '0') - -INSERT INTO ItemTypes VALUES (4, 'In-Link', 'l', 'Link', 'Name', 'CreatedById', 'Hits', 'CachedRating', 'la_ItemTab_Links', 1, 'in-link/admin/addlink.php', 'clsLink', 'Link'); - -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.ADD', 'lu_PermName_Link.Add_desc', 'lu_PermName_Link.Add_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.VIEW', 'lu_PermName_Link.View_desc', 'lu_PermName_Link.View_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.ADD.PENDING', 'lu_PermName_Link.Add.Pending_desc', 'lu_PermName_Link.Add.Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.MODIFY', 'lu_PermName_Link.Modify_desc', 'lu_PermName_Link.Modify_desc', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.DELETE', 'lu_PermName_Link.Delete_desc', 'lu_PermName_Link.Delete_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.RATE', 'lu_PermName_Link.Rate_desc', 'lu_PermName_Link.Rate_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.REVIEW', 'lu_PermName_Link.Review_desc', 'lu_PermName_Link.Review_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.REVIEW.PENDING', 'lu_PermName_Link.Review_Pending_desc', ' lu_PermName_Link.Review_Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.MODIFY.PENDING', 'lu_PermName_Link.Modify.Pending_desc', 'lu_PermName_Link.Modify.Pending_desc', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.MODIFY', 'lu_PermName_Link.Owner.Modify_desc', 'lu_PermName_Link.Owner.Modify_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.MODIFY.PENDING', 'lu_PermName_Link.Owner.Modify.Pending_desc', 'lu_PermName_Link.Owner.Modify.Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.DELETE', 'lu_PermName_Link.Owner.Delete_desc', 'lu_PermName_Link.Owner.Delete_error', 'In-Link'); - -INSERT INTO SearchConfig VALUES ('Link', 'OrgId', 0, 0, 'lu_fielddesc_link_orgid', 'lu_field_orgid', 'In-Link', 'la_text_link', 19, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'NewItem', 0, 1, 'lu_fielddesc_link_newitem', 'lu_field_newitem', 'In-Link', 'la_text_link', 18, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'PopItem', 0, 1, 'lu_fielddesc_link_popitem', 'lu_field_popitem', 'In-Link', 'la_text_link', 17, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'HotItem', 0, 1, 'lu_fielddesc_link_hotitem', 'lu_field_hotitem', 'In-Link', 'la_text_link', 16, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'ResourceId', 0, 1, 'lu_fielddesc_link_resourceid', 'lu_field_resourceid', 'In-Link', 'la_text_link', 15, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'EditorsPick', 0, 1, 'lu_fielddesc_link_editorspick', 'lu_field_editorspick', 'In-Link', 'la_text_link', 14, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Status', 0, 0, 'lu_fielddesc_link_status', 'lu_field_status', 'In-Link', 'la_text_link', 13, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Priority', 0, 0, 'lu_fielddesc_link_priority', 'lu_field_priority', 'In-Link', 'la_text_link', 12, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'ModifiedById', 0, 0, 'lu_fielddesc_link_modifiedbyid', 'lu_field_modifiedbyid', 'In-Link', 'la_text_link', 11, 0, 0, 'text', 'PortalUser.Login', '{ForeignTable}.PortalUserId={LocalTable}.ModifiedById', NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CreatedById', 0, 0, 'lu_fielddesc_link_createdbyid', 'lu_field_createdbyid', 'In-Link', 'la_text_link', 10, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedReviewsQty', 0, 0, 'lu_fielddesc_link_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Link', 'la_text_link', 9, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedVotesQty', 0, 0, 'lu_fielddesc_link_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Link', 'la_text_link', 8, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'LinkId', 0, 1, 'lu_fielddesc_link_linkid', 'lu_field_linkid', 'In-Link', 'la_text_link', 0, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Name', 1, 1, 'lu_fielddesc_link_name', 'lu_field_name', 'In-Link', 'la_text_link', 1, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Description', 1, 1, 'lu_fielddesc_link_description', 'lu_field_description', 'In-Link', 'la_text_link', 2, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Url', 1, 1, 'lu_fielddesc_link_url', 'lu_field_url', 'In-Link', 'la_text_link', 3, 0, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CreatedOn', 0, 1, 'lu_fielddesc_link_createdon', 'lu_field_createdon', 'In-Link', 'la_text_link', 4, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Modified', 0, 1, 'lu_fielddesc_link_modified', 'lu_field_modified', 'In-Link', 'la_text_link', 5, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Hits', 0, 1, 'lu_fielddesc_link_hits', 'lu_field_hits', 'In-Link', 'la_text_link', 6, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedRating', 0, 0, 'lu_fielddesc_link_cachedrating', 'lu_field_cachedrating', 'In-Link', 'la_text_link', 7, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); - -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) as LinkCount FROM <%prefix%>Link WHERE Status=1', NULL, 'la_prompt_ActiveLinks', 0, 1); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS TotalLinks FROM <%prefix%>Link', NULL, 'la_prompt_TotalLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS ActiveLinks FROM <%prefix%>Link WHERE Status = 1', NULL, 'la_prompt_ActiveLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS PendingLinks FROM <%prefix%>Link WHERE Status = 2', NULL, 'la_prompt_PendingLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS DisabledLinks FROM <%prefix%>Link WHERE Status = 0', NULL, 'la_prompt_DisabledLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS NewLinks FROM <%prefix%>Link WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Link_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>Link WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS HotLinks FROM <%prefix%>Link WHERE (HotItem = 1) OR (Hits >= <%m:config name="Link_VotesToHot"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS PopularLinks FROM <%prefix%>Link WHERE (PopItem = 1) OR ( (CachedRating >= <%link:hit_count type="top"%>) AND <%link:hit_count type="top"%> AND (PopItem = 2) )', NULL, 'la_prompt_PopularLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Link WHERE CachedRating > 0', NULL, 'la_prompt_LinksAverageRating', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT MAX(Hits) AS MaxLinksHits FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksHits', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT MAX(CachedVotesQty) AS MaxLinksVotes FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksVotes', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_NewestLinkDate', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_LastLinkUpdate', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_LinkReviews', 0, 2); - -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 14, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 14, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD.PENDING', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.DELETE', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.DELETE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.MODIFY', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.DELETE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.DELETE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.DELETE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:inlink_general.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:inlink_general.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_output.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_output.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_search.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_search.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_email.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_email.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.advanced:approve', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.advanced:decline', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.delete', 11, 1, 1, 0); - -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('in-link', 'In-Link', 'inlink_import', 'Intechnic In-Link 2.x', 'In-Link', 'link_image,user_admin,user_regular,init_cat', 1,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Gossamer Threads Links 2.x', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Gossamer Threads Links 2.x SQL version', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Sentraweb Indexu 3.x', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Links from CSV file [In-Link]', '', '', 1, 'csv'); - -INSERT INTO CustomField (Type, FieldName, FieldLabel, Heading, Prompt, ElementType, ValueList, DisplayOrder, OnGeneralTab, IsSystem) VALUES (1, 'l_ItemTemplate', 'l_ItemTemplate', 'la_title_SystemCF', 'l_ItemTemplate', 'text', NULL, 0, 0, 1); - -INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('In-Link', 'in-link/', 'l', '3.2.1', 1, 1, 'inlink/', 2, '1054738405'); \ No newline at end of file Index: branches/unlabeled/unlabeled-1.31.2/in-link/frontaction.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.31.2/in-link/frontaction.php (revision 12746) +++ branches/unlabeled/unlabeled-1.31.2/in-link/frontaction.php (revision 0) @@ -1,631 +0,0 @@ -Get("PortalUserId"); - $link =& $objLinkList->GetItem($id); - $link->AddFavorite($userid); - $cat_id = $link->GetPrimaryCategory(); - UpdateCategoryCount("Link", $cat_id, $objLinkList->CacheListType("favorites")); - break; - - case "l_del_favorite": - $id = $l_var_list["id"]; - $userid = $objSession->Get("PortalUserId"); - $link =& $objLinkList->GetItem($id); - $link->DeleteFavorite($userid); - $cat_id = $link->GetPrimaryCategory(); - UpdateCategoryCount("Link", $cat_id, $objLinkList->CacheListType("favorites")); - break; - - case "l_add_review": - //phpinfo(INFO_VARIABLES); - $perm = 0; - $CategoryId=$objCatList->CurrentCategoryID(); - if ($objSession->HasCatPermission("LINK.REVIEW.PENDING")) - $perm = 2; - if ($objSession->HasCatPermission("LINK.REVIEW")) - $perm = 1; - //echo "Perm: $perm
    \n"; - if ($perm == 0) - { - $MissingCount++; - $FormError["l_addreview"]["review"] = language("lu_ferror_no_access"); - } - else - { - $id = $l_var_list["id"]; - $link =& $objLinkList->GetItem($id); - - $value = $objSession->InSpamControl($link->Get("ResourceId"),"Review"); - - //if($link->ReviewIPExists($_SERVER["REMOTE_ADDR"])) - if ($value) - { - $MissingCount++; - $FormError["l_addreview"]["review"] = language("lu_ferror_review_duplicate"); - } - else - { - $CreatedOn = adodb_date("U"); - $ReviewText = inp_striptags($_POST["review"]); - $id = $l_var_list["id"]; - $userid = $objSession->Get("PortalUserId"); - - $ValName = "link_ReviewDelay_Value"; - $IntName = "link_ReviewDelay_Interval"; - - $exp_secs = $objConfig->Get($ValName) * $objConfig->Get($IntName); - $objSession->AddToSpamControl($link->Get("ResourceId"),$exp_secs,"Review"); - - $link->AddReview($userid,$ReviewText,($perm==2),$_SERVER["REMOTE_ADDR"]); - if(strlen($_GET["Confirm"])) - { - $var_list["t"] = $_GET["Confirm"]; - } - else - $var_list["t"] = $_GET["DestTemplate"]; - } - } - break; - - case "l_rate_link": - //phpinfo(); - if ($objSession->HasCatPermission("LINK.RATE")) - $perm = 1; - if ($perm == 0) - { - $MissingCount++; - $FormError["l_rate"]["review"] = language("lu_ferror_no_access"); - } - else - { - $MissingCount = SetMissingDataErrors("l_rate"); - $id = $l_var_list["id"]; - $link =& $objLinkList->GetItem($id); - - $value = $objSession->InSpamControl($link->Get("ResourceId"),"Rating"); - - if($value) - { - $MissingCount++; - $FormError["l_rate"]["review"] = language("lu_rating_alreadyvoted"); - if(strlen($_GET["Duplicate"])) - { - $var_list["t"] = $_GET["Duplicate"]; - } - else - $var_list["t"] = $_GET["DestTemplate"]; - - } - if($MissingCount==0) - { - $ValName = "link_RatingDelay_Value"; - $IntName = "link_RatingDelay_Interval"; - - $exp_secs = $objConfig->Get($ValName) * $objConfig->Get($IntName); - $objSession->AddToSpamControl($link->Get("ResourceId"),$exp_secs,"Rating"); - $vote = $_POST["rating"]; - $link->SubmitVote($vote,""); - if(strlen($_GET["Confirm"])) - { - $var_list["t"] = $_GET["Confirm"]; - } - else - $var_list["t"] = $_GET["DestTemplate"]; - } - } - break; - case "l_sort_links": - if(is_numeric($_POST["Perpage_Links"])) - { - $objSession->SetPersistantVariable("Perpage_Links",$_POST["Perpage_Links"]); - } - else - { - $objSession->SetPersistantVariable("Perpage_Links", $objConfig->Get("Perpage_Links")); - } - - if (strlen($_POST["Link_SortField"])) - { - $objSession->SetPersistantVariable("Link_SortField",$_POST["Link_SortField"]); - $objSession->SetPersistantVariable("Link_SortField2",""); - } - if (strlen($_POST["Link_SortOrder"])) - { - $objSession->SetPersistantVariable("Link_SortOrder",$_POST["Link_SortOrder"]); - $objSession->SetPersistantVariable("Link_SortOrder2",""); - } - - $l_var_list["p"] = 1; - $objLinkList->Page = 1; - - DeleteModuleTagCache('inlink'); - break; - - case "l_add_link_confirm": - if(GetVar('item_action')) { - $item_action = GetVar('item_action'); - if (is_array($item_action)) { - list($id, $label) = each($item_action); - - } - - if ( isset($item_action['enter']) || (isset($item_action['new']) && $_POST['new_suggest_cat']==0) ) { - // enter into selected category - if ($_POST['new_suggest_cat'] > 0) { - // deeplevel++ - $_POST['suggest_cat_id'] = $_POST['new_suggest_cat']; - } - else { - // deeplevel-- - $db =& GetADODBConnection(); - $_POST['suggest_cat_id'] = $db->GetOne('SELECT ParentId FROM '.$objCatList->SourceTable.' WHERE CategoryId='.$_POST['suggest_cat_id']); - } - - } - elseif ( isset($item_action['new']) ) { - // add selected category to suggested list - if ($_POST['new_suggest_cat'] != $objCatList->CurrentCategoryID()) { - $new_cat_id = $_POST['new_suggest_cat']; - $_POST['cat_ids'][$new_cat_id] = $new_cat_id; - } - } - elseif ($id) { - unset($_POST['cat_ids'][$id]); - } - break; - } - - $perm = 0; - $CategoryId = $objCatList->CurrentCategoryID(); - if ($objSession->HasCatPermission('LINK.ADD.PENDING')) { - $perm = 2; - } - - if ($objSession->HasCatPermission('LINK.ADD')) { - $perm = 1; - } - - if ($perm == 0) { - $MissingCount++; - $FormError["l_addlink"]["name"] = language("lu_ferror_no_access"); - } - else { - $CreatedOn = adodb_mktime(); - $name = inp_striptags($_POST["name"]); - $desc = inp_striptags($_POST["description"]); - $url = inp_striptags($_POST["url"]); - $MissingCount = SetMissingDataErrors("l_addlink"); - if (is_array($_FILES)) { - foreach ($_FILES as $field => $file) { - $allowed = true; - if (strlen($_POST["imagetypes"][$field])) { - $types = explode(",",strtolower($_POST["imagetypes"][$field])); - if (is_array($types)) { - if (count($types)>0) { - $path_parts = pathinfo($file["name"]); - $ext = $path_parts["extension"]; - $allowed = in_array($ext,$types); - if (!$allowed) { - $MissingCount++; - $FormError["l_addlink"][$field] = language("lu_ferror_wrongtype"); - } - } - } - } - - $maxsize = (int)$_POST["maxsize"][$field]; - if ($maxsize > 0 && $allowed && $file["size"] > $maxsize) { - $allowed = false; - $MissingCount++; - $FormError["l_addlink"][$field] = language("lu_ferror_toolarge"); - } - } - } - - if ($MissingCount == 0) { - $ExpireInterval = $objConfig->Get("link_Expire_Interval") * $objConfig->Get("link_Expire_Value"); - $Expire = $ExpireInterval > 0 && $perm == 1 ? $CreatedOn + $ExpireInterval : 0; - - $link = $objLinkList->Add_Link( $CategoryId,$name,$desc, $url, $CreatedOn, $Expire, $perm, - 0,2,2,2,$objSession->Get("PortalUserId"),0,0,0); - - $LinkResourceId = $link->Get("ResourceId"); - $objCustomFields = new clsCustomFieldList(1); - $field_list = $objCustomFields->Query_CustomField("Type=".$link->type); - for ($i = 0; $i < $objCustomFields->NumItems(); $i++) { - $field = & $objCustomFields->GetItemRefByIndex($i); - $fieldid= $field->Get("CustomFieldId"); - $fname = $field->Get("FieldName"); - if(isset($_POST[$fname])) - $objCustomDataList->SetFieldValue($fieldid,$LinkResourceId,$_POST[$fname]); - elseif(isset($_POST[strtolower($fname)])) - $objCustomDataList->SetFieldValue($fieldid,$LinkResourceId,$_POST[strtolower($fname)]); - } - - $objCustomDataList->SaveData(); - $link->AddToCategory($CategoryId); - - // suggest to multiple cats: begin - if (getArrayValue($_POST,'cat_ids')) { - foreach ($_POST['cat_ids'] as $suggest_cat_id) { - $link->AddToCategory($suggest_cat_id); - } - } - // suggest to multiple cats: end - - if (!GetVar('cat_ids')) { - SetVar('cat_ids', Array($CategoryId) ); - } - else { - SetVar('cat_ids', array_merge(Array($CategoryId), GetVar('cat_ids')) ); - } - - UpdateCategoryCount("Link",$_POST['cat_ids'],'_'); - UpdateCategoryCount("Link",$_POST['cat_ids'],$objLinkList->CacheListType("myitems")); - - /* handle any image uploads */ - if (is_array($_FILES)) { - foreach ($_FILES as $field => $file) { - if ($file["size"] > 0) { - $imgname = $_POST["imagename"][$field]; - $thumb = $_POST["isthumb"][$field]; - $IsDefault = (int)$_POST["imgdefault"][$field]; - if ($thumb) { - $LocalThumb=1; - } - else { - $LocalImage=1; - } - $img = $objImageList->GetImageByName($LinkResourceId,$imgname); - if (!is_object($img)) { - $img =& $objImageList->Add($imgname, "", $LinkResourceId, - $LocalImage, $LocalThumb, - "", "", 1, 0, $IsDefault, 0,0); - } - if ($thumb) { - $img->Set("LocalThumb",1); - $url = $img->StoreUploadedImage($file, 1,"kernel/images/",$thumb); - $img->Set("ThumbPath",$url); - } - else { - $img->Set("LocalImage",1); - $url = $img->StoreUploadedImage($file, 1,"kernel/images/",$thumb); - $img->Set("LocalPath",$url); - } - $img->Update(); - } - } - } - - $var_list["t"] = $_GET[ strlen($_GET["Confirm"]) ? 'Confirm' : 'DestTemplate']; - - if( GetVar('listing_type') ) - { - $application =& kApplication::Instance(); - $application->SetVar('success_template', $var_list['t']); - - $link_fields = Array( $link->UniqueId() => Array('ListingTypeId' => GetVar('listing_type') ) ); - $application->SetVar('l', $link_fields); - $enhancement_event = new kEvent('ls:OnRequestEnhancement'); - $application->HandleEvent($enhancement_event); - if (($enhancement_event->status == erSUCCESS) && strlen($enhancement_event->redirect) ) { - $application->Redirect($enhancement_event->redirect, Array('DestTemplate' => $_GET['DestTemplate']) ); - } - } - - - } - } - break; - - case "l_edit_link": - $perm = 0; - $CategoryId=$objCatList->CurrentCategoryID(); - $OrgLink = $objLinkList->GetItem($l_var_list["id"]); - $PermCat = $OrgLink->GetPrimaryCategory(); - if ($objSession->HasCatPermission("LINK.MODIFY.PENDING",$PermCat)) - $perm = 2; - if ($objSession->HasCatPermission("LINK.MODIFY",$PermCat)) - $perm = 1; - - if($objSession->Get("PortalUserId")==$OrgLink->Get("CreatedById") && $perm != 1) - { - if ($objSession->HasCatPermission("LINK.OWNER.MODIFY.PENDING",$PermCat)) - $perm = 2; - if ($objSession->HasCatPermission("LINK.OWNER.MODIFY",$PermCat)) - $perm = 1; - } - - $link = $OrgLink; - if($perm == 2 && !$link->Get('OrgId')) - { - $CatList = $link->CategoryMemberList(); - $PrimaryCat = $link->GetPrimaryCategory(); - $link->Dirty(); - $link->Set("OrgId",$OrgLink->Get("LinkId")); - $link->UnsetIdField(); - //$link->Set("ResourceId",0); - $link->Set("Status",-2); - //$link->Create(); - //echo "ok"; - $link->CopyToNewResource($PrimaryCat); - //$objCustomFields = new clsCustomFieldList(1); - //$objCustomFields->CopyResource($OrgLink->Get("ResourceId"),$link->Get("ResourceId")); - //unset($objCustomFields); - $link->AddToCategory($PrimaryCat,"",1); - for($x=0;$xAddToCategory($CatList[$x]); - } - } - } - //echo "perm: $perm"; - if ($perm == 0) - { - $MissingCount++; - $FormError["editlink"]["name"] = language("lu_ferror_no_access"); - } - else - { - $name = $_POST["name"]; - $desc = $_POST["description"]; - $url = $_POST["url"]; - $MissingCount = SetMissingDataErrors("editlink"); - if(is_array($_FILES)) - { - foreach($_FILES as $field => $file) - { - $allowed = TRUE; - if(strlen($_POST["imagetypes"][$field])) - { - $types = explode(",",strtolower($_POST["imagetypes"][$field])); - if(is_array($types)) - { - if(count($types)>0) - { - $path_parts = pathinfo($file["name"]); - $ext = $path_parts["extension"]; - $allowed = in_array($ext,$types); - if(!$allowed) - { - $MissingCount++; - $FormError["editlink"][$field] = language("lu_ferror_wrongtype"); - } - } - } - } - $maxsize = (int)$_POST["maxsize"][$field]; - if($maxsize>0 && $allowed && $file["size"]>$maxsize) - { - $allowed = FALSE; - $MissingCount++; - $FormError["editlink"][$field] = language("lu_ferror_toolarge"); - } - } - } - if($MissingCount==0) - { - $link->Set("Name",$name); - $link->Set("Url",$url); - $link->Set("Description",$desc); - $ExpireInterval = $objConfig->Get("link_ExpireMod_Value") * $objConfig->Get("link_ExpireMod_Interval"); - if($ExpireInterval>0) - $link->Set("Expire",adodb_date("U")+$ExpireInterval); - $link->Update(); - if($perm==1) - { - $link->SendUserEventMail("LINK.MODIFY",$link->Get("ModifiedById")); - $link->SendAdminEventMail("LINK.MODIFY"); - } - else - { - $link->SendUserEventMail("LINK.MODIFY.PENDING",$link->Get("ModifiedById")); - $link->SendAdminEventMail("LINK.MODIFY.PENDING"); - } - $LinkResourceId= $link->Get("ResourceId"); - $objCustomFields = new clsCustomFieldList(1); - $field_list = $objCustomFields->Query_CustomField("Type=".$link->type); - $objCustomDataList->LoadResource($LinkResourceId); - - for($i=0;$i<$objCustomFields->NumItems(); $i++) - { - $field = & $objCustomFields->GetItemRefByIndex($i); - $fieldid= $field->Get("CustomFieldId"); - $fname = $field->Get("FieldName"); - if(isset($_POST[$fname])) - $objCustomDataList->SetFieldValue($fieldid,$LinkResourceId,$_POST[$fname]); - elseif(isset($_POST[strtolower($fname)])) - $objCustomDataList->SetFieldValue($fieldid,$LinkResourceId,$_POST[strtolower($fname)]); - } - $objCustomDataList->SaveData(); - //if($perm==2) - //$link->AddToCategory($CategoryId); - /* handle any image uploads */ - if(is_array($_FILES)) - { - foreach($_FILES as $field => $file) - { - if($file["size"]>0) - { - $imgname = $_POST["imagename"][$field]; - $thumb = $_POST["isthumb"][$field]; - $IsDefault = (int)$_POST["imgdefault"][$field]; - if($thumb) - { - $LocalThumb=1; - } - else - $LocalImage=1; - $img = $objImageList->GetImageByName($LinkResourceId,$imgname); - if(!is_object($img)) - { - $img =& $objImageList->Add($imgname, "", $LinkResourceId, - $LocalImage, $LocalThumb, - "", "", 1, 0, $IsDefault, 0,0); - } - if($thumb) - { - $img->Set("LocalThumb",1); - $url = $img->StoreUploadedImage($file, 1,"kernel/images/",$thumb); - $img->Set("ThumbPath",$url); - } - else - { - $img->Set("LocalImage",1); - $url = $img->StoreUploadedImage($file, 1,"kernel/images/",$thumb); - $img->Set("LocalPath",$url); - } - $img->Update(); - } - } - } - - $application->SetVar('l_id', ''); - if(strlen($_GET["Confirm"])) - { - $var_list["t"] = $_GET["Confirm"]; - } - else { - $var_list["t"] = $_GET["DestTemplate"]; - } - } - } - break; - case "l_delete_link": - $link = $objLinkList->GetItem($l_var_list["id"]); - $catid = $link->GetPrimaryCategory(); - if($objSession->HasCatPermission("LINK.DELETE",$catid) || - ($objSession->Get("PortalUserId")==$link->Get("CreatedById") && $objSession->HasCatPermission("LINK.OWNER.DELETE",$catid))) - { - $link->Delete(); - } - UpdateCategoryCount("Link", $catid, $objLinkList->GetListTypes()); - break; - case "m_simple_search": - $type = $objItemTypes->GetTypeByName("Link"); - $keywords = trim($_POST["keywords"]); - $length = $objConfig->Get('Search_MinKeyword_Length'); - - $isExact = (substr($keywords, 0, 2) == '\"' && substr($keywords, strlen($keywords) - 2, 2) == '\"'); - - if ($isExact) { - $performSearch = (strlen(trim(str_replace('\"', '', $keywords))) >= $length); - } - else { - $key_arr = explode(' ', $keywords); - - /*foreach($key_arr as $value) { - if (strlen($value) < $length) { - $keywords = str_replace(' '.$value, '', $keywords); - $keywords = str_replace($value.' ', '', $keywords); - } - }*/ - - //$keywords = str_replace(' ', ' ', $keywords); - - $performSearch = (strlen($keywords) >= $length); - } - - if ($performSearch) { - $objLinkSearch = new clsSearchResults("Link",$objLinkList->classname); - $objLinkSearch->SetKeywords($keywords); - $objLinkSearch->AddSimpleFields(); - - if(is_numeric($objConfig->Get("SearchRel_Pop_links"))) - $objLinkSearch->PctPop = ($objConfig->Get("SearchRel_Pop_links")/100); - if(is_numeric($objConfig->Get("SearchRel_Keyword_links"))) - $objLinkSearch->PctRelevance = ($objConfig->Get("SearchRel_Keyword_links")/100); - if(is_numeric($objConfig->Get("SearchRel_Rating_links"))) - $objLinkSearch->PctRating = ($objConfig->Get("SearchRel_Rating_links")/100); - - $objLinkSearch->PerformSearch($type->Get("ItemType"),$SortOrder,FALSE); - //$objLinkSearch->SetRelevence($type->Get("ItemType"), "LinkId"); - //echo "Finished Setting Link Relevence
    \n"; - } - break; - case "m_adv_search": - switch($_GET["type"]) - { - case 4: /* link */ - //echo "Searching Links
    "; - $objAdvSearch = new clsAdvancedSearchResults("Link",$objLinkList->classname, $_GET["type"]); - foreach($objSearchConfig->Items as $field) - { - $fld = $field->Get("FieldName"); - - $Verb = $_POST["verb"][$fld]; - if(!strlen($Verb) && $field->Get("FieldType")=="boolean") - { - if($_POST["value"][$field->Get("FieldName")]!=-1) - { - $Value = $_POST["value"][$fld]; - $Verb = "is"; - } - } - else - { - $Value = $_POST["value"][$fld]; - } - switch( $_POST["andor"][$fld]) - { - case 1: - $Conjuction = "AND"; - break; - case 2: - $Conjuction = "OR"; - break; - default: - $Conjuction = ""; - break; - } - - if (strlen($Value) && $Verb=="any") - { - $Verb = 'contains'; - } - - if(strlen($Value) && strlen($Verb)>0 && $Verb!="any") - { - //echo "Adding LINK SearchField: [".$field->Get("TableName")."]; [".$field->Get("FieldName")."]; [$Verb]; [$Value]; [$Conjuction]
    "; - $objAdvSearch->AddAdvancedField($field->Get("TableName"),$field->Get("FieldName"),$Verb,$Value,$Conjuction); - } - - } - $objAdvSearch->PerformSearch(4,NULL,TRUE); - break; - } - break; - case "m_simple_subsearch": - $keywords = $_POST["keywords"]; - $type = $objItemTypes->GetTypeByName("Link"); - - if(strlen($keywords)) - { - $objLinkSearch = new clsSearchResults("Link",$objLinkList->classname); - $objLinkSearch->SetKeywords($keywords); - $objLinkSearch->AddSimpleFields(); - //$SearchResultIdList = $objLinkSearch->Result_IdList(); - if(is_numeric($objConfig->Get("SearchRel_Pop_links"))) - $objLinkSearch->PctPop = ($objConfig->Get("SearchRel_Pop_links")/100); - if(is_numeric($objConfig->Get("SearchRel_Keyword_links"))) - $objLinkSearch->PctRelevance = ($objConfig->Get("SearchRel_Keyword_links")/100); - if(is_numeric($objConfig->Get("SearchRel_Rating_links"))) - $objLinkSearch->PctRating = ($objConfig->Get("SearchRel_Rating_links")/100); - - if(count($SearchResultIdList)>0) - { - $objLinkSearch->PerformSearch($type->Get("ItemType"),$SortOrder,FALSE,$SearchResultIdList); - //$objLinkSearch->SetRelevence($type->Get("ItemType"), "LinkId"); - } - } - break; - - - } -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.31.2/in-link/admin/install/inportal_data.sql =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.31.2/in-link/admin/install/inportal_data.sql (revision 12746) +++ branches/unlabeled/unlabeled-1.31.2/in-link/admin/install/inportal_data.sql (revision 0) @@ -1,234 +0,0 @@ -INSERT INTO ConfigurationAdmin VALUES ('Link_SortField', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,SELECT FieldLabel as OptionName, FieldName as OptionValue FROM CustomField WHERE Type=4', 0,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 1,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_SortField2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,SELECT FieldLabel as OptionName, FieldName as OptionValue FROM CustomField WHERE Type=4', 3,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 4,1) -INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links', 'la_Text_Links', 'la_link_perpage_prompt', 'text', '', '', 5,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_NewDays', 'la_Text_Links', 'la_link_newdays_prompt', 'text', '', '', 6,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_TopCount', 'la_Text_Links', 'la_link_newstopminrating_prompt', 'text', '', '', 7,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_VotesToHot', 'la_Text_Links', 'la_link_votestohot_prompt', 'text', '', '', 8,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_EnhancedLinks', 'la_Text_Links', 'la_link_EnhancedLinks', 'checkbox', '', '', 9, 1) -INSERT INTO ConfigurationAdmin VALUES ('Link_AllowFreeListings', 'la_Text_Links', 'la_link_AllowFreeListings', 'checkbox', '', '', 9, 1) -INSERT INTO ConfigurationAdmin VALUES ('Link_ShowPick', 'la_Text_Links', 'la_link_editorspick_prompt', 'checkbox', '', '', 10,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_UrlStatus', 'la_Text_Links', 'la_link_urlstatus_prompt', 'checkbox', '', '', 11,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'ReviewText=la_common_ReviewText,CreatedOn=la_common_CreatedOn', 11,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 11,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'ReviewText=la_common_ReviewText,date=la_common_CreatedOn', 12,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 13,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_MinVotes', 'la_Text_Links', 'la_link_MinVotes_prompt', 'text', '', '', 9,1) -INSERT INTO ConfigurationAdmin VALUES ('Perpage_LinkReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 5,1) -INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links_Short', 'la_Text_Links', 'la_link_perpage_short_prompt', 'text', '', '', 5,1) -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Name', 'la_Text_Link_Search', 'la_Link_Name', 'checkbox', '', '', 2,1) -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Description', 'la_Text_Link_Search', 'la_Link_Description', 'checkbox', '', '', 1,1) -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Url', 'la_Text_Link_Search', 'la_Link_Url', 'checkbox', '', '', 5,1) -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CreatedOn', 'la_Text_Link_Search', 'la_Link_CreatedOn', 'checkbox', '', '', 5,1) -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Hits', 'la_Text_Link_Search', 'la_Link_Hits', 'checkbox', '', '', 6,1) -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedRating', 'la_Text_Link_Search', 'la_Link_CatchedRating', 'checkbox', '', '', 7,1) -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedVotesQty', 'la_Text_Link_Search', 'la_Link_CatchedVotesQty', 'checkbox', '', '', 8,1) -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedReviewsQty', 'la_Text_Link_Search', 'la_Link_CatchedReviewsQty', 'checkbox', '', '', 9,1) -INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Value', 'la_Text_Links', 'la_prompt_DupReviews', 'text', '', '', 14,1) -INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Interval', 'la_Text_Links', 'la_prompt_DupReviews', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 15,1) -INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Value', 'la_Text_Links', 'la_prompt_DupRating', 'text', '', '', 16,1) -INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Interval', 'la_Text_Links', 'la_prompt_DupRating', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 17,1) -INSERT INTO ConfigurationAdmin VALUES ('l_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 1, 0); -INSERT INTO ConfigurationAdmin VALUES ('l_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 1, 0); - -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_links', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_links', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_links', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_links', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_links', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 1); - -INSERT INTO ConfigurationValues VALUES ('Perpage_Links', '10', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_SortField', 'Name', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_SortOrder', 'asc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_SortField2', 'Description', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_SortOrder2', 'desc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_NewDays', '100', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_TopCount', '5', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_VotesToHot', '5', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_EnhancedLinks', '0', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_AllowFreeListings', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_ShowPick', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_UrlStatus', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_ReviewsSort', 'CreatedOn', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_ReviewsOrder', 'desc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_ReviewsSort2', 'ReviewText', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_ReviewsOrder2', 'asc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_MinVotes', '20', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Search_Link_LinkId', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES ('Search_Link_Name', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES ('Search_Link_Description', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES ('Search_Link_Url', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES ('Search_Link_CreatedOn', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES ('Search_Link_Hits', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES ('Search_Link_CatchedRating', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES ('Search_Link_CatchedVotesQty', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES ('Search_Link_CatchedReviewsQty', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES ('Search_Link_ReviewById', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES ('Search_Link_Priority', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES ('Search_Link_Status', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES ('Search_Link_EditorsPick', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES ('Search_Link_ResourceId', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES ('Search_Link_HotItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES ('Search_Link_PopItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES ('Search_Link_NewItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES ('link_ReviewDelay_Value', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('link_ReviewDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('link_RatingDelay_Value', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('link_RatingDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_Root', '{LinkCatId}', 'In-Portal', '') -INSERT INTO ConfigurationValues VALUES ('Perpage_Links_Short', '3', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_Highlight_OpenTag', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Link_Highlight_CloseTag', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Perpage_LinkReviews_Short', '3', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('Perpage_LinkReviews', '10', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES ('l_CategoryTemplate', 'inlink/index', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES ('l_ItemTemplate', 'inlink/detail', 'In-Link', 'in-link:configuration_output'); - -INSERT INTO ConfigurationValues VALUES ('SearchRel_Keyword_links', '90', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES ('SearchRel_Pop_links', '5', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES ('SearchRel_Rating_links', '5', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES ('SearchRel_Increase_links', '30', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES ('Search_ShowMultiple_links', '0', 'In-Link', 'in-link:configuration_search'); - -INSERT INTO ConfigurationValues VALUES ('StartValidationTime', '0', 'In-Link', ''); -INSERT INTO ConfigurationValues VALUES ('LastExpirationTime', '0', 'In-Link', ''); -INSERT INTO ConfigurationValues VALUES ('Link_RatingToPop', '5', 'In-Link', 'in-link:configuration_output'); - -INSERT INTO Events VALUES (7, 'LINK.ADD', 2, 0, 'In-Link', 'la_event_link.add', 1) -INSERT INTO Events VALUES (8, 'LINK.MODIFY', 2, 0, 'In-Link', 'la_event_link.modify', 1) -INSERT INTO Events VALUES (9, 'LINK.REVIEW.ADD', 2, 0, 'In-Link', 'la_event_link.review.add', 1) -INSERT INTO Events VALUES (10, 'LINK.ADD', 1, 0, 'In-Link', 'la_event_link.add', 0) -INSERT INTO Events VALUES (11, 'LINK.APPROVE', 1, 0, 'In-Link', 'la_event_link.approve', 0) -INSERT INTO Events VALUES (12, 'LINK.DENY', 1, 0, 'In-Link', 'la_event_link.deny', 0) -INSERT INTO Events VALUES (13, 'LINK.MODIFY', 1, 0, 'In-Link', 'la_event_link.modify', 0) -INSERT INTO Events VALUES (14, 'LINK.MODIFY.APPROVE', 1, 0, 'In-Link', 'la_event_link.modify.approve', 0) -INSERT INTO Events VALUES (15, 'LINK.REVIEW.ADD', 1, 0, 'In-Link', 'la_event_link.review.add', 0) -INSERT INTO Events VALUES (16, 'LINK.REVIEW.APPROVE', 1, 0, 'In-Link', 'la_event_link.review.approve', 0) -INSERT INTO Events VALUES (17, 'LINK.REVIEW.DENY', 1, 0, 'In-Link', 'la_event_link.review.deny', 0) -INSERT INTO Events VALUES (40, 'LINK.ADD.PENDING', 1, 0, 'In-Link', 'la_event_link.add.pending', 0) -INSERT INTO Events VALUES (42, 'LINK.MODIFY.PENDING', 1, 0, 'In-Link', 'la_event_link.modify.pending', 0) -INSERT INTO Events VALUES (43, 'LINK.REVIEW.ADD.PENDING', 1, 0, 'In-Link', 'la_event_link.review.add.pending', 0) -INSERT INTO Events VALUES (46, 'LINK.MODIFY.DENY', 1, 0, 'In-Link', 'la_event_link.modify.deny', 0) -INSERT INTO Events VALUES ('', 'LINK.ENHANCE', '1', '0', 'In-Link', 'la_event_link.link.enhance', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE', '1', '0', 'In-Link', 'la_event_link.link.enhance', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.APPROVE', '0', '0', 'In-Link', 'la_event_link.link.enhance.approve', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.APPROVE', '1', '0', 'In-Link', 'la_event_link.link.enhance.approve', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.DENY', '0', '0', 'In-Link', 'la_event_link.link.enhance.deny', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.DENY', '1', '0', 'In-Link', 'la_event_link.link.enhance.deny', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXPIRE', '1', '0', 'In-Link', 'la_event_link.link.enhance.expire', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXPIRE', '1', '0', 'In-Link', 'la_event_link.link.enhance.expire', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXTEND', '1', '0', 'In-Link', 'la_event_link.link.enhance.extend', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXTEND', '1', '0', 'In-Link', 'la_event_link.link.enhance.extend', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW', '0', '0', 'In-Link', 'la_event_link.link.enhance.renew', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW.FAILED', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_failed', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW.FAILED', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_failed', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.CANCEL', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_cancel', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.CANCEL', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_cancel', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEWAL.NOTICE', '1', '0', 'In-Link', 'la_event_link.link.enhance.renewal_notice', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEWAL.NOTICE', '1', '0', 'In-Link', 'la_event_link.link.enhance.renewal_notice', '0') - - -INSERT INTO ItemTypes VALUES (4, 'In-Link', 'l', 'Link', 'Name', 'CreatedById', 'Hits', 'CachedRating', 'la_ItemTab_Links', 1, 'in-link/admin/addlink.php', 'clsLink', 'Link'); - -INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('In-Link', 'in-link/', 'l', '3.1.7', 1, 1, 'inlink/', 2, '1054738405'); - -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.ADD', 'lu_PermName_Link.Add_desc', 'lu_PermName_Link.Add_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.VIEW', 'lu_PermName_Link.View_desc', 'lu_PermName_Link.View_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.ADD.PENDING', 'lu_PermName_Link.Add.Pending_desc', 'lu_PermName_Link.Add.Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.MODIFY', 'lu_PermName_Link.Modify_desc', 'lu_PermName_Link.Modify_desc', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.DELETE', 'lu_PermName_Link.Delete_desc', 'lu_PermName_Link.Delete_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.RATE', 'lu_PermName_Link.Rate_desc', 'lu_PermName_Link.Rate_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.REVIEW', 'lu_PermName_Link.Review_desc', 'lu_PermName_Link.Review_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.REVIEW.PENDING', 'lu_PermName_Link.Review_Pending_desc', ' lu_PermName_Link.Review_Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.MODIFY.PENDING', 'lu_PermName_Link.Modify.Pending_desc', 'lu_PermName_Link.Modify.Pending_desc', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.MODIFY', 'lu_PermName_Link.Owner.Modify_desc', 'lu_PermName_Link.Owner.Modify_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.MODIFY.PENDING', 'lu_PermName_Link.Owner.Modify.Pending_desc', 'lu_PermName_Link.Owner.Modify.Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.DELETE', 'lu_PermName_Link.Owner.Delete_desc', 'lu_PermName_Link.Owner.Delete_error', 'In-Link'); - -INSERT INTO SearchConfig VALUES ('Link', 'OrgId', 0, 0, 'lu_fielddesc_link_orgid', 'lu_field_orgid', 'In-Link', 'la_text_link', 19, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'NewItem', 0, 1, 'lu_fielddesc_link_newitem', 'lu_field_newitem', 'In-Link', 'la_text_link', 18, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'PopItem', 0, 1, 'lu_fielddesc_link_popitem', 'lu_field_popitem', 'In-Link', 'la_text_link', 17, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'HotItem', 0, 1, 'lu_fielddesc_link_hotitem', 'lu_field_hotitem', 'In-Link', 'la_text_link', 16, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'ResourceId', 0, 1, 'lu_fielddesc_link_resourceid', 'lu_field_resourceid', 'In-Link', 'la_text_link', 15, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'EditorsPick', 0, 1, 'lu_fielddesc_link_editorspick', 'lu_field_editorspick', 'In-Link', 'la_text_link', 14, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Status', 0, 0, 'lu_fielddesc_link_status', 'lu_field_status', 'In-Link', 'la_text_link', 13, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Priority', 0, 0, 'lu_fielddesc_link_priority', 'lu_field_priority', 'In-Link', 'la_text_link', 12, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'ModifiedById', 0, 0, 'lu_fielddesc_link_modifiedbyid', 'lu_field_modifiedbyid', 'In-Link', 'la_text_link', 11, 0, 0, 'text', 'PortalUser.Login', '{ForeignTable}.PortalUserId={LocalTable}.ModifiedById', NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CreatedById', 0, 0, 'lu_fielddesc_link_createdbyid', 'lu_field_createdbyid', 'In-Link', 'la_text_link', 10, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedReviewsQty', 0, 0, 'lu_fielddesc_link_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Link', 'la_text_link', 9, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedVotesQty', 0, 0, 'lu_fielddesc_link_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Link', 'la_text_link', 8, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'LinkId', 0, 1, 'lu_fielddesc_link_linkid', 'lu_field_linkid', 'In-Link', 'la_text_link', 0, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Name', 1, 1, 'lu_fielddesc_link_name', 'lu_field_name', 'In-Link', 'la_text_link', 1, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Description', 1, 1, 'lu_fielddesc_link_description', 'lu_field_description', 'In-Link', 'la_text_link', 2, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Url', 1, 1, 'lu_fielddesc_link_url', 'lu_field_url', 'In-Link', 'la_text_link', 3, 0, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CreatedOn', 0, 1, 'lu_fielddesc_link_createdon', 'lu_field_createdon', 'In-Link', 'la_text_link', 4, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Modified', 0, 1, 'lu_fielddesc_link_modified', 'lu_field_modified', 'In-Link', 'la_text_link', 5, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Hits', 0, 1, 'lu_fielddesc_link_hits', 'lu_field_hits', 'In-Link', 'la_text_link', 6, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedRating', 0, 0, 'lu_fielddesc_link_cachedrating', 'lu_field_cachedrating', 'In-Link', 'la_text_link', 7, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); - -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) as LinkCount FROM <%prefix%>Link WHERE Status=1', NULL, 'la_prompt_ActiveLinks', 0, 1); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS TotalLinks FROM <%prefix%>Link', NULL, 'la_prompt_TotalLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS ActiveLinks FROM <%prefix%>Link WHERE Status = 1', NULL, 'la_prompt_ActiveLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS PendingLinks FROM <%prefix%>Link WHERE Status = 2', NULL, 'la_prompt_PendingLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS DisabledLinks FROM <%prefix%>Link WHERE Status = 0', NULL, 'la_prompt_DisabledLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS NewLinks FROM <%prefix%>Link WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Link_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>Link WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS HotLinks FROM <%prefix%>Link WHERE (HotItem = 1) OR (Hits >= <%m:config name="Link_VotesToHot"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS PopularLinks FROM <%prefix%>Link WHERE (PopItem = 1) OR ( (CachedRating >= <%link:hit_count type="top"%>) AND <%link:hit_count type="top"%> AND (PopItem = 2) )', NULL, 'la_prompt_PopularLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Link WHERE CachedRating > 0', NULL, 'la_prompt_LinksAverageRating', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT MAX(Hits) AS MaxLinksHits FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksHits', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT MAX(CachedVotesQty) AS MaxLinksVotes FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksVotes', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_NewestLinkDate', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_LastLinkUpdate', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_LinkReviews', 0, 2); - -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 14, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 14, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD.PENDING', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.DELETE', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.DELETE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.MODIFY', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.DELETE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.DELETE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.DELETE', 15, 0, 0, 0); - -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('in-link', 'In-Link', 'inlink_import', 'Intechnic In-Link 2.x', 'In-Link', 'link_image,user_admin,user_regular,init_cat', 1,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Gossamer Threads Links 2.x', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Gossamer Threads Links 2.x SQL version', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Sentraweb Indexu 3.x', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Links from CSV file [In-Link]', '', '', 1, 'csv'); \ No newline at end of file Index: branches/unlabeled/unlabeled-1.31.2/in-link/admin/import/inlink_import.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.31.2/in-link/admin/import/inlink_import.php (revision 12746) +++ branches/unlabeled/unlabeled-1.31.2/in-link/admin/import/inlink_import.php (revision 0) @@ -1,920 +0,0 @@ -GetVariable('import_category_id'); - -if ( isset($_POST['Action']) && $_POST['Action'] == 'Import') -{ - $objSession->SetVariable('import_user_admin',$_POST['user_admin']); - $objSession->SetVariable('import_user_regular',$_POST['user_regular']); - $objSession->SetVariable('image_name',$_POST['link_image']); - - $objSession->SetVariable('importtodo','initialize'); - $objSession->SetVariable('importstart',0); - $objSession->SetVariable('importtotal',0); - - if((int)$_POST['init_cat'] > 0) - { - $c = $objCatList->GetItemByField('CategoryId', $root_cat_id); - $c->UpdateACL(); - $c->UpdateCachedPath(); - } - - -} -$allgroups = $objGroups->GetAllGroupList(); - -// connection related -$inlink_sql_type = $objSession->GetVariable('import_sql_type'); -$inlink_server = $objSession->GetVariable('import_server'); -$inlink_db = $objSession->GetVariable('import_db'); -$inlink_user = $objSession->GetVariable('import_user'); -$inlink_pass = $objSession->GetVariable('import_pass'); - -// import related -$user_admin = $objSession->GetVariable('user_admin_values'); -$user_regular = $objSession->GetVariable('user_regular_values'); - -if( !isset($c) || !is_object($c) && $root_cat_id ) -$c = $objCatList->GetItemByField('CategoryId', $root_cat_id); - -$image_name=$objSession->GetVariable('image_name'); -$start = $objSession->GetVariable('importstart'); - -$init_cat = $root_cat_id ? $c->Get('CategoryId') : 0; - -//In-Portal -$portalconn = &GetADODBConnection(); - -if( $init_cat == 0) -{ - /*$prefix = GetTablePrefix(); - $sql = 'SELECT ACL - FROM '.$prefix.'PermCache pc, '.$prefix.'Permissions p - WHERE p.PermissionId = pc.PermId AND p.CategoryId = 0 AND p.Permission = \'CATEGORY.VIEW\''; - $acl = $portalconn->GetCol($sql);*/ - $acl = Array(0 => 0); -} -else -{ - $acl = explode(',',$c->GetACL('CATEGORY.VIEW')); -} - -//IN-LINK connection -$linkconn = &ADONewConnection($inlink_sql_type); -$linkconn->NConnect($inlink_server, $inlink_user, $inlink_pass, $inlink_db); - -if(!$linkconn) -{ - $ret = "Database connection failed. DB Type: $sql_type, DB Server: $inlink_server, DB User: $inlink_user, DB Name: $inlink_db"; - $ret .= $linkconn->ErrorMsg(); - $application =& kApplication::Instance(); - $application->ApplicationDie($ret); -} - -//admin only util -$pathtolocal = $pathtoroot.'kernel/'; -require_once ($pathtoroot.'admin/include/elements.php'); -require_once ($pathtoroot.'kernel/admin/include/navmenu.php'); -require_once ($pathtolocal.'admin/include/navmenu.php'); -require_once($pathtoroot.'admin/toolbar.php'); -//Set Section -$section = 'in-portal:inlink_inport'; -//Set Environment Variable -$envar = 'env=' . BuildEnv(); - -$sec = $objSections->GetSection($section); -$objCatToolBar = new clsToolBar(); - -$title = admin_language('la_performing_import').' - '.admin_language('la_Step').' 4'; - - - -$TablePrefix = 'ses_'.$objSession->GetSessionKey().'_'.GetTablePrefix(); - -$olddbname=$inlink_db; -//$newdbname='inportal'; -$newdbname=$g_DBName; -##############creating a temproary table have to be here - -if( GetVar('Action', true) == 'Import' ) -{ - $portalconn->Execute('DROP TABLE IF EXISTS '.$TablePrefix.'import'); - $portalconn->Execute('DROP TABLE IF EXISTS '.$TablePrefix.'importcat'); - $temptable = 'CREATE TABLE '.$TablePrefix.'import (otname varchar(40), oid int(11), ocustomid int(11), oparentid int(11), ntname varchar(40), nid int(11), nrid int(11), npid int(11)) '; - - $portalconn->Execute($temptable); - $cattable ='CREATE TABLE '.$TablePrefix.'importcat (op int(11), np int(11), flag int(11)) '; - $portalconn->Execute($cattable); - $newcat = 1; -} - -global $admin, $pathtoroot; - -require_once ($pathtoroot.'in-link/'.$admin.'/import/status.php'); #for status bar and all visual effects - -$todo= $objSession->GetVariable('importtodo'); - -$total = $objSession->GetVariable('importtotal'); -switch ($todo) -{ - case 'users': - status($start, $total, 'users'); - usersimport(); - //setstart(0,'cats'); #for debugging - break; - case 'cats': - status($start, $total, 'cats'); - catmanager(); - //setstart(0,'links'); #for debugging - break; - case 'links': - status($start, $total, 'links'); - linksimport(); - //setstart(0,'custom');#For debugging only - break; - case 'custom': - status($start, $total, 'custom'); - - customimport(); - //setstart(0,'relcat');#for debuggin only - break; - - case 'relcat': - status($start, $total, 'relcat'); - relcatimport(); - //setstart(0,'terminate'); #for debuggin only - break; - case 'terminate': - terminator(); - status(1,1,'terminate'); - break; - default: - status(0,0,'initializing'); - setstart(0,'users'); #to start importing from users first - break; -} - -function terminator() -{ - global $portalconn, $TablePrefix, $adminURL, $objSession; - $query='DROP TABLE IF EXISTS '.$TablePrefix.'import, '.$TablePrefix.'importcat'; - $portalconn->Execute($query); - - $objSession->SetVariable('PermCache_UpdateRequired', 1); - $objSession->SetVariable('ReturnScript', 'index.php'); // redirect to catalog when finished - m_ParseEnv(); // sets default values to "m" prefix, because it is not passed through import anymore - - $application =& kApplication::Instance(); - $finish_url = $application->HREF('categories/cache_updater', '', Array('continue' => 1, 'no_amp' => 1), 'index.php'); - echo ''; -} - -function reload() -{ - //global $newurl; - print ''; -} -function setstart($mystart, $part) -{ - global $objSession; - - $objSession->SetVariable('importstart',$mystart); - $objSession->SetVariable('importtodo',$part); - reload(); -} -function settotal($total) -{ - global $objSession; - $objSession->SetVariable('importtotal',$total); -} - -//users import from inlink to inportal -function usersimport() -{ - global $objUsers, $objSession, $linkconn, $portalconn, $olddbname, - $user_admin,$objGroups, $user_regular, $start, $TablePrefix; - - $counter = 0; - $limit = 350; - $oldtablename = 'inl_users'; - $newtablename = $objUsers->SourceTable; - if ($start == 0) - { - $query='select count(*) as NumUsers from inl_users'; - $row =$linkconn->Execute($query); - if ($row && !$row->EOF) - { - settotal($row->fields['NumUsers']); - - } - } - $query="select * from inl_users LIMIT $start, $limit"; - $row =$linkconn->Execute($query); - while($row && !$row->EOF) - { - $counter++; #needed to know when close to time out - - if ($row->fields['user_name'] != 'root') { - $olduserid=$row->fields['user_id']; - //$Login, $Password, $Email, $CreatedOn, $FirstName='', $LastName='', $Status=2, - // $Phone='', $Street='', $City='', $State='', $Zip='', $Country='' - - if($row->fields['user_status']==1) - { - $Status=1; - } - else - { - if($row->fields['user_pend']==0) - { - $Status=2; - } - else - $Status=0; - } - $u = $objUsers->Add_User( $row->fields['user_name'], $row->fields['user_pass'], $row->fields['email'], - $row->fields['user_date'], $row->fields['first'], $row->fields['last'], - $Status); - $oldid=$row->fields['user_id']; - $oldcustom = $row->fields['user_cust']; - $newid = $u->Get('PortalUserId'); - $resid = $u->Get('ResourceId'); - #adding user to usergroup - - $userpermission = $row->fields['user_perm']; - if ($userpermission==2 || $userpermission==1) - { - $glist = explode(',',$user_admin); - $Primary=1; - for($i=0;$iGetItem($glist[$i]); - $group->AddUser($newid,$Primary,false); - $Primary = 0; - } - } - else - { - $glist = explode(',',$user_regular); - $Primary=1; - for($i=0;$iGetItem($glist[$i]); - $group->AddUser($newid,$Primary,false); - $Primary = 0; - } - } - //$group=$objGroups->GetItem($g); - //$group->AddUser($newid,1); - - #inserting values to the temproary table - $totemp = 'INSERT INTO '.$TablePrefix.'import (otname,oid,ocustomid,oparentid,ntname,nid,nrid,npid) '; - $tovalues= " VALUES ('$oldtablename',$olduserid,$oldcustom,0,'$newtablename', $newid, $resid, 0 )"; - $totemp=$totemp.$tovalues; - $portalconn->Execute($totemp); - } - $row->moveNext(); - } - if ($counter == $limit) - { - setstart($start+$limit, 'users'); - } - else - setstart(0,'cats'); - -} -//END OF USERS IMPORT ^^^^^^^^^^^^^^^^^^^^^ - -//Categories Import -function catmanager() -{ - global $portalconn, $init_cat,$start,$TablePrefix; - if ($start == 0) - { - $counter = catimport(0,$init_cat); - setstart($counter,'cats'); - $portalconn->Execute('UPDATE '.$TablePrefix.'importcat SET flag = 1 WHERE np = '.$init_cat); - } - else - { - - $query='select * from '.$TablePrefix.'importcat WHERE flag=0 LIMIT 0,1'; - $row =$portalconn->Execute($query); - if($row && !$row->EOF) - { - $oldid= $row->fields['op']; - $newid = $row->fields['np']; - $counter= catimport($oldid,$newid); - $query2='UPDATE '.$TablePrefix.'importcat SET flag = 1 WHERE op = '.$oldid.' AND np = '.$newid; - $portalconn->Execute($query2); - setstart($counter+$start-1,'cats'); - //$x=5; - } - else - { - setstart(0,'links'); - } - } -} -#pushes into the quque -function pushid($op,$np) -{ - global $linkconn, $portalconn, $TablePrefix; - $addnew = 'INSERT INTO '.$TablePrefix.'importcat (op,np,flag) VALUES ('.$op.','.$np.',0)'; - $portalconn->Execute($addnew); - -} -function checkifexist($id) -{ - global $linkconn; - $addnew = 'select * from inl_cats where cat_sub = '.$id; - $row =$linkconn->Execute($addnew); - if ($row && !$row->EOF) - { - - if ($row->fields['cat_id'] !=0) - { - return true; - } - else - { - return false; - } - } - else - { - return false; - } -} -#import itself -function catimport($oldparentid, $parentid) -{ - global $objCatList, $linkconn, $objUsers, $linkconn, $portalconn, - $olddbname, $user_admin,$objGroups, $user_regular, $acl,$allgroups, - $c, $start, $TablePrefix, $init_cat; - $counter=0; - - $objCacheCount = new clsCacheCountList(); - if ($start == 0) - { - $query='select count(*) as CatCount from inl_cats'; - $row =$linkconn->Execute($query); - if ($row && !$row->EOF) - { - settotal($row->fields['CatCount']); - $catcount = $row->fields['CatCount']; - - if( is_object($c) ) - { - $catcount += (int)$c->Get('CachedDescendantCatsQty'); - $c->Set('CachedDescendantCatsQty',$catcount); - $c->Update(); - } - - - } - } - - $query='select * from inl_cats WHERE cat_sub = '.$oldparentid; - $oldtablename = 'inl_cats'; - $newtablename = 'Category'; - $row =$linkconn->Execute($query); - if($row && !$row->EOF) - { - $RowCount = $row->NumRows(); - $ResInc = $RowCount; - $ResourceId = GetNextResourceId($ResInc); - } - if($parentid>0) - { - $ParentCat = new clsCategory($parentid); - $Path = $ParentCat->Get('ParentPath'); - } - else - { - global $objConfig; - $Path = prompt_language( $objConfig->Get('Root_Name') ); - } - while($row && !$row->EOF) - { - $counter++; - - if($row->fields['cat_pend'] == 1) - { - $Status = 2; - } - else - { - $Status = ($row->fields['cat_vis'] == 1) ? 1 : 0; - } - - $CreatedById = GetNewID( 'users', $row->fields['cat_id'] ); - - - $fields_hash = Array( 'ParentId' => $parentid, - $objCatList->TitleField => $row->fields['cat_name'], - $objCatList->DescriptionField => $row->fields['cat_desc'], - 'CreatedOn' => $row->fields['cat_date'], - 'EditorsPick' => (int)$row->fields['cat_pick'], - 'Status' => $Status, - 'HotItem' => 2, - 'NewItem' => 2, - 'PopItem' => 2, - 'Priority' => 0, - 'MetaKeywords' => $row->fields['meta_keywords'], - 'MetaDescription' => $row->fields['meta_desc'], - 'AutomaticFilename' => 1, - 'Filename' => '', - 'CategoryTemplate' => '', - 'ItemTemplate' => '', - 'CreatedById' => (int)$CreatedById, - 'CachedDescendantCatsQty' => (int)$row->fields['cat_cats'], - 'ResourceId' => $ResourceId, - ); - - $cat =& $objCatList->Add_NEW($fields_hash, true); - $ResourceId++; - - $FullPath = $Path.$cat->Get('CategoryId').'|'; - $cat->Set('ParentPath',$FullPath); - $cat->SetViewPerms('CATEGORY.VIEW',$acl,$allgroups); - $cat->SetViewPerms('LINK.VIEW',$acl,$allgroups); - $cat->Update(); - $cat->UpdateCachedPath(); - - $objCacheCount->CategoryId= $cat->Get('CategoryId'); - $objCacheCount->SetValue(0,0,0,0,0); - - $newid = $cat->Get('CategoryId'); - $resid = $cat->Get('ResourceId'); - $oldid = $row->fields['cat_id']; - $oldcustom = $row->fields['cat_cust']; - $oldpid = $row->fields['cat_sub']; - - #inserting values to the temproary table - $totemp = 'INSERT INTO '.$TablePrefix.'import (otname,oid,ocustomid,oparentid,ntname,nid,nrid,npid) '; - $tovalues= " VALUES ('$oldtablename',$oldid,$oldcustom,$oldpid,'$newtablename', $newid, $resid, $parentid )"; - $totemp=$totemp.$tovalues; - $portalconn->Execute($totemp); - - #pushes into the queue - if(checkifexist($oldid)) - { - pushid($oldid,$newid); - } - $row->moveNext(); - } - // disable lost+found category (if found one) - $tmp_cat = $objCatList->GetItemByField('Name','Lost+Found'); - if( is_object($tmp_cat) ) - { - $tmp_cat->Set('Status',0); - $tmp_cat->Update(); - } - return $counter; -} - -//Links Import -function linksimport() -{ - global $objLinkList, $init_cat, $linkconn, $portalconn, $olddbname, - $user_admin,$objGroups, $user_regular, $start, $TablePrefix; - $limit = 200; #need to change to a higher number like 100, forty is only for debugging - $counter = 0; - set_time_limit(0); - if ($start == 0) - { - $query = 'select count(*) as LinkCount from inl_lc'; - $row =$linkconn->Execute($query); - if ($row && !$row->EOF) - { - settotal($row->fields['LinkCount']); - - } - } - - // create index - what links are in what categories - $LimitClause = ' LIMIT '.$start.','.$limit; - $sql = 'SELECT link_id FROM inl_links ORDER BY link_id'.$LimitClause; - $LinkIDs = $linkconn->GetCol($sql); - - if( count($LinkIDs) > 0 ) - { - $LinkCatIndex = Array(); - $PendingLinks = Array(); - $sql = "SELECT * FROM inl_lc WHERE link_id IN (%s)"; - - $rs = $linkconn->Execute( sprintf($sql, implode(',', $LinkIDs) ) ); - while(!$rs->EOF) - { - $rec =& $rs->fields; - if( !isset($PendingLinks[ $rec['link_id'] ]) && $rec['link_pend'] == 1 ) - $PendingLinks[ $rec['link_id'] ] = 1; - - $LinkCatIndex[ $rec['link_id'] ][] = $rec['cat_id']; - $rs->MoveNext(); - } - } - - // get links - $query = 'SELECT * FROM inl_links ORDER BY link_id'.$LimitClause; // get links info - $row = $linkconn->Execute($query); // row is recordset here, not easy to figure out by variable name :( - if($row && !$row->EOF) - { - $RowCount = $row->NumRows(); - $ResInc = $RowCount; - $ResourceId = GetNextResourceId($ResInc); - } - - $get_cat_sql = "SELECT nid FROM %simport WHERE ntname = 'Category' AND oid = %s"; - - while($row && !$row->EOF) - { - $counter++; - $oldid = $row->fields['link_id']; - $flag = 1; - - $Pending = isset($PendingLinks[$oldid]); - - // create new link - - #gets the new user id of the user who created a link - if( !$row->fields['link_user'] ) - $newuserid = -1; - else - $newuserid = GetNewID('users', $row->fields['link_user'] ); - - #adds link to the IN-PORTAL - $link = new clsLink(); - $Status = ($Pending == 0) ? 1 : 2; - - $link->Set( array( 'Name', 'Description', 'Url', 'CreatedOn', 'Status', 'EditorsPick', - 'NewItem','PopItem','HotItem', 'CreatedById', 'CachedRating', - 'CachedVotesQty','Hits', 'Priority','Expire'), - array( $row->fields['link_name'], $row->fields['link_desc'], $row->fields['link_url'], $row->fields['link_date'], $Status, - $row->fields['link_pick'], 2, 2, 2, $newuserid, (int)$row->fields['link_rating'], - (int)$row->fields['link_votes'],(int)$row->fields['link_hits'], 0,$row->fields['link_expires'])); - - $link->Set('ResourceId',$ResourceId); - $ResourceId++; - $link->Create(); - - // add link to desired categories (add 1st category found as primary) - $cats = $LinkCatIndex[$oldid]; - $PrimaryCat = 1; - foreach($cats as $OldCatID) - { - $categoryid = $portalconn->GetOne( sprintf($get_cat_sql, $TablePrefix, $OldCatID) ); - $link->AddToCategory($categoryid, '', $PrimaryCat); - if($PrimaryCat) - { - $PrimaryCat = 0; - $oldcatid = $OldCatID; - } - } - - $newid = $link->Get('LinkId'); - $resid = $link->Get('ResourceId'); - $oldcustom = $row->fields['link_cust']; - $linkimage = $row->fields['link_image']; - - if($linkimage) addimage($resid,$linkimage); - - #calls to import reviews - reviewimport($link,$oldid,$resid); - - $totemp = 'INSERT INTO '.$TablePrefix.'import (otname,oid,ocustomid,oparentid,ntname,nid,nrid,npid) '; - $tovalues= " VALUES ('inl_links',$oldid,$oldcustom,$oldcatid,'link', $newid, $resid, 0 )"; - $totemp = $totemp.$tovalues; - $portalconn->Execute($totemp); - - #prelast while - $row->moveNext(); - } - - if ($counter == $limit) - { - setstart($start + $limit, 'links'); - } - else - { - $sql = 'UPDATE '.GetTablePrefix().'CategoryItems SET CategoryId = '.$init_cat.' WHERE CategoryId = 0 AND PrimaryCat = 1'; - $portalconn->Execute($sql); - setstart(0,'custom'); - } - -} - -#importing image from the in-link -function addimage($resourceid, $imageurl) -{ - global $objImageList, $image_name; - #echo "
    IMAGE RESOURCEID: $resourceid IMAGE URL: $imageurl
    "; - if(!is_object($objImageList)) - $objImageList = new clsImageList(); - - $LocalImage = 0; - $LocalThumb = 0; - if(!strlen($image_name)) - $image_name='inlink_image'; - - $img = $objImageList->Add($image_name,'',$resourceid, 0, 0,'', $imageurl, 1,0, 1, 0,1); -} -#Reviews Import for links -function reviewimport($myclass,$oldid,$rid) -{ - global $objCustomFieldList, $linkconn, $portalconn; - #ITEM AddReview($createdBy,$reviewText,0) - - $query='select * from inl_reviews where rev_link = '.$oldid; - $row =$linkconn->Execute($query); - while($row && !$row->EOF) - { - $oldreviewuser= $row->fields['rev_user']; - if($oldreviewuser !=0) #meaning was not created by guest - { - $newrid = GetNewID('users', $oldreviewuser); - if ($newrid) - { - $temp=$myclass->AddReview($newrid, $row->fields['rev_text'], $row->fields['rev_pend'], '127.0.0.1', 1, 'In-Link', $row->fields['rev_date']); - } - else - { - $temp=$myclass->AddReview(0, $row->fields['rev_text'], $row->fields['rev_pend'], '127.0.0.1', 1, 'In-Link', $row->fields['rev_date']); - } - } - else #meaning was created by guest - { - $temp=$myclass->AddReview(0, $row->fields['rev_text'], $row->fields['rev_pend'], '127.0.0.1', 1, 'In-Link', $row->fields['rev_date']); - } - $row->moveNext(); - } -} -#HELPER FUNCTION THAT GETS THE NEW ID of the USER - -/** -* @return int -* @param string $IDType -* @param int $OldID -* @desc Returns new id for specified record type ($IDType) with id ($OldID) -*/ -function GetNewID($IDType, $OldID) -{ - global $TablePrefix; - $get_id_sql = "SELECT nid FROM %simport WHERE otname = 'inl_%s' AND oid = %s"; - $db =&GetADODBConnection(); - $id = $db->GetOne( sprintf($get_id_sql, $TablePrefix, $IDType, $OldID) ); - return $id; -} - -//^^^^^^^^^^^^^^^^^^^^^^ABOVE IS LINKS IMPORT - - -#########################################Custom Fields Import -#create a new CustomField first and then -#by selecting all and receiving from one record of inl_config the values of cc1,cc2,cc3,cc4,cc5,cc6,uc1,uc2,uc3,uc4,uc5,uc6,lc1,lc2,lc3,lc4,lc5,lc6 -#go through all import table and if ocustomid occures get the row from inl_custom and -#create CustomMetaData field -#--------------------- -#Regarding CustomField: -#FieldName= cc1,cc2 .... from inl_config -#FieldLabel= value of cc1, cc2 .... -#Type=4 for links 6 for users 0 category -#------------ -#Regarding CustomMetaData -#ResourceId <= link id -#CustomFieldId <= id from the top -#Value = Value from the table custom - -//VVVVV BELOW ARE CUSTOM FIELD IMPORT REQUIRES TO HAVE A TEMPROARY TABLE IMPORT -function customimport() -{ - global $linkconn, $portalconn, $start, $TablePrefix; - $limit = 40; #just for debugging purposes, in real life set it to higher number - - if ($start == 0) { - $r = buildfields(); - $query = 'SELECT count(*) as cc from '.$TablePrefix.'import WHERE NOT ocustomid=0'; - $row = $portalconn->Execute($query); - if ($row && !$row->EOF) settotal($row->fields['cc']); - } - else { - $r = getfields(); - } - - $query = 'SELECT * from '.$TablePrefix.'import WHERE ocustomid != 0 limit '.$start.','.$limit; - $row = $portalconn->Execute($query); - $counter = 0; - - while ($row && !$row->EOF) { - $counter++; - loadcustom($row->fields['ocustomid'],$row->fields['nrid'],$row->fields['otname'],$r); - $row->moveNext(); - } - - if ($counter == $limit) { - setstart($start + $limit, 'custom'); - } - else { - // goto next step - setstart(0, 'relcat'); - } -} - -function loadcustom($customid,$rid,$tablename,$r) -{ - global $linkconn, $objCustomDataList, $objSession; - - $objCustomDataList->Clear(); - switch ($tablename) { - case 'inl_cats': - $SessionVar = 'custom_category'; - $prefix = 'c'; - break; - - case 'inl_users': - $SessionVar = 'custom_user'; - $prefix = 'u'; - break; - - case 'inl_links': - $SessionVar = 'custom_links'; - $prefix = 'l'; - break; - } - $fields = explode(',', $objSession->GetVariable($SessionVar) ); - - $query = 'select * from inl_custom Where cust_id = '.$customid; - $row = $linkconn->Execute($query); - if($row && $row->RecordCount() ) - { - for($x = 0; $x < count($fields); $x++) - { - $cust = $row->fields[ 'cust'.($x + 1) ]; - $fieldid = $r[ $fields[$x] ]; - $objCustomDataList->SetFieldValue($fieldid, $rid, $cust); - } - $objCustomDataList->SaveData($prefix, $rid); - } -} - -function buildfields() #building and populating an array -{ - global $objCustomFieldList, $objSession, $linkconn; - - $application =& kApplication::Instance(); - $ml_helper =& $application->recallObject('kMultiLanguageHelper'); - - // User Custom Fields: - $query = "SELECT * FROM inl_config WHERE name LIKE 'uc%'"; - $row = $linkconn->Execute($query); - $names = Array(); - while($row && !$row->EOF) - { - $data = $row->fields; - $fieldlabel = $data['name']; - if( strlen($data['value']) ) $fieldlabel = $data['value']; - //$f = $objCustomFieldList->AddField(6, $data['name'], $fieldlabel); - $f = $objCustomFieldList->AddField(6, $data['name'], $fieldlabel, 1, 'la_inlink', 'lu_fieldcustom__'.$data['name'], 'text', ''); - - $r[ $data['name'] ] = $f->Get('CustomFieldId'); // Save ID of created CustomField - $objSession->SetVariable('custom_'.$data['name'], $f->Get('CustomFieldId') ); // Save that ID to session - $names[] = $data['name']; - $row->MoveNext(); - } - $objSession->SetVariable('custom_user',implode(',',$names) ); // save list of user custom fields - $ml_helper->createFields('u-cdata', true); - unset($names); - - // Category Custom Fields: - $names = Array(); - $query = "SELECT * FROM inl_config WHERE name LIKE 'cc%'"; - $row = $linkconn->Execute($query); - while($row && !$row->EOF) - { - $data = $row->fields; - $fieldlabel = $data['name']; - if( strlen($data['value']) ) $fieldlabel = $data['value']; - // DT_USER, $pending_uf, '', 1, 'la_bb', 'lu_fieldcustom__'.$pending_uf, 'text', ''); - $f = $objCustomFieldList->AddField(1, $data['name'], $fieldlabel,1,'la_inlink', 'lu_fieldcustom__'.$data['name'], 'text', ''); - //$f = $objCustomFieldList->AddField(1, $data['name'], $fieldlabel); - - $r[ $data['name'] ] = $f->Get('CustomFieldId'); - $objSession->SetVariable('custom_'.$data['name'], $f->Get('CustomFieldId') ); - $names[] = $data['name']; - $row->MoveNext(); - } - $objSession->SetVariable('custom_category', implode(',',$names) ); - $ml_helper->createFields('c-cdata', true); - unset($names); - - // Links Custom Fields: - $names = Array(); - $query = "SELECT * FROM inl_config WHERE name LIKE 'lc%'"; - $row = $linkconn->Execute($query); - while($row && !$row->EOF) - { - $data = $row->fields; - $fieldlabel = $data['name']; - if( strlen($data['value']) ) $fieldlabel = $data['value']; - //$f = $objCustomFieldList->AddField(4, $data['name'], $fieldlabel); - $f = $objCustomFieldList->AddField(4, $data['name'], $fieldlabel,1,'la_inlink', 'lu_fieldcustom__'.$data['name'], 'text', ''); - $r[ $data['name'] ] = $f->Get('CustomFieldId'); - $objSession->SetVariable('custom_'.$data['name'], $f->Get('CustomFieldId') ); - $names[] = $data['name']; - $row->MoveNext(); - } - $objSession->SetVariable('custom_links', implode(',',$names) ); - $ml_helper->createFields('l-cdata', true); - return $r; -} - -function getfields() #building and populating an array -{ - global $objSession; - - $r = Array(); - $tmp_fields = explode(',', $objSession->GetVariable('custom_user') ); // Array(uc1,uc2,uc3,...) - foreach($tmp_fields as $tmp_name) $r[$tmp_name] = $objSession->GetVariable('custom_'.$tmp_name); - - $tmp_fields = explode(',', $objSession->GetVariable('custom_category') ); - foreach($tmp_fields as $tmp_name) $r[$tmp_name] = $objSession->GetVariable('custom_'.$tmp_name); - - $tmp_fields = explode(',', $objSession->GetVariable('custom_links') ); - foreach($tmp_fields as $tmp_name) $r[$tmp_name] = $objSession->GetVariable('custom_'.$tmp_name); - - return $r; -} - - -################################################Relationships Import - -function relcatimport() -{ - global $linkconn,$objSession, $start; - $limit = 100; - $counter =0; - if ($start == 0) - { - $query='SELECT count(*) from inl_rel_cats'; - $row =$linkconn->Execute($query); - if ($row && !$row->EOF) - { - settotal($row->fields[0]); - - } - } - - $objRelList = new clsRelationshipList(); - $query='select * from inl_rel_cats LIMIT '.$start.', '.$limit; - $row =$linkconn->Execute($query); - while($row && !$row->EOF) - { - $counter++; - $sourceid = newcatrid($row->fields['cat_id']); - $targetid = newcatrid($row->fields['rel_id']); - if ($sourceid !='' && $targetid !='') - { - $r = $objRelList->Add($sourceid, 1,$targetid, 1); - $r->Create(); - } - $row->moveNext(); - } - - if ($counter == $limit) - { - setstart($start + $limit, 'relcat'); - } - else - { - setstart(0,'terminate'); - } - -} -function newcatrid($oid) -{ - global $portalconn, $TablePrefix; - $query2='select * from '.$TablePrefix.'import where otname=\'inl_cats\' and oid = '.$oid; - $row =$portalconn->Execute($query2); - if ($row->fields['nrid']) - { - return $row->fields['nrid']; - } - else - { - return ''; - } -} -// END OF RELATIONSHIP IMPORT -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.4.42/themes/default/inlink/blocks/links/link_cancel_confirmation.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.4.42/themes/default/inlink/blocks/links/link_cancel_confirmation.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.4.42/themes/default/inlink/blocks/links/link_cancel_confirmation.tpl (revision 0) @@ -1,33 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - -
    -

    -
    -

    -
    - -
    - - " /> - - " /> -
    -
    \ No newline at end of file Index: branches/unlabeled/unlabeled-1.42.2/in-link/admin/install/inportal_data.sql =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.42.2/in-link/admin/install/inportal_data.sql (revision 12746) +++ branches/unlabeled/unlabeled-1.42.2/in-link/admin/install/inportal_data.sql (revision 0) @@ -1,265 +0,0 @@ -INSERT INTO ConfigurationAdmin VALUES ('Link_SortField', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 4) AND (IsSystem = 0)', 10.01, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.01, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortField2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 4) AND (IsSystem = 0)', 10.02, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.02, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links', 'la_Text_Links', 'la_link_perpage_prompt', 'text', '', '', 10.03, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_NewDays', 'la_Text_Links', 'la_link_newdays_prompt', 'text', '', '', 10.05, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MinPopRating', 'la_Text_Links', 'la_fld_Link_MinPopRating', 'text', '', '', 10.06, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MaxHotNumber', 'la_Text_Links', 'la_fld_Link_MaxHotNumber', 'text', '', '', 10.08, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_EnhancedLinks', 'la_Text_Links', 'la_link_EnhancedLinks', 'checkbox', '', '', 10.09, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_AllowFreeListings', 'la_Text_Links', 'la_link_AllowFreeListings', 'checkbox', '', '', 10.1, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ShowPick', 'la_Text_Links', 'la_link_editorspick_prompt', 'checkbox', '', '', 10.11, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_UrlStatus', 'la_Text_Links', 'la_link_urlstatus_prompt', 'checkbox', '', '', 10.12, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'ReviewText=la_common_ReviewText,CreatedOn=la_common_CreatedOn', 20.01, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 20.01, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'ReviewText=la_common_ReviewText,date=la_common_CreatedOn', 20.02, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 20.02, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MinPopVotes', 'la_Text_Links', 'la_fld_Link_MinPopVotes', 'text', '', '', 10.07, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_LinkReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 20.03, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links_Short', 'la_Text_Links', 'la_link_perpage_short_prompt', 'text', '', '', 10.04, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Name', 'la_Text_Link_Search', 'la_Link_Name', 'checkbox', '', '', 2, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Description', 'la_Text_Link_Search', 'la_Link_Description', 'checkbox', '', '', 1, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Url', 'la_Text_Link_Search', 'la_Link_Url', 'checkbox', '', '', 5, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CreatedOn', 'la_Text_Link_Search', 'la_Link_CreatedOn', 'checkbox', '', '', 5, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Hits', 'la_Text_Link_Search', 'la_Link_Hits', 'checkbox', '', '', 6, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedRating', 'la_Text_Link_Search', 'la_Link_CatchedRating', 'checkbox', '', '', 7, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedVotesQty', 'la_Text_Link_Search', 'la_Link_CatchedVotesQty', 'checkbox', '', '', 8, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedReviewsQty', 'la_Text_Link_Search', 'la_Link_CatchedReviewsQty', 'checkbox', '', '', 9, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Value', 'la_Text_Links', 'la_prompt_DupReviews', 'text', '', '', 10.13, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Interval', 'la_Text_Links', 'la_prompt_DupReviews', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.13, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Value', 'la_Text_Links', 'la_prompt_DupRating', 'text', '', '', 10.14, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Interval', 'la_Text_Links', 'la_prompt_DupRating', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.14, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('l_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 30.01, 0, 0); -INSERT INTO ConfigurationAdmin VALUES ('l_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 30.02, 0, 0); - -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_links', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_links', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_links', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_links', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_links', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 0, 1); - -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Links', '10', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortField', 'Name', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortOrder', 'asc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortField2', 'Description', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortOrder2', 'desc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_NewDays', '100', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_MinPopRating', '5', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_MaxHotNumber', '5', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_EnhancedLinks', '0', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_AllowFreeListings', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ShowPick', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_UrlStatus', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsSort', 'CreatedOn', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsOrder', 'desc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsSort2', 'ReviewText', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsOrder2', 'asc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_MinPopVotes', '20', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_LinkId', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Name', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Description', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Url', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CreatedOn', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Hits', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CatchedRating', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CatchedVotesQty', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CatchedReviewsQty', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_ReviewById', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Priority', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Status', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_EditorsPick', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_ResourceId', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_HotItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_PopItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_NewItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_ReviewDelay_Value', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_ReviewDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_RatingDelay_Value', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_RatingDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_Root', '{LinkCatId}', 'In-Portal', '') -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Links_Short', '3', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_Highlight_OpenTag', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_Highlight_CloseTag', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LinkReviews_Short', '3', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LinkReviews', '10', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'l_CategoryTemplate', 'inlink/index', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (NULL, 'l_ItemTemplate', 'inlink/detail', 'In-Link', 'in-link:configuration_output'); - -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Keyword_links', '90', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Pop_links', '5', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Rating_links', '5', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Increase_links', '30', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_ShowMultiple_links', '0', 'In-Link', 'in-link:configuration_search'); - -INSERT INTO ConfigurationValues VALUES (NULL, 'StartValidationTime', '0', 'In-Link', ''); -INSERT INTO ConfigurationValues VALUES (NULL, 'LastExpirationTime', '0', 'In-Link', ''); -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_RatingToPop', '5', 'In-Link', 'in-link:configuration_output'); - -INSERT INTO Events VALUES (7, 'LINK.ADD', 2, 0, 'In-Link', 'la_event_link.add', 1) -INSERT INTO Events VALUES (8, 'LINK.MODIFY', 2, 0, 'In-Link', 'la_event_link.modify', 1) -INSERT INTO Events VALUES (9, 'LINK.REVIEW.ADD', 2, 0, 'In-Link', 'la_event_link.review.add', 1) -INSERT INTO Events VALUES (10, 'LINK.ADD', 1, 0, 'In-Link', 'la_event_link.add', 0) -INSERT INTO Events VALUES (11, 'LINK.APPROVE', 1, 0, 'In-Link', 'la_event_link.approve', 0) -INSERT INTO Events VALUES (12, 'LINK.DENY', 1, 0, 'In-Link', 'la_event_link.deny', 0) -INSERT INTO Events VALUES (13, 'LINK.MODIFY', 1, 0, 'In-Link', 'la_event_link.modify', 0) -INSERT INTO Events VALUES (14, 'LINK.MODIFY.APPROVE', 1, 0, 'In-Link', 'la_event_link.modify.approve', 0) -INSERT INTO Events VALUES (15, 'LINK.REVIEW.ADD', 1, 0, 'In-Link', 'la_event_link.review.add', 0) -INSERT INTO Events VALUES (16, 'LINK.REVIEW.APPROVE', 1, 0, 'In-Link', 'la_event_link.review.approve', 0) -INSERT INTO Events VALUES (17, 'LINK.REVIEW.DENY', 1, 0, 'In-Link', 'la_event_link.review.deny', 0) -INSERT INTO Events VALUES (40, 'LINK.ADD.PENDING', 1, 0, 'In-Link', 'la_event_link.add.pending', 0) -INSERT INTO Events VALUES (42, 'LINK.MODIFY.PENDING', 1, 0, 'In-Link', 'la_event_link.modify.pending', 0) -INSERT INTO Events VALUES (43, 'LINK.REVIEW.ADD.PENDING', 1, 0, 'In-Link', 'la_event_link.review.add.pending', 0) -INSERT INTO Events VALUES (46, 'LINK.MODIFY.DENY', 1, 0, 'In-Link', 'la_event_link.modify.deny', 0) -INSERT INTO Events VALUES ('', 'LINK.ENHANCE', '1', '0', 'In-Link', 'la_event_link.link.enhance', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE', '1', '0', 'In-Link', 'la_event_link.link.enhance', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.APPROVE', '0', '0', 'In-Link', 'la_event_link.link.enhance.approve', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.APPROVE', '1', '0', 'In-Link', 'la_event_link.link.enhance.approve', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.DENY', '0', '0', 'In-Link', 'la_event_link.link.enhance.deny', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.DENY', '1', '0', 'In-Link', 'la_event_link.link.enhance.deny', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXPIRE', '1', '0', 'In-Link', 'la_event_link.link.enhance.expire', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXPIRE', '1', '0', 'In-Link', 'la_event_link.link.enhance.expire', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXTEND', '1', '0', 'In-Link', 'la_event_link.link.enhance.extend', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXTEND', '1', '0', 'In-Link', 'la_event_link.link.enhance.extend', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW', '0', '0', 'In-Link', 'la_event_link.link.enhance.renew', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW.FAILED', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_failed', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW.FAILED', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_failed', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.CANCEL', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_cancel', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.CANCEL', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_cancel', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEWAL.NOTICE', '1', '0', 'In-Link', 'la_event_link.link.enhance.renewal_notice', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEWAL.NOTICE', '1', '0', 'In-Link', 'la_event_link.link.enhance.renewal_notice', '0') - -INSERT INTO ItemTypes VALUES (4, 'In-Link', 'l', 'Link', 'Name', 'CreatedById', 'Hits', 'CachedRating', 'la_ItemTab_Links', 1, 'in-link/admin/addlink.php', 'clsLink', 'Link'); - -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.ADD', 'lu_PermName_Link.Add_desc', 'lu_PermName_Link.Add_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.VIEW', 'lu_PermName_Link.View_desc', 'lu_PermName_Link.View_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.ADD.PENDING', 'lu_PermName_Link.Add.Pending_desc', 'lu_PermName_Link.Add.Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.MODIFY', 'lu_PermName_Link.Modify_desc', 'lu_PermName_Link.Modify_desc', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.DELETE', 'lu_PermName_Link.Delete_desc', 'lu_PermName_Link.Delete_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.RATE', 'lu_PermName_Link.Rate_desc', 'lu_PermName_Link.Rate_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.REVIEW', 'lu_PermName_Link.Review_desc', 'lu_PermName_Link.Review_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.REVIEW.PENDING', 'lu_PermName_Link.Review_Pending_desc', ' lu_PermName_Link.Review_Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.MODIFY.PENDING', 'lu_PermName_Link.Modify.Pending_desc', 'lu_PermName_Link.Modify.Pending_desc', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.MODIFY', 'lu_PermName_Link.Owner.Modify_desc', 'lu_PermName_Link.Owner.Modify_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.MODIFY.PENDING', 'lu_PermName_Link.Owner.Modify.Pending_desc', 'lu_PermName_Link.Owner.Modify.Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.DELETE', 'lu_PermName_Link.Owner.Delete_desc', 'lu_PermName_Link.Owner.Delete_error', 'In-Link'); - -INSERT INTO SearchConfig VALUES ('Link', 'OrgId', 0, 0, 'lu_fielddesc_link_orgid', 'lu_field_orgid', 'In-Link', 'la_text_link', 19, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'NewItem', 0, 1, 'lu_fielddesc_link_newitem', 'lu_field_newitem', 'In-Link', 'la_text_link', 18, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'PopItem', 0, 1, 'lu_fielddesc_link_popitem', 'lu_field_popitem', 'In-Link', 'la_text_link', 17, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'HotItem', 0, 1, 'lu_fielddesc_link_hotitem', 'lu_field_hotitem', 'In-Link', 'la_text_link', 16, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'ResourceId', 0, 1, 'lu_fielddesc_link_resourceid', 'lu_field_resourceid', 'In-Link', 'la_text_link', 15, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'EditorsPick', 0, 1, 'lu_fielddesc_link_editorspick', 'lu_field_editorspick', 'In-Link', 'la_text_link', 14, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Status', 0, 0, 'lu_fielddesc_link_status', 'lu_field_status', 'In-Link', 'la_text_link', 13, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Priority', 0, 0, 'lu_fielddesc_link_priority', 'lu_field_priority', 'In-Link', 'la_text_link', 12, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'ModifiedById', 0, 0, 'lu_fielddesc_link_modifiedbyid', 'lu_field_modifiedbyid', 'In-Link', 'la_text_link', 11, 0, 0, 'text', 'PortalUser.Login', '{ForeignTable}.PortalUserId={LocalTable}.ModifiedById', NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CreatedById', 0, 0, 'lu_fielddesc_link_createdbyid', 'lu_field_createdbyid', 'In-Link', 'la_text_link', 10, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedReviewsQty', 0, 0, 'lu_fielddesc_link_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Link', 'la_text_link', 9, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedVotesQty', 0, 0, 'lu_fielddesc_link_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Link', 'la_text_link', 8, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'LinkId', 0, 1, 'lu_fielddesc_link_linkid', 'lu_field_linkid', 'In-Link', 'la_text_link', 0, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Name', 1, 1, 'lu_fielddesc_link_name', 'lu_field_name', 'In-Link', 'la_text_link', 1, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Description', 1, 1, 'lu_fielddesc_link_description', 'lu_field_description', 'In-Link', 'la_text_link', 2, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Url', 1, 1, 'lu_fielddesc_link_url', 'lu_field_url', 'In-Link', 'la_text_link', 3, 0, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CreatedOn', 0, 1, 'lu_fielddesc_link_createdon', 'lu_field_createdon', 'In-Link', 'la_text_link', 4, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Modified', 0, 1, 'lu_fielddesc_link_modified', 'lu_field_modified', 'In-Link', 'la_text_link', 5, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Hits', 0, 1, 'lu_fielddesc_link_hits', 'lu_field_hits', 'In-Link', 'la_text_link', 6, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedRating', 0, 0, 'lu_fielddesc_link_cachedrating', 'lu_field_cachedrating', 'In-Link', 'la_text_link', 7, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); - -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) as LinkCount FROM <%prefix%>Link WHERE Status=1', NULL, 'la_prompt_ActiveLinks', 0, 1); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS TotalLinks FROM <%prefix%>Link', NULL, 'la_prompt_TotalLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS ActiveLinks FROM <%prefix%>Link WHERE Status = 1', NULL, 'la_prompt_ActiveLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS PendingLinks FROM <%prefix%>Link WHERE Status = 2', NULL, 'la_prompt_PendingLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS DisabledLinks FROM <%prefix%>Link WHERE Status = 0', NULL, 'la_prompt_DisabledLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS NewLinks FROM <%prefix%>Link WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Link_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>Link WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS HotLinks FROM <%prefix%>Link WHERE (HotItem = 1) OR (Hits >= <%m:config name="Link_MaxHotNumber"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS PopularLinks FROM <%prefix%>Link WHERE (PopItem = 1) OR ( (CachedRating >= <%link:hit_count type="top"%>) AND <%link:hit_count type="top"%> AND (PopItem = 2) )', NULL, 'la_prompt_PopularLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Link WHERE CachedRating > 0', NULL, 'la_prompt_LinksAverageRating', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT MAX(Hits) AS MaxLinksHits FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksHits', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT MAX(CachedVotesQty) AS MaxLinksVotes FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksVotes', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_NewestLinkDate', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_LastLinkUpdate', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_LinkReviews', 0, 2); - -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 14, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 14, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD.PENDING', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.DELETE', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.DELETE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.MODIFY', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.DELETE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.DELETE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.DELETE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:inlink_general.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:inlink_general.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_output.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_output.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_search.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_search.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_email.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_email.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.advanced:approve', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.advanced:decline', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.delete', 11, 1, 1, 0); - -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('in-link', 'In-Link', 'inlink_import', 'Intechnic In-Link 2.x', 'In-Link', 'link_image,user_admin,user_regular,init_cat', 1,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Gossamer Threads Links 2.x', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Gossamer Threads Links 2.x SQL version', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Sentraweb Indexu 3.x', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Links from CSV file [In-Link]', '', '', 1, 'csv'); - -INSERT INTO CustomField (Type, FieldName, FieldLabel, Heading, Prompt, ElementType, ValueList, DisplayOrder, OnGeneralTab, IsSystem) VALUES (1, 'l_ItemTemplate', 'l_ItemTemplate', 'la_title_SystemCF', 'l_ItemTemplate', 'text', NULL, 0, 0, 1); - -INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('In-Link', 'in-link/', 'l', '3.2.3', 1, 1, 'inlink/', 2, '1054738405'); \ No newline at end of file Index: branches/unlabeled/unlabeled-1.29.2/in-link/units/listings/listings_event_handler.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.29.2/in-link/units/listings/listings_event_handler.php (revision 12746) +++ branches/unlabeled/unlabeled-1.29.2/in-link/units/listings/listings_event_handler.php (revision 0) @@ -1,717 +0,0 @@ - Array('self' => true), - - ); - $this->permMapping = array_merge($this->permMapping, $permissions); - } - - /** - * Adds selected link to listing - * - * @param kEvent $event - */ - function OnProcessSelected(&$event) - { - $object =& $event->getObject(); - - $selected_ids = $this->Application->GetVar('selected_ids'); - if ($selected_ids['l']) { - $link_id = $selected_ids['l']; - $sql = 'SELECT ResourceId - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE '.$this->Application->getUnitOption('l', 'IDField').' = '.$link_id; - - $object->SetDBField($this->Application->RecallVar('dst_field'), $this->Conn->GetOne($sql)); - $object->IgnoreValidation = true; - // $this->RemoveRequiredFields($object); - $object->Update(); - } - - $this->finalizePopup($event); - } - - function OnPreSaveListing(&$event) - { - $event->redirect=false; - $object =& $event->getObject( Array('skip_autoload' => true) ); - $object->IgnoreValidation = true; - // $this->RemoveRequiredFields($object); - $event->CallSubEvent('OnPreSave'); - $this->Application->SetVar($event->getPrefixSpecial(true).'_id', $object->GetId()); - return; - } - - function OnBeforeItemUpdate(&$event) - { - $object =& $event->getObject(); - if($object->IgnoreValidation) - { - $object->UpdateFormattersMasterFields(); - } - } - - function OnBeforeItemCreate(&$event) - { - $object =& $event->getObject(); - if($object->IgnoreValidation) - { - $object->UpdateFormattersMasterFields(); - } - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnBeforeDeleteFromLive(&$event) - { - $object =& $event->getObject(); - $sql = 'SELECT * FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ListingId = '.$object->GetId(); - $original_values = $this->Conn->GetRow($sql); - - $type_modified = ($object->GetDBField('ListingTypeId') != $original_values['ListingTypeId']); - $link_modified = ($object->GetDBField('ItemResourceId') != $original_values['ItemResourceId']); - $status_modified = ($object->GetDBField('Status') != $original_values['Status']); - - if($status_modified) - { - $email_event = $object->GetDBField('Status') ? 'LINK.ENHANCE.APPROVE' : 'LINK.ENHANCE.APPROVE'; - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser($email_event, $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin($email_event); - } - - if( $type_modified || $link_modified ) - { - $this->ResetLink($original_values); - } - - if( $status_modified || $type_modified || $link_modified ) - { - $this->EnhanceLink($object, $original_values); - } - - if( $status_modified && !($type_modified || $link_modified) ) - { - $this->ResetLink($original_values); - } - } - - function EnhanceLink(&$object, $original_values) - { - if ($object->GetDBField('Status') != STATUS_ACTIVE) { - return false; - } - - if ($object->GetDBField('ExpiresOn') < adodb_mktime()) { - $object->SetDBField('Status', STATUS_PENDING); - $object->Update(); - $this->ResetLink($original_values); - return false; - } - - $this->UpdateLink('OnPurchase', $object->GetDBField('ItemResourceId'), $object->GetDBField('ListingTypeId')); - - $listtype_object =& $this->Application->recallObject('lst'); - if( $listtype_object->GetDBField('OnPurchaseAddToCatEnabled') ) - { - $link_object =& $this->Application->recallObject('l'); - $add_to_cat = (int)$listtype_object->GetDBField('OnPurchaseAddToCat'); - $sql = 'DELETE FROM '.$this->Application->getUnitOption('l-ci', 'TableName').' - WHERE CategoryId = '.$add_to_cat.' - AND ItemResourceId = '.$link_object->GetDBField('ResourceId').' - AND PrimaryCat = 0'; - $this->Conn->Query($sql); - $sql = 'INSERT INTO '.$this->Application->getUnitOption('l-ci', 'TableName').' - (CategoryId, ItemResourceId, PrimaryCat) - VALUES ('.$add_to_cat.', '.$link_object->GetDBField('ResourceId').', 0)'; - $this->Conn->Query($sql); - } - } - - function ResetLink($original_values) - { - static $has_been_reset = Array(); - - if( $original_values['Status'] != STATUS_ACTIVE || - getArrayValue($has_been_reset, $original_values['ListingId']) ) - { - return; - } - - $has_been_reset[$original_values['ListingId']] = 1; - - $this->UpdateLink('OnExpire', $original_values['ItemResourceId'], $original_values['ListingTypeId']); - - $listtype_object =& $this->Application->recallObject('lst'); - if( $listtype_object->GetDBField('OnExpireRemoveFromCatEnabled') ) - { - $remove_from_cat = $listtype_object->GetDBField('OnExpireRemoveFromCat'); - $sql = 'DELETE FROM '.$this->Application->getUnitOption('l-ci', 'TableName').' - WHERE ItemResourceId = '.$original_values['ItemResourceId'].' - AND CategoryId = '.$remove_from_cat.' - AND PrimaryCat = 0'; - $this->Conn->Query($sql); - } - } - - function UpdateLink($action_prefix, $resource_id, $listtype_id) - { - - $link_object =& $this->Application->recallObject('l', null, Array('skip_autoload' => true)); - $link_object->Load($resource_id, 'ResourceId'); - - // "-item", because can be called as regular after event, and just "lst" recalls list instead - $listtype_object =& $this->Application->recallObject('lst.-item', null, Array('skip_autoload' => true)); - $listtype_object->Load($listtype_id); - - $action_fields = Array( 'EdPick' => 'EditorsPick', - 'New' => 'NewItem', - 'Hot' => 'HotItem', - 'Pop' => 'PopItem', - 'Status' => 'Status' - ); - // $action_prefix = 'OnPurchase'; - - foreach($action_fields as $action => $field) - { - $action_value = $listtype_object->GetDBField($action_prefix.$action); - if( $action_value != 3 ) - { - $link_object->SetDBField($field, $action_value); - } - } - - $priority_value = $listtype_object->GetDBField($action_prefix.'PriorityValue'); - switch( $listtype_object->GetDBField($action_prefix.'PriorityAction') ) - { - case 1: // equal - $link_object->SetDBField('Priority', $priority_value); - break; - case 2: // increase - $original_priority = $link_object->GetDBField('Priority'); - $link_object->SetDBField('Priority', $original_priority + $priority_value); - break; - case 3: // decrease - $original_priority = $link_object->GetDBField('Priority'); - $link_object->SetDBField('Priority', $original_priority - $priority_value); - break; - default: - } - - $link_object->Update(); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnRequestEnhancement(&$event) - { - if ($this->Application->isModuleEnabled('In-Commerce')) { - $l_info = $this->Application->GetVar('l'); - if (!$l_info) { - return false; - } - - list($link_id, $link_info) = each($l_info); - $listing_type_id = $link_info['ListingTypeId']; - - $listing_type =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing_type->Load($listing_type_id); - - if ($listing_type->GetDBField('EnableBuying')) { - $add_to_cart_event =& new kEvent('ord:OnAddVirtualProductToCart'); - $this->Application->HandleEvent($add_to_cart_event); - - if($add_to_cart_event->redirect) - { - $event->SetRedirectParam('pass', 'm'); - $event->redirect = $add_to_cart_event->redirect; - } - return true; - } - } - - $event->CallSubEvent('OnListingCreate'); - } - - /** - * Create listing or extend existing listing period - * - * @param kEvent $event - */ - function OnListingCreate(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - - switch ($event->Name) { - case 'EnhanceLinkAfterOrderApprove': - case 'EnhancedLinkOnCompleteOrder': - // when order with listing virtual product is approved - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $listing_type_id = $item_data['ListingTypeId']; - $link_id = $item_data['LinkId']; - - $new_processing = getArrayValue($item_data, 'HasNewProcessing'); - break; - - case 'OnListingCreate': - // when requesting enhancement from front (and not via in-commerce) - $links_info = $this->Application->GetVar('l'); - if (!$links_info) return false; - - $event->redirect = false; - list($link_id, $link_info) = each($links_info); - $listing_type_id = $link_info['ListingTypeId']; - - $new_processing = false; - break; - } - - // get resource_id of link beeing enhanced - $sql = 'SELECT ResourceId - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $resource_id = $this->Conn->GetOne($sql); - - // get listing by link's resource_id - $object->Load($resource_id, 'ItemResourceId'); - if ($object->isLoaded()) { - $original_values = $object->FieldValues; - } - else { - // set initial fields to listing - $object->SetDBField('ListingTypeId', $listing_type_id); - $object->SetDBField('ItemResourceId', $resource_id); - - if ($event->Name == 'OnListingCreate' || $new_processing) { - $item_status = STATUS_PENDING; - } - else { - $item_status = STATUS_ACTIVE; - } - - $object->SetDBField('Status', $item_status); - } - - // set date of purchase for new listings - $purchased_on = max(adodb_mktime(), $object->GetDBField('ExpiresOn')); - if (!$object->isLoaded()) { - $object->SetDBField('PurchasedOn_date', $purchased_on); - $object->SetDBField('PurchasedOn_time', $purchased_on); - } - - // set expiration time for listing - $listing_type =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing_type->Load($listing_type_id); - - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $listing_type->GetDBField('Duration'); - $duration_type = $listing_type->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $expiration_date = $purchased_on + $expiration_interval; - $object->SetDBField('ExpiresOn_date', $expiration_date); - $object->SetDBField('ExpiresOn_time', $expiration_date); - - // when extending enhancement mark listing as non-received renewal reminder - $object->SetDBField('RenewalReminderSent', 0); - - $action = $object->isLoaded() ? 'Update' : 'Create'; - if ($object->$action()) { - $event->status = erSUCCESS; - switch ($event->Name) { - case 'EnhanceLinkAfterOrderApprove': - case 'EnhancedLinkOnCompleteOrder': - // when order with listing virtual product is approved - if (getArrayValue($original_values, 'Status') != STATUS_ACTIVE) { - $this->EnhanceLink($object, Array()); - } - break; - - case 'OnListingCreate': - // when requesting enhancement from front (and not via in-commerce) - $event->redirect = $this->Application->GetVar('success_template'); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE'); - break; - } - - - } - else { - $event->status = erFAIL; - } - - - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function EnhancedLinkOnCompleteOrder(&$event) - { - // create enhancement, but pending - $this->OnListingCreate($event); - - // save created listing_id back to itemdata - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - unset($item_data['ListingTypeId']); - $item_data['ListingId'] = $object->GetID(); - - $orditems_idfield = $this->Application->getUnitOption('orditems', 'IDField'); - $orditems_table = $this->Application->getUnitOption('orditems', 'TableName'); - - $this->Conn->doUpdate( Array('ItemData' => serialize($item_data)), $orditems_table, $orditems_idfield.' = '.$fields['OrderItemId'] ); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function EnhanceLinkAfterOrderApprove(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - - if ( getArrayValue($item_data, 'HasNewProcessing') ) { - // new processing: just approve created listing here - $listing_id = $item_data['ListingId']; - $object->Load($listing_id); - $object->SetDBField('Status', STATUS_ACTIVE); - $object->Update(); - - $this->EnhanceLink($object, Array()); - return true; - } - else { - // create listing & approve it at the same time - $this->OnListingCreate($event); - } - } - - /** - * Delete listing - * - * @param kEvent $event - */ - function EnhanceLinkAfterOrderDeny(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $listing_id = $item_data['ListingId']; - - $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); - $temp_handler->DeleteItems($event->Prefix, $event->Special, Array($listing_id)); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function ExpireLink(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$item_data['LinkId']; - $listing_id = $this->Conn->GetOne($sql); - $object->Load($listing_id); - $original_values = $object->FieldValues; - $object->SetDBField('Status', 2); - - if($object->Update()) - { - $event->status = erSUCCESS; - $this->ResetLink($original_values); - } - else - { - $event->status = erFAIL; - } - } - - function iterateItems(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $this->StoreSelectedIDs($event); - - if($event->Name == 'OnMassApprove') - { - $ids = $this->getSelectedIDs($event); - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') != 1) - { - $original_values = $object->FieldValues; - $object->SetDBField('Status', 1); - $this->EnhanceLink($object, $original_values); - } - } - } - if($event->Name == 'OnMassDecline') - { - $ids = $this->getSelectedIDs($event); - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') == 1) - { - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.DENY', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.DENY'); - } - } - } - parent::iterateItems($event); - if($event->Name == 'OnMassApprove') - { - $lst_object =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $ids = $this->getSelectedIDs($event); - if($ids) - { - foreach($ids as $id) - { - $object->Load($id); - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $owner_id = $this->Conn->GetOne($sql); - if($object->GetDBField('PendingRenewal') == 1) - { - $lst_object->Load( $object->GetDBField('ListingTypeId') ); - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $lst_object->GetDBField('Duration'); - $duration_type = $lst_object->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $renewal_begins = max( adodb_mktime(), $object->GetDBField('ExpiresOn') ); - $expiration_date = $renewal_begins + $expiration_interval; - - $object->SetDBField('ExpiresOn_date', $expiration_date); - $object->SetDBField('ExpiresOn_time', $expiration_date); - - $object->SetDBField('RenewalReminderSent', 0); - $object->SetDBField('PendingRenewal', 0); - - if( $object->Update() ) - { - $event->status=erSUCCESS; - $event->redirect_params = Array('opener' => 's', 'pass_events' => true); //stay! - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.RENEW', $owner_id); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.RENEW'); - } - else - { - $event->status=erFAIL; - $event->redirect=false; - break; - } - } - else - { - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.APPROVE', $owner_id); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.APPROVE'); - } - } - } - } - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnCancel(&$event) - { - parent::OnCancel($event); - $event->SetRedirectParam('opener', 's'); - $event->redirect = $this->Application->GetVar('cancel_template'); - } - - function OnExtendEnhancement(&$event) - { - $link_id = $this->Application->GetVar('l_id'); - $sql = 'SELECT ResourceId FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $link_resource_id = $this->Conn->GetOne($sql); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$link_resource_id; - - $object =& $event->getObject( Array('skip_autoload' => true) ); - $object->Load( $this->Conn->GetOne($sql) ); - - $object->SetDBField('PendingRenewal', 1); - $object->Update(); - $event->redirect = $this->Application->GetVar('success_template'); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.EXTEND', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.EXTEND'); - } - - function OnCancelEnhancement(&$event) - { - $link_id = $this->Application->GetVar('l_id'); - $sql = 'SELECT ResourceId FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $link_resource_id = $this->Conn->GetOne($sql); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$link_resource_id; - - $object =& $this->Application->recallObject($event->Prefix, null, Array('skip_autoload' => true)); - $object->Load( $this->Conn->GetOne($sql) ); - $original_values = $object->FieldValues; - $original_values['Status'] = 1; - $this->ResetLink($original_values); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.CANCEL', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.CANCEL'); - - $object->Delete(); - $event->redirect = $this->Application->GetVar('success_template'); - } - - function OnCheckExpiredPaidListings(&$event) - { - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ExpiresOn < '.adodb_mktime().' AND Status = 1'; - $expired_listings = $this->Conn->GetCol($sql); - if(is_array($expired_listings) && count($expired_listings) > 0) - { - $object =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true)); - foreach($expired_listings as $listing_id) - { - $object->Load($listing_id); - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - $object->SetDBField('Status', 2); - $object->Update(); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.EXPIRE', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.EXPIRE'); - } - } - - $sql = 'SELECT ls.ListingId, l.CreatedById FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' ls - LEFT JOIN '.$this->Application->getUnitOption('lst', 'TableName').' lst - ON ls.ListingTypeId = lst.ListingTypeId - LEFT JOIN '.$this->Application->getUnitOption('l', 'TableName').' l - ON ls.ItemResourceId = l.ResourceId - WHERE ls.Status = 1 - AND ls.ExpiresOn < '.adodb_mktime().' + lst.RenewalReminder * 3600 *24 - AND ls.RenewalReminderSent = 0'; - $res = $this->Conn->Query($sql); - if(is_array($res) && count($res) > 0) - { - $listing_ids = Array(); - foreach($res as $record) - { - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.RENEWAL.NOTICE', $record['CreatedById']); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.RENEWAL.NOTICE'); - $listing_ids[] = $record['ListingId']; - } - $sql = 'UPDATE '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - SET RenewalReminderSent = 1 - WHERE ListingId IN ('.implode(',', $listing_ids).')'; - $this->Conn->Query($sql); - } - } - - function OnMassDelete(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $this->StoreSelectedIDs($event); - - $ids = $this->getSelectedIDs($event); - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') == 1) - { - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - } - } - parent::OnMassDelete($event); - } - - /** - * Moves enhancement from original link to it's pending copy, that is going to be approved - * - * @param kEvent $event - */ - function OnMoveEnhancement(&$event) - { - $id_field = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'IDField'); - $item_table_name = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'TableName'); - - $pending_id = $event->MasterEvent->getEventParam('id'); - $original_id = $event->MasterEvent->getEventParam('original_id'); - - $sql = 'SELECT ResourceId, '.$id_field.' - FROM '.$item_table_name.' - WHERE '.$id_field.' IN ('.$pending_id.','.$original_id.')'; - $resource_ids = $this->Conn->GetCol($sql, $id_field); - - $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); - $sql = 'UPDATE '.$table_name.' - SET ItemResourceId = '.$resource_ids[$pending_id].' - WHERE ItemResourceId = '.$resource_ids[$original_id]; - $this->Conn->Query($sql); - } -} - -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.60.2/in-link/units/links/links_config.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.60.2/in-link/units/links/links_config.php (revision 12746) +++ branches/unlabeled/unlabeled-1.60.2/in-link/units/links/links_config.php (revision 0) @@ -1,356 +0,0 @@ - 'l', - 'ItemClass' => Array('class'=>'kCatDBItem','file'=>'','build_event'=>'OnItemBuild'), - 'ListClass' => Array('class'=>'kCatDBList','file'=>'','build_event'=>'OnListBuild'), - 'EventHandlerClass' => Array('class' => 'LinksEventHandler', 'file' => 'links_event_handler.php', 'require_classes' => Array('kCatDBEventHandler'), 'build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'LinkTagProcessor','file'=>'link_tag_processor.php', 'require_classes' => Array('kCatDBTagProcessor'), 'build_event'=>'OnBuild'), - 'AutoLoad' => true, - 'Hooks' => Array(), - 'QueryString' => Array( - 1 => 'id', - 2 => 'Page', - 3 => 'Reviews_Page', // depricated (for old in-link) - 4 => 'event', - 5 => 'mode', - ), - 'CatalogItem' => true, - 'AdminTemplatePath' => 'links', - 'AdminTemplatePrefix' => 'links_', - 'IDField' => 'LinkId', - 'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events - - 'ItemType' => 4, - - 'StatisticsInfo' => Array( - 'pending' => Array( - 'icon' => 'icon16_link_pending.gif', - 'label' => 'la_Text_Links', - 'js_url' => "set_persistant_var('Link_View', 47, 'advanced_view', '#url#')", - 'url' => Array('t' => 'advanced_view', 'index_file' => 'advanced_view.php', 'SetTab' => 'links', 'pass' => 'm'), - 'status' => STATUS_PENDING, - ), - ), - - 'TitlePhrase' => 'la_Text_Link', // phrase used to specify item type in relationship list - - 'ViewMenuPhrase' => 'la_title_Links', - 'UsePendingEditing' => true, // item editing is controlled by LINK.ADD/EDIT, LINK.ADD/EDIT.PENDING permissions - - 'CatalogSelectorName' => 'linklist', // used in old catalog section - - 'ItemPropertyMappings' => Array( - 'NewDays' => 'Link_NewDays', // number of days item to be NEW - 'MinPopVotes' => 'Link_MinPopVotes', // minimum number of votes for an item to be POP - 'MinPopRating' => 'Link_MinPopRating', // minimum rating for an item to be POP - 'MaxHotNumber' => 'Link_MaxHotNumber', // maximum number of HOT items - - 'HotLimit' => 'Link_HotLimit', // variable name in inp_Cache table - 'ClickField' => 'Hits', // item click count is stored here (in item table) - ), - - 'TitleField' => 'Name', - - 'TitlePresets' => Array( - 'default' => Array( 'new_status_labels' => Array('l'=>'!la_title_AddingLink!'), - 'edit_status_labels' => Array('l'=>'!la_title_EditingLink!'), - 'new_titlefield' => Array('l'=>'!la_title_NewLink!'), - ), - - 'links_edit' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_General!"), - - 'link_list'=>Array( 'prefixes' => Array('c_List', 'l_List'), - 'format' => "!la_title_Categories! (#c_recordcount#) - !la_title_Links! (#l_recordcount#)", - ), - 'link_edit'=>Array( 'prefixes' => Array('l'), - 'new_titlefield' => Array('l'=>'!la_title_NewLink!'), - 'format' => "#l_status# '#l_titlefield#' - !la_title_General!", - ), - - 'links_categories'=>Array('prefixes' => Array('l','l-ci_List'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Categories!"), - 'links_relations'=> Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Relations!"), - 'links_images' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Images!"), - 'links_reviews' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Reviews!"), - 'links_custom' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Custom!"), - - 'images_edit' => Array( 'prefixes' => Array('l', 'l-img'), - 'new_status_labels' => Array('l-img'=>'!la_title_Adding_Image!'), - 'edit_status_labels' => Array('l-img'=>'!la_title_Editing_Image!'), - 'new_titlefield' => Array('l-img'=>'!la_title_New_Image!'), - 'format' => "#l_status# '#l_titlefield#' - #l-img_status# '#l-img_titlefield#'", - ), - - 'reviews_edit' => Array( 'prefixes' => Array('l', 'l-rev'), - 'new_status_labels' => Array('l-rev'=>"!la_title_Adding_Review! '!la_title_New_Review!'"), - 'edit_status_labels' => Array('l-rev'=>'!la_title_Editing_Review!'), - 'format' => "#l_status# '#l_titlefield#' - #l-rev_status#", - ), - - 'relations_edit' => Array( 'prefixes' => Array('l', 'l-rel'), - 'new_status_labels' => Array('l-rel'=>"!la_title_Adding_Relationship! '!la_title_New_Relationship!'"), - 'edit_status_labels' => Array('l-rel'=>'!la_title_Editing_Relationship!'), - 'format' => "#l_status# '#l_titlefield#' - #l-rel_status#", - ), - - 'links_export' => Array('format' => '!la_title_LinksExport!'), - - 'links_import' => Array('format' => '!la_title_ImportLinks!'), - - 'duplicate_links' => Array('prefixes' => Array('l.duplicates_List'), 'format' => "!la_title_DuplicateLinks! (#l.duplicates_recordcount#)"), - - 'tree_in-link' => Array('format' => '!la_Text_Version! '.$this->Application->findModule('Name', 'In-Link', 'Version')), - ), - - 'PermItemPrefix' => 'LINK', - - 'PermTabText' => 'In-Link', - 'PermSection' => Array('main' => 'CATEGORY:in-link:links_list', 'search' => 'in-link:configuration_search', 'email' => 'in-link:configuration_email', 'custom' => 'in-link:configuration_custom'), - - 'Sections' => Array( - 'in-link' => Array( - 'parent' => 'in-portal:root', - 'icon' => 'settings_in-link', - 'label' => 'la_title_In-Link', - 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view'), - 'priority' => 3.1, - 'type' => stTREE, - ), - - 'in-link:inlink_general' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_general', - 'label' => 'la_tab_GeneralSettings', - 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 1, - 'type' => stTREE, - ), - - 'in-link:configuration_output' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_output', - 'label' => 'la_tab_ConfigOutput', - 'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 2, - 'type' => stTREE, - ), - - 'in-link:configuration_search' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_search', - 'label' => 'la_tab_ConfigSearch', - 'url' => Array('t' => 'config/config_search', 'module_key' => 'links', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 3, - 'type' => stTREE, - ), - - 'in-link:configuration_email' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_email', - 'label' => 'la_tab_ConfigE-mail', - 'url' => Array('t' => 'config/config_email', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 4, - 'type' => stTREE, - ), - - 'in-link:configuration_custom' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_custom', - 'label' => 'la_tab_ConfigCustom', - 'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 4, 'pass_section' => true, 'pass' => 'm,cf'), - 'permissions' => Array('view', 'add', 'edit', 'delete'), - 'priority' => 5, - 'type' => stTREE, - ), - - 'in-link:duplicate_checker' => Array( - 'parent' => 'in-link', - 'icon' => 'duplicate_checker', - 'label' => 'la_tab_DuplicateChecker', - 'url' => Array('t' => 'in-link/duplicate_checker', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit', 'delete'), - 'priority' => 6, - 'type' => stTREE, - ), - - 'in-link:validation_list' => Array( - 'parent' => 'in-link', - 'icon' => 'validate', - 'label' => 'la_tab_LinkValidation', - 'url' => Array('index_file' => '../in-link/admin/validation.php', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit'), - 'priority' => 7, - 'type' => stTREE, - ), - ), - - 'FilterMenu' => Array( - 'Groups' => Array( - Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_new'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_hot'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_pop'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_pick'), 'type' => WHERE_FILTER), - ), - 'Filters' => Array( - 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), - 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ), - 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), - 's1' => Array(), - 'show_new' => Array('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ), - 'show_hot' => Array('label' => 'la_Text_Hot', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ), - 'show_pop' => Array('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ), - 'show_pick' => Array('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '%1$s.`EditorsPick` != 1' ), - ) - ), - - 'TableName' => TABLE_PREFIX.'Link', - - 'CalculatedFields' => Array( - '' => Array ( - 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.CreatedById = -1, "root", IF (%1$s.CreatedById = -2, "Guest", "n/a")), u.Login)', - 'CategoryId' => TABLE_PREFIX.'%3$sCategoryItems.CategoryId', - 'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename', - 'CategoryFilename' => TABLE_PREFIX.'Category.NamedParentPath', - ), - ), - - 'CacheModRewrite' => true, - - 'AggregatedCalculatedFields' => Array( - - 'duplicates' => Array ( - 'DupeCount' => 'COUNT(*)', - ), - ), - - - 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId - LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'PermCache perm ON perm.CategoryId = '.TABLE_PREFIX.'CategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId - LEFT JOIN '.TABLE_PREFIX.'%3$sLinkCustomData cust ON %1$s.ResourceId = cust.ResourceId', - - ), // key - special, value - list select sql - - 'ListSortings' => Array( - '' => Array( - 'ForcedSorting' => Array('EditorsPick' => 'desc', 'Priority' => 'desc'), - 'Sorting' => Array('Name' => 'asc', 'Description' => 'desc'), - ) - ), - 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId - LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId - LEFT JOIN '.TABLE_PREFIX.'%3$sLinkCustomData cust ON %1$s.ResourceId = cust.ResourceId'), - - 'SubItems' => Array('l-rev', 'l-ci', 'l-rel', 'l-img', 'l-cdata'), - - 'Fields' => Array ( - 'LinkId' => Array(), - 'Name' => Array('type' => 'string', /*'formatter' => 'kMultiLanguage',*/ 'not_null' => 1, 'required' => 1, 'max_len' => 255), - 'AutomaticFilename' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1), - 'Description' => Array('type' => 'string', /*'formatter' => 'kMultiLanguage',*/ 'default' => ''), - 'Url' => Array('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''), - 'CreatedOn' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'default' => '#NOW#', 'not_null' => 1), - 'Modified' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'default' => '#NOW#', 'not_null' => 1), - 'Expire' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'not_null' => 1,'default' => ''), - 'Hits' => Array('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0), - 'CachedRating' => Array('type' => 'string', 'default' => '0'), - 'CachedVotesQty' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), - 'CachedReviewsQty' => Array('type' => 'int', 'default' => ''), - 'CreatedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => -1), - 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => -1), - 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => ''), - 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), - 'EditorsPick' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), - 'ResourceId' => Array('type' => 'int', 'default' => ''), - 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'OrgId' => Array('type' => 'int', 'default' => ''), - ), - - 'VirtualFields' => Array( - 'UserName' => Array('type' => 'string', 'default' => ''), - 'DupeCount' => Array('type' => 'string', 'default' => ''), - - // export related fields: begin - 'CategoryId' => Array('type' => 'int', 'default' => 0), - 'ExportFormat' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'CSV', /*2 => 'XML'*/), 'default' => 1), - 'ExportFilename' => Array('type' => 'string', 'default' => ''), - 'FieldsSeparatedBy' => Array('type' => 'string', 'default' => ','), - 'FieldsEnclosedBy' => Array('type' => 'string', 'default' => '"'), - 'LineEndings' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'Windows', 2 => 'UNIX'), 'default' => 1), - 'LineEndingsInside' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'CRLF', 2 => 'LF'), 'default' => 2), - 'IncludeFieldTitles' => Array('type' => 'int', 'default' => 1), - 'ExportColumns' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array()), - 'AvailableColumns' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array()), - 'CategoryFormat' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_MixedCategoryPath', 2 => 'la_SeparatedCategoryPath'), 'default' => 1), - 'CategorySeparator' => Array('type' => 'string', 'default' => ':'), - 'IsBaseCategory' => Array('type' => 'int', 'default' => 0), - // export related fields: end - - // import related fields: begin - 'FieldTitles' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Automatic', 2 => 'la_Manual'), 'default' => 1), - 'ImportSource' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Upload', 2 => 'la_Local'), 'default' => 2), - 'ImportFilename' => Array('type' => 'string', 'formatter' => 'kUploadFormatter', 'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => '/admin/export/'), - 'ImportLocalFilename' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'default' => ''), - 'CheckDuplicatesMethod' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_IDField', 2 => 'la_OtherFields'), 'default' => 1), - 'ReplaceDuplicates' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 0), - 'DuplicateCheckFields' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('Name' => 'NAME', 'Url' => 'URL'), 'default' => '|Name|Url|'), - 'SkipFirstRow' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'default' => 1), - // import related fields: end - - 'ThumbnailImage' => Array('type' => 'string', 'default' => ''), - 'FullImage' => Array('type' => 'string', 'default' => ''), - 'ImageAlt' => Array('type' => 'string', 'default' => ''), - - 'Filename' => Array('type' => 'string','not_null' => 1,'default' => ''), - 'CachedNavbar' => Array('type' => 'string', 'default' => ''), - ), - - 'Grids' => Array( - 'Default' => Array( - 'Icons' => Array(0 => 'icon16_link_disabled.gif', 1 => 'icon16_link.gif', 2 => 'icon16_link_pending.gif', -2 => 'icon16_link_pending.gif', 'HOT' => 'icon16_link_hot.gif', 'POP' => 'icon16_link_pop.gif', 'NEW' => 'icon16_link_new.gif', 'PICK' => 'icon16_link_pick.gif'), - 'Fields' => Array( - 'Name' => Array( 'title'=>'la_col_LinkName' , 'data_block' => 'grid_checkbox_td'), - 'Url' => Array( 'title'=>'la_col_LinkUrl' ), - 'Description' => Array( 'title'=>'la_col_Description' ), - 'Modified' => Array( 'title'=>'la_col_Modified' ), - ), - - ), - - - 'Duplicates' => Array( 'Icons' => Array('default' => 'icon16_link.gif'), - 'Fields' => Array( - 'Name' => Array( 'title'=>'la_col_LinkName' , 'data_block' => 'grid_checkbox_td'), - 'Url' => Array( 'title'=>'la_col_LinkUrl' ), - 'Description' => Array( 'title'=>'la_col_Description' ), - 'Modified' => Array( 'title'=>'la_col_Modified' ), - ), - - ), - ), - - - 'ConfigMapping' => Array( - 'PerPage' => 'Perpage_Links', - 'ShortListPerPage' => 'Perpage_Links_Short', - 'DefaultSorting1Field' => 'Link_SortField', - 'DefaultSorting2Field' => 'Link_SortField2', - 'DefaultSorting1Dir' => 'Link_SortOrder', - 'DefaultSorting2Dir' => 'Link_SortOrder2', - ), - ); -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.25.2/in-link/admin/import/inlink_import.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.25.2/in-link/admin/import/inlink_import.php (revision 12746) +++ branches/unlabeled/unlabeled-1.25.2/in-link/admin/import/inlink_import.php (revision 0) @@ -1,906 +0,0 @@ -GetVariable('import_category_id'); - -if ( isset($_POST['Action']) && $_POST['Action'] == 'Import') -{ - $objSession->SetVariable('import_user_admin',$_POST['user_admin']); - $objSession->SetVariable('import_user_regular',$_POST['user_regular']); - $objSession->SetVariable('image_name',$_POST['link_image']); - - $objSession->SetVariable('importtodo','initialize'); - $objSession->SetVariable('importstart',0); - $objSession->SetVariable('importtotal',0); - - if((int)$_POST['init_cat'] > 0) - { - $c = $objCatList->GetItemByField('CategoryId', $root_cat_id); - $c->UpdateACL(); - $c->UpdateCachedPath(); - } - - -} -$allgroups = $objGroups->GetAllGroupList(); - -// connection related -$inlink_sql_type = $objSession->GetVariable('import_sql_type'); -$inlink_server = $objSession->GetVariable('import_server'); -$inlink_db = $objSession->GetVariable('import_db'); -$inlink_user = $objSession->GetVariable('import_user'); -$inlink_pass = $objSession->GetVariable('import_pass'); - -// import related -$user_admin = $objSession->GetVariable('user_admin_values'); -$user_regular = $objSession->GetVariable('user_regular_values'); - -if( !isset($c) || !is_object($c) && $root_cat_id ) -$c = $objCatList->GetItemByField('CategoryId', $root_cat_id); - -$image_name=$objSession->GetVariable('image_name'); -$start = $objSession->GetVariable('importstart'); - -$init_cat = $root_cat_id ? $c->Get('CategoryId') : 0; - -//In-Portal -$portalconn = &GetADODBConnection(); - -if( $init_cat == 0) -{ - /*$prefix = GetTablePrefix(); - $sql = 'SELECT ACL - FROM '.$prefix.'PermCache pc, '.$prefix.'Permissions p - WHERE p.PermissionId = pc.PermId AND p.CategoryId = 0 AND p.Permission = \'CATEGORY.VIEW\''; - $acl = $portalconn->GetCol($sql);*/ - $acl = Array(0 => 0); -} -else -{ - $acl = explode(',',$c->GetACL('CATEGORY.VIEW')); -} - -//IN-LINK connection -$linkconn = &ADONewConnection($inlink_sql_type); -$linkconn->NConnect($inlink_server, $inlink_user, $inlink_pass, $inlink_db); - -if(!$linkconn) -{ echo "Database connection failed. DB Type: $sql_type, DB Server: $inlink_server, DB User: $inlink_user, DB Name: $inlink_db"; //fatal; -echo $linkconn->ErrorMsg(); -die(); -} - -//admin only util -$pathtolocal = $pathtoroot.'kernel/'; -require_once ($pathtoroot.'admin/include/elements.php'); -require_once ($pathtoroot.'kernel/admin/include/navmenu.php'); -require_once ($pathtolocal.'admin/include/navmenu.php'); -require_once($pathtoroot.'admin/toolbar.php'); -//Set Section -$section = 'in-portal:inlink_inport'; -//Set Environment Variable -$envar = 'env=' . BuildEnv(); - -$sec = $objSections->GetSection($section); -$objCatToolBar = new clsToolBar(); - -$title = admin_language('la_performing_import').' - '.admin_language('la_Step').' 4'; - - - -$TablePrefix = 'ses_'.$objSession->GetSessionKey().'_'.GetTablePrefix(); - -$olddbname=$inlink_db; -//$newdbname='inportal'; -$newdbname=$g_DBName; -##############creating a temproary table have to be here - -if( GetVar('Action', true) == 'Import' ) -{ - $portalconn->Execute('DROP TABLE IF EXISTS '.$TablePrefix.'import'); - $portalconn->Execute('DROP TABLE IF EXISTS '.$TablePrefix.'importcat'); - $temptable = 'CREATE TABLE '.$TablePrefix.'import (otname varchar(40), oid int(11), ocustomid int(11), oparentid int(11), ntname varchar(40), nid int(11), nrid int(11), npid int(11)) '; - - $portalconn->Execute($temptable); - $cattable ='CREATE TABLE '.$TablePrefix.'importcat (op int(11), np int(11), flag int(11)) '; - $portalconn->Execute($cattable); - $newcat = 1; -} - -global $admin, $pathtoroot; - -require_once ($pathtoroot.'in-link/'.$admin.'/import/status.php'); #for status bar and all visual effects - -$todo= $objSession->GetVariable('importtodo'); - -$total = $objSession->GetVariable('importtotal'); -switch ($todo) -{ - case 'users': - status($start, $total, 'users'); - usersimport(); - //setstart(0,'cats'); #for debugging - break; - case 'cats': - status($start, $total, 'cats'); - catmanager(); - //setstart(0,'links'); #for debugging - break; - case 'links': - status($start, $total, 'links'); - linksimport(); - //setstart(0,'custom');#For debugging only - break; - case 'custom': - status($start, $total, 'custom'); - - customimport(); - //setstart(0,'relcat');#for debuggin only - break; - case 'relcat': - status($start, $total, 'relcat'); - relcatimport(); - //setstart(0,'terminate'); #for debuggin only - break; - case 'terminate': - terminator(); - status(1,1,'terminate'); - break; - default: - status(0,0,'initializing'); - setstart(0,'users'); #to start importing from users first - break; -} - -function terminator() -{ - global $portalconn, $TablePrefix, $adminURL, $objSession; - $query='DROP TABLE IF EXISTS '.$TablePrefix.'import, '.$TablePrefix.'importcat'; - $portalconn->Execute($query); - $objSession->SetVariable('PermCache_UpdateRequired', 1); - $objSession->SetVariable('ReturnScript', 'browse.php'); // redirect to catalog when finished - m_ParseEnv(); // sets default values to "m" prefix, because it is not passed through import anymore - echo ''; -} - -function reload() -{ - //global $newurl; - print ''; -} -function setstart($mystart, $part) -{ - global $objSession; - - $objSession->SetVariable('importstart',$mystart); - $objSession->SetVariable('importtodo',$part); - reload(); -} -function settotal($total) -{ - global $objSession; - $objSession->SetVariable('importtotal',$total); -} - -//users import from inlink to inportal -function usersimport() -{ - global $objUsers, $objSession, $linkconn, $portalconn, $olddbname, - $user_admin,$objGroups, $user_regular, $start, $TablePrefix; - - $counter = 0; - $limit = 350; - $oldtablename = 'inl_users'; - $newtablename = $objUsers->SourceTable; - if ($start == 0) - { - $query='select count(*) as NumUsers from inl_users'; - $row =$linkconn->Execute($query); - if ($row && !$row->EOF) - { - settotal($row->fields['NumUsers']); - - } - } - $query="select * from inl_users LIMIT $start, $limit"; - $row =$linkconn->Execute($query); - while($row && !$row->EOF) - { - $counter++; #needed to know when close to time out - - if ($row->fields['user_name'] != 'root') { - $olduserid=$row->fields['user_id']; - //$Login, $Password, $Email, $CreatedOn, $FirstName='', $LastName='', $Status=2, - // $Phone='', $Street='', $City='', $State='', $Zip='', $Country='' - - if($row->fields['user_status']==1) - { - $Status=1; - } - else - { - if($row->fields['user_pend']==0) - { - $Status=2; - } - else - $Status=0; - } - $u = $objUsers->Add_User( $row->fields['user_name'], $row->fields['user_pass'], $row->fields['email'], - $row->fields['user_date'], $row->fields['first'], $row->fields['last'], - $Status); - $oldid=$row->fields['user_id']; - $oldcustom = $row->fields['user_cust']; - $newid = $u->Get('PortalUserId'); - $resid = $u->Get('ResourceId'); - #adding user to usergroup - - $userpermission = $row->fields['user_perm']; - if ($userpermission==2 || $userpermission==1) - { - $glist = explode(',',$user_admin); - $Primary=1; - for($i=0;$iGetItem($glist[$i]); - $group->AddUser($newid,$Primary,false); - $Primary = 0; - } - } - else - { - $glist = explode(',',$user_regular); - $Primary=1; - for($i=0;$iGetItem($glist[$i]); - $group->AddUser($newid,$Primary,false); - $Primary = 0; - } - } - //$group=$objGroups->GetItem($g); - //$group->AddUser($newid,1); - - #inserting values to the temproary table - $totemp = 'INSERT INTO '.$TablePrefix.'import (otname,oid,ocustomid,oparentid,ntname,nid,nrid,npid) '; - $tovalues= " VALUES ('$oldtablename',$olduserid,$oldcustom,0,'$newtablename', $newid, $resid, 0 )"; - $totemp=$totemp.$tovalues; - $portalconn->Execute($totemp); - } - $row->moveNext(); - } - if ($counter == $limit) - { - setstart($start+$limit, 'users'); - } - else - setstart(0,'cats'); - -} -//END OF USERS IMPORT ^^^^^^^^^^^^^^^^^^^^^ - -//Categories Import -function catmanager() -{ - global $portalconn, $init_cat,$start,$TablePrefix; - if ($start == 0) - { - $counter = catimport(0,$init_cat); - setstart($counter,'cats'); - $portalconn->Execute('UPDATE '.$TablePrefix.'importcat SET flag = 1 WHERE np = '.$init_cat); - } - else - { - - $query='select * from '.$TablePrefix.'importcat WHERE flag=0 LIMIT 0,1'; - $row =$portalconn->Execute($query); - if($row && !$row->EOF) - { - $oldid= $row->fields['op']; - $newid = $row->fields['np']; - $counter= catimport($oldid,$newid); - $query2='UPDATE '.$TablePrefix.'importcat SET flag = 1 WHERE op = '.$oldid.' AND np = '.$newid; - $portalconn->Execute($query2); - setstart($counter+$start-1,'cats'); - //$x=5; - } - else - { - setstart(0,'links'); - } - } -} -#pushes into the quque -function pushid($op,$np) -{ - global $linkconn, $portalconn, $TablePrefix; - $addnew = 'INSERT INTO '.$TablePrefix.'importcat (op,np,flag) VALUES ('.$op.','.$np.',0)'; - $portalconn->Execute($addnew); - -} -function checkifexist($id) -{ - global $linkconn; - $addnew = 'select * from inl_cats where cat_sub = '.$id; - $row =$linkconn->Execute($addnew); - if ($row && !$row->EOF) - { - - if ($row->fields['cat_id'] !=0) - { - return true; - } - else - { - return false; - } - } - else - { - return false; - } -} -#import itself -function catimport($oldparentid, $parentid) -{ - global $objCatList, $linkconn, $objUsers, $linkconn, $portalconn, - $olddbname, $user_admin,$objGroups, $user_regular, $acl,$allgroups, - $c, $start, $TablePrefix, $init_cat; - $counter=0; - - $objCacheCount = new clsCacheCountList(); - if ($start == 0) - { - $query='select count(*) as CatCount from inl_cats'; - $row =$linkconn->Execute($query); - if ($row && !$row->EOF) - { - settotal($row->fields['CatCount']); - $catcount = $row->fields['CatCount']; - - if( is_object($c) ) - { - $catcount += (int)$c->Get('CachedDescendantCatsQty'); - $c->Set('CachedDescendantCatsQty',$catcount); - $c->Update(); - } - - - } - } - - $query='select * from inl_cats WHERE cat_sub = '.$oldparentid; - $oldtablename = 'inl_cats'; - $newtablename = 'Category'; - $row =$linkconn->Execute($query); - if($row && !$row->EOF) - { - $RowCount = $row->NumRows(); - $ResInc = $RowCount; - $ResourceId = GetNextResourceId($ResInc); - } - if($parentid>0) - { - $ParentCat = new clsCategory($parentid); - $Path = $ParentCat->Get('ParentPath'); - } - else - { - global $objConfig; - $Path = prompt_language( $objConfig->Get('Root_Name') ); - } - while($row && !$row->EOF) - { - $counter++; - - if($row->fields['cat_pend'] == 1) - { - $Status = 2; - } - else - { - $Status = ($row->fields['cat_vis'] == 1) ? 1 : 0; - } - - $CreatedById = GetNewID( 'users', $row->fields['cat_id'] ); - - $fields_hash = Array( 'ParentId' => $parentid, - 'Name' => $row->fields['cat_name'], - 'Description' => $row->fields['cat_desc'], - 'CreatedOn' => $row->fields['cat_date'], - 'EditorsPick' => (int)$row->fields['cat_pick'], - 'Status' => $Status, - 'HotItem' => 2, - 'NewItem' => 2, - 'PopItem' => 2, - 'Priority' => 0, - 'MetaKeywords' => $row->fields['meta_keywords'], - 'MetaDescription' => $row->fields['meta_desc'], - 'AutomaticFilename' => 1, - 'Filename' => '', - 'CategoryTemplate' => '', - 'ItemTemplate' => '', - 'CreatedById' => (int)$CreatedById, - 'CachedDescendantCatsQty' => (int)$row->fields['cat_cats'], - 'ResourceId' => $ResourceId, - ); - - $cat =& $objCatList->Add_NEW($fields_hash, true); - $ResourceId++; - - $FullPath = $Path.$cat->Get('CategoryId').'|'; - $cat->Set('ParentPath',$FullPath); - $cat->SetViewPerms('CATEGORY.VIEW',$acl,$allgroups); - $cat->SetViewPerms('LINK.VIEW',$acl,$allgroups); - $cat->Update(); - $cat->UpdateCachedPath(); - - $objCacheCount->CategoryId= $cat->Get('CategoryId'); - $objCacheCount->SetValue(0,0,0,0,0); - - $newid = $cat->Get('CategoryId'); - $resid = $cat->Get('ResourceId'); - $oldid = $row->fields['cat_id']; - $oldcustom = $row->fields['cat_cust']; - $oldpid = $row->fields['cat_sub']; - - #inserting values to the temproary table - $totemp = 'INSERT INTO '.$TablePrefix.'import (otname,oid,ocustomid,oparentid,ntname,nid,nrid,npid) '; - $tovalues= " VALUES ('$oldtablename',$oldid,$oldcustom,$oldpid,'$newtablename', $newid, $resid, $parentid )"; - $totemp=$totemp.$tovalues; - $portalconn->Execute($totemp); - - #pushes into the queue - if(checkifexist($oldid)) - { - pushid($oldid,$newid); - } - $row->moveNext(); - } - // disable lost+found category (if found one) - $tmp_cat = $objCatList->GetItemByField('Name','Lost+Found'); - if( is_object($tmp_cat) ) - { - $tmp_cat->Set('Status',0); - $tmp_cat->Update(); - } - return $counter; -} - -//Links Import -function linksimport() -{ - global $objLinkList, $init_cat, $linkconn, $portalconn, $olddbname, - $user_admin,$objGroups, $user_regular, $start, $TablePrefix; - $limit = 200; #need to change to a higher number like 100, forty is only for debugging - $counter = 0; - set_time_limit(0); - if ($start == 0) - { - $query = 'select count(*) as LinkCount from inl_lc'; - $row =$linkconn->Execute($query); - if ($row && !$row->EOF) - { - settotal($row->fields['LinkCount']); - - } - } - - // create index - what links are in what categories - $LimitClause = ' LIMIT '.$start.','.$limit; - $sql = 'SELECT link_id FROM inl_links ORDER BY link_id'.$LimitClause; - $LinkIDs = $linkconn->GetCol($sql); - - if( count($LinkIDs) > 0 ) - { - $LinkCatIndex = Array(); - $PendingLinks = Array(); - $sql = "SELECT * FROM inl_lc WHERE link_id IN (%s)"; - - $rs = $linkconn->Execute( sprintf($sql, implode(',', $LinkIDs) ) ); - while(!$rs->EOF) - { - $rec =& $rs->fields; - if( !isset($PendingLinks[ $rec['link_id'] ]) && $rec['link_pend'] == 1 ) - $PendingLinks[ $rec['link_id'] ] = 1; - - $LinkCatIndex[ $rec['link_id'] ][] = $rec['cat_id']; - $rs->MoveNext(); - } - } - - // get links - $query = 'SELECT * FROM inl_links ORDER BY link_id'.$LimitClause; // get links info - $row = $linkconn->Execute($query); // row is recordset here, not easy to figure out by variable name :( - if($row && !$row->EOF) - { - $RowCount = $row->NumRows(); - $ResInc = $RowCount; - $ResourceId = GetNextResourceId($ResInc); - } - - $get_cat_sql = "SELECT nid FROM %simport WHERE ntname = 'Category' AND oid = %s"; - - while($row && !$row->EOF) - { - $counter++; - $oldid = $row->fields['link_id']; - $flag = 1; - - $Pending = isset($PendingLinks[$oldid]); - - // create new link - - #gets the new user id of the user who created a link - if( !$row->fields['link_user'] ) - $newuserid = -1; - else - $newuserid = GetNewID('users', $row->fields['link_user'] ); - - #adds link to the IN-PORTAL - $link = new clsLink(); - $Status = ($Pending == 0) ? 1 : 2; - - $link->Set( array( 'Name', 'Description', 'Url', 'CreatedOn', 'Status', 'EditorsPick', - 'NewItem','PopItem','HotItem', 'CreatedById', 'CachedRating', - 'CachedVotesQty','Hits', 'Priority','Expire'), - array( $row->fields['link_name'], $row->fields['link_desc'], $row->fields['link_url'], $row->fields['link_date'], $Status, - $row->fields['link_pick'], 2, 2, 2, $newuserid, (int)$row->fields['link_rating'], - (int)$row->fields['link_votes'],(int)$row->fields['link_hits'], 0,$row->fields['link_expires'])); - - $link->Set('ResourceId',$ResourceId); - $ResourceId++; - $link->Create(); - - // add link to desired categories (add 1st category found as primary) - $cats = $LinkCatIndex[$oldid]; - $PrimaryCat = 1; - foreach($cats as $OldCatID) - { - $categoryid = $portalconn->GetOne( sprintf($get_cat_sql, $TablePrefix, $OldCatID) ); - $link->AddToCategory($categoryid, '', $PrimaryCat); - if($PrimaryCat) - { - $PrimaryCat = 0; - $oldcatid = $OldCatID; - } - } - - $newid = $link->Get('LinkId'); - $resid = $link->Get('ResourceId'); - $oldcustom = $row->fields['link_cust']; - $linkimage = $row->fields['link_image']; - - if($linkimage) addimage($resid,$linkimage); - - #calls to import reviews - reviewimport($link,$oldid,$resid); - - $totemp = 'INSERT INTO '.$TablePrefix.'import (otname,oid,ocustomid,oparentid,ntname,nid,nrid,npid) '; - $tovalues= " VALUES ('inl_links',$oldid,$oldcustom,$oldcatid,'link', $newid, $resid, 0 )"; - $totemp = $totemp.$tovalues; - $portalconn->Execute($totemp); - - #prelast while - $row->moveNext(); - } - - if ($counter == $limit) - { - setstart($start + $limit, 'links'); - } - else - { - $sql = 'UPDATE '.GetTablePrefix().'CategoryItems SET CategoryId = '.$init_cat.' WHERE CategoryId = 0 AND PrimaryCat = 1'; - $portalconn->Execute($sql); - setstart(0,'custom'); - } - -} - -#importing image from the in-link -function addimage($resourceid, $imageurl) -{ - global $objImageList, $image_name; - #echo "
    IMAGE RESOURCEID: $resourceid IMAGE URL: $imageurl
    "; - if(!is_object($objImageList)) - $objImageList = new clsImageList(); - - $LocalImage = 0; - $LocalThumb = 0; - if(!strlen($image_name)) - $image_name='inlink_image'; - - $img = $objImageList->Add($image_name,'',$resourceid, 0, 0,'', $imageurl, 1,0, 1, 0,1); -} -#Reviews Import for links -function reviewimport($myclass,$oldid,$rid) -{ - global $objCustomFieldList, $linkconn, $portalconn; - #ITEM AddReview($createdBy,$reviewText,0) - - $query='select * from inl_reviews where rev_link = '.$oldid; - $row =$linkconn->Execute($query); - while($row && !$row->EOF) - { - $oldreviewuser= $row->fields['rev_user']; - if($oldreviewuser !=0) #meaning was not created by guest - { - $newrid = GetNewID('users', $oldreviewuser); - if ($newrid) - { - $temp=$myclass->AddReview($newrid, $row->fields['rev_text'], $row->fields['rev_pend'], '127.0.0.1', 1, 'In-Link', $row->fields['rev_date']); - } - else - { - $temp=$myclass->AddReview(0, $row->fields['rev_text'], $row->fields['rev_pend'], '127.0.0.1', 1, 'In-Link', $row->fields['rev_date']); - } - } - else #meaning was created by guest - { - $temp=$myclass->AddReview(0, $row->fields['rev_text'], $row->fields['rev_pend'], '127.0.0.1', 1, 'In-Link', $row->fields['rev_date']); - } - $row->moveNext(); - } -} -#HELPER FUNCTION THAT GETS THE NEW ID of the USER - -/** -* @return int -* @param string $IDType -* @param int $OldID -* @desc Returns new id for specified record type ($IDType) with id ($OldID) -*/ -function GetNewID($IDType, $OldID) -{ - global $TablePrefix; - $get_id_sql = "SELECT nid FROM %simport WHERE otname = 'inl_%s' AND oid = %s"; - $db =&GetADODBConnection(); - $id = $db->GetOne( sprintf($get_id_sql, $TablePrefix, $IDType, $OldID) ); - return $id; -} - -//^^^^^^^^^^^^^^^^^^^^^^ABOVE IS LINKS IMPORT - - -#########################################Custom Fields Import -#create a new CustomField first and then -#by selecting all and receiving from one record of inl_config the values of cc1,cc2,cc3,cc4,cc5,cc6,uc1,uc2,uc3,uc4,uc5,uc6,lc1,lc2,lc3,lc4,lc5,lc6 -#go through all import table and if ocustomid occures get the row from inl_custom and -#create CustomMetaData field -#--------------------- -#Regarding CustomField: -#FieldName= cc1,cc2 .... from inl_config -#FieldLabel= value of cc1, cc2 .... -#Type=4 for links 6 for users 0 category -#------------ -#Regarding CustomMetaData -#ResourceId <= link id -#CustomFieldId <= id from the top -#Value = Value from the table custom - -//VVVVV BELOW ARE CUSTOM FIELD IMPORT REQUIRES TO HAVE A TEMPROARY TABLE IMPORT -function customimport() -{ - global $linkconn, $portalconn, $start, $TablePrefix; - $limit = 40; #just for debugging purposes, in real life set it to higher number - $counter = 0; - if ($start == 0) - { - $r = buildfields(); - $query = 'SELECT count(*) as cc from '.$TablePrefix.'import WHERE NOT ocustomid=0'; - $row = $portalconn->Execute($query); - if ($row && !$row->EOF) settotal($row->fields['cc']); - } - else - { - $r = getfields(); - } - - $query = 'SELECT * from '.$TablePrefix.'import WHERE ocustomid != 0 limit '.$start.','.$limit; - $row = $portalconn->Execute($query); - while($row && !$row->EOF) - { - $counter++; - loadcustom($row->fields['ocustomid'],$row->fields['nrid'],$row->fields['otname'],$r); - $row->moveNext(); - } - if ($counter == $limit) - { - setstart($start+$limit, 'custom'); - } - else - { - setstart(0,'relcat'); - } -} - -function loadcustom($customid,$rid,$tablename,$r) -{ - global $linkconn, $objCustomDataList, $objSession; - - $objCustomDataList->Clear(); - switch($tablename) - { - case 'inl_cats': $SessionVar = 'custom_category'; break; - case 'inl_users': $SessionVar = 'custom_user'; break; - case 'inl_links': $SessionVar = 'custom_links'; break; - } - $fields = explode(',', $objSession->GetVariable($SessionVar) ); - - $query = 'select * from inl_custom Where cust_id = '.$customid; - $row = $linkconn->Execute($query); - if($row && $row->RecordCount() ) - { - for($x = 0; $x < count($fields); $x++) - { - $cust = $row->fields[ 'cust'.($x + 1) ]; - if ($cust != '') - { - $fieldid = $r[ $fields[$x] ]; - $objCustomDataList->SetFieldValue($fieldid, $rid, $cust); - } - } - $objCustomDataList->SaveData('l', $rid); - } -} - -function buildfields() #building and populating an array -{ - global $objCustomFieldList, $objSession, $linkconn; - - $application =& kApplication::Instance(); - $ml_helper =& $application->recallObject('kMultiLanguageHelper'); - - // User Custom Fields: - $query = "SELECT * FROM inl_config WHERE name LIKE 'uc%'"; - $row = $linkconn->Execute($query); - $names = Array(); - while($row && !$row->EOF) - { - $data = $row->fields; - $fieldlabel = $data['name']; - if( strlen($data['value']) ) $fieldlabel = $data['value']; - //$f = $objCustomFieldList->AddField(6, $data['name'], $fieldlabel); - $f = $objCustomFieldList->AddField(6, $data['name'], $fieldlabel,1,'la_inlink', 'lu_fieldcustom__'.$data['name'], 'text', ''); - - $r[ $data['name'] ] = $f->Get('CustomFieldId'); // Save ID of created CustomField - $objSession->SetVariable('custom_'.$data['name'], $f->Get('CustomFieldId') ); // Save that ID to session - $names[] = $data['name']; - $row->MoveNext(); - } - $objSession->SetVariable('custom_user',implode(',',$names) ); // save list of user custom fields - $ml_helper->createFields('u-cdata', true); - unset($names); - - // Category Custom Fields: - $names = Array(); - $query = "SELECT * FROM inl_config WHERE name LIKE 'cc%'"; - $row = $linkconn->Execute($query); - while($row && !$row->EOF) - { - $data = $row->fields; - $fieldlabel = $data['name']; - if( strlen($data['value']) ) $fieldlabel = $data['value']; - // DT_USER, $pending_uf, '', 1, 'la_bb', 'lu_fieldcustom__'.$pending_uf, 'text', ''); - $f = $objCustomFieldList->AddField(1, $data['name'], $fieldlabel,1,'la_inlink', 'lu_fieldcustom__'.$data['name'], 'text', ''); - //$f = $objCustomFieldList->AddField(1, $data['name'], $fieldlabel); - - $r[ $data['name'] ] = $f->Get('CustomFieldId'); - $objSession->SetVariable('custom_'.$data['name'], $f->Get('CustomFieldId') ); - $names[] = $data['name']; - $row->MoveNext(); - } - $objSession->SetVariable('custom_category', implode(',',$names) ); - $ml_helper->createFields('c-cdata', true); - unset($names); - - // Links Custom Fields: - $names = Array(); - $query = "SELECT * FROM inl_config WHERE name LIKE 'lc%'"; - $row = $linkconn->Execute($query); - while($row && !$row->EOF) - { - $data = $row->fields; - $fieldlabel = $data['name']; - if( strlen($data['value']) ) $fieldlabel = $data['value']; - //$f = $objCustomFieldList->AddField(4, $data['name'], $fieldlabel); - $f = $objCustomFieldList->AddField(4, $data['name'], $fieldlabel,1,'la_inlink', 'lu_fieldcustom__'.$data['name'], 'text', ''); - $r[ $data['name'] ] = $f->Get('CustomFieldId'); - $objSession->SetVariable('custom_'.$data['name'], $f->Get('CustomFieldId') ); - $names[] = $data['name']; - $row->MoveNext(); - } - $objSession->SetVariable('custom_links', implode(',',$names) ); - $ml_helper->createFields('l-cdata', true); - return $r; -} - -function getfields() #building and populating an array -{ - global $objSession; - - $r = Array(); - $tmp_fields = explode(',', $objSession->GetVariable('custom_user') ); // Array(uc1,uc2,uc3,...) - foreach($tmp_fields as $tmp_name) $r[$tmp_name] = $objSession->GetVariable('custom_'.$tmp_name); - - $tmp_fields = explode(',', $objSession->GetVariable('custom_category') ); - foreach($tmp_fields as $tmp_name) $r[$tmp_name] = $objSession->GetVariable('custom_'.$tmp_name); - - $tmp_fields = explode(',', $objSession->GetVariable('custom_links') ); - foreach($tmp_fields as $tmp_name) $r[$tmp_name] = $objSession->GetVariable('custom_'.$tmp_name); - - return $r; -} - - -################################################Relationships Import - -function relcatimport() -{ - global $linkconn,$objSession, $start; - $limit = 100; - $counter =0; - if ($start == 0) - { - $query='SELECT count(*) from inl_rel_cats'; - $row =$linkconn->Execute($query); - if ($row && !$row->EOF) - { - settotal($row->fields[0]); - - } - } - - $objRelList = new clsRelationshipList(); - $query='select * from inl_rel_cats LIMIT '.$start.', '.$limit; - $row =$linkconn->Execute($query); - while($row && !$row->EOF) - { - $counter++; - $sourceid = newcatrid($row->fields['cat_id']); - $targetid = newcatrid($row->fields['rel_id']); - if ($sourceid !='' && $targetid !='') - { - $r = $objRelList->Add($sourceid, 1,$targetid, 1); - $r->Create(); - } - $row->moveNext(); - } - - if ($counter == $limit) - { - setstart($start + $limit, 'relcat'); - } - else - { - setstart(0,'terminate'); - } - -} -function newcatrid($oid) -{ - global $portalconn, $TablePrefix; - $query2='select * from '.$TablePrefix.'import where otname=\'inl_cats\' and oid = '.$oid; - $row =$portalconn->Execute($query2); - if ($row->fields['nrid']) - { - return $row->fields['nrid']; - } - else - { - return ''; - } -} -// END OF RELATIONSHIP IMPORT -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.44.2/in-link/admin/install/inportal_data.sql =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.44.2/in-link/admin/install/inportal_data.sql (revision 12746) +++ branches/unlabeled/unlabeled-1.44.2/in-link/admin/install/inportal_data.sql (revision 0) @@ -1,265 +0,0 @@ -INSERT INTO ConfigurationAdmin VALUES ('Link_SortField', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 4) AND (IsSystem = 0)', 10.01, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.01, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortField2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 4) AND (IsSystem = 0)', 10.02, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.02, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links', 'la_Text_Links', 'la_link_perpage_prompt', 'text', '', '', 10.03, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_NewDays', 'la_Text_Links', 'la_link_newdays_prompt', 'text', '', '', 10.05, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MinPopRating', 'la_Text_Links', 'la_fld_Link_MinPopRating', 'text', '', '', 10.06, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MaxHotNumber', 'la_Text_Links', 'la_fld_Link_MaxHotNumber', 'text', '', '', 10.08, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_EnhancedLinks', 'la_Text_Links', 'la_link_EnhancedLinks', 'checkbox', '', '', 10.09, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_AllowFreeListings', 'la_Text_Links', 'la_link_AllowFreeListings', 'checkbox', '', '', 10.1, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ShowPick', 'la_Text_Links', 'la_link_editorspick_prompt', 'checkbox', '', '', 10.11, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_UrlStatus', 'la_Text_Links', 'la_link_urlstatus_prompt', 'checkbox', '', '', 10.12, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'ReviewText=la_common_ReviewText,CreatedOn=la_common_CreatedOn', 20.01, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 20.01, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'ReviewText=la_common_ReviewText,date=la_common_CreatedOn', 20.02, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 20.02, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MinPopVotes', 'la_Text_Links', 'la_fld_Link_MinPopVotes', 'text', '', '', 10.07, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_LinkReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 20.03, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links_Short', 'la_Text_Links', 'la_link_perpage_short_prompt', 'text', '', '', 10.04, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Name', 'la_Text_Link_Search', 'la_Link_Name', 'checkbox', '', '', 2, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Description', 'la_Text_Link_Search', 'la_Link_Description', 'checkbox', '', '', 1, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Url', 'la_Text_Link_Search', 'la_Link_Url', 'checkbox', '', '', 5, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CreatedOn', 'la_Text_Link_Search', 'la_Link_CreatedOn', 'checkbox', '', '', 5, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Hits', 'la_Text_Link_Search', 'la_Link_Hits', 'checkbox', '', '', 6, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedRating', 'la_Text_Link_Search', 'la_Link_CatchedRating', 'checkbox', '', '', 7, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedVotesQty', 'la_Text_Link_Search', 'la_Link_CatchedVotesQty', 'checkbox', '', '', 8, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedReviewsQty', 'la_Text_Link_Search', 'la_Link_CatchedReviewsQty', 'checkbox', '', '', 9, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Value', 'la_Text_Links', 'la_prompt_DupReviews', 'text', '', '', 10.13, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Interval', 'la_Text_Links', 'la_prompt_DupReviews', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.13, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Value', 'la_Text_Links', 'la_prompt_DupRating', 'text', '', '', 10.14, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Interval', 'la_Text_Links', 'la_prompt_DupRating', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.14, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('l_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 30.01, 0, 0); -INSERT INTO ConfigurationAdmin VALUES ('l_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 30.02, 0, 0); - -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_links', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_links', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_links', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_links', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_links', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 0, 1); - -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Links', '10', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortField', 'Name', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortOrder', 'asc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortField2', 'Description', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortOrder2', 'desc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_NewDays', '100', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_MinPopRating', '5', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_MaxHotNumber', '5', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_EnhancedLinks', '0', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_AllowFreeListings', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ShowPick', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_UrlStatus', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsSort', 'CreatedOn', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsOrder', 'desc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsSort2', 'ReviewText', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsOrder2', 'asc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_MinPopVotes', '20', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_LinkId', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Name', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Description', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Url', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CreatedOn', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Hits', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CatchedRating', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CatchedVotesQty', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CatchedReviewsQty', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_ReviewById', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Priority', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Status', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_EditorsPick', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_ResourceId', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_HotItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_PopItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_NewItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_ReviewDelay_Value', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_ReviewDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_RatingDelay_Value', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_RatingDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_Root', '{LinkCatId}', 'In-Portal', '') -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Links_Short', '3', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_Highlight_OpenTag', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_Highlight_CloseTag', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LinkReviews_Short', '3', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LinkReviews', '10', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'l_CategoryTemplate', 'inlink/index', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (NULL, 'l_ItemTemplate', 'inlink/detail', 'In-Link', 'in-link:configuration_output'); - -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Keyword_links', '90', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Pop_links', '5', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Rating_links', '5', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Increase_links', '30', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_ShowMultiple_links', '0', 'In-Link', 'in-link:configuration_search'); - -INSERT INTO ConfigurationValues VALUES (NULL, 'StartValidationTime', '0', 'In-Link', ''); -INSERT INTO ConfigurationValues VALUES (NULL, 'LastExpirationTime', '0', 'In-Link', ''); -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_RatingToPop', '5', 'In-Link', 'in-link:configuration_output'); - -INSERT INTO Events VALUES (7, 'LINK.ADD', 2, 0, 'In-Link', 'la_event_link.add', 1) -INSERT INTO Events VALUES (8, 'LINK.MODIFY', 2, 0, 'In-Link', 'la_event_link.modify', 1) -INSERT INTO Events VALUES (9, 'LINK.REVIEW.ADD', 2, 0, 'In-Link', 'la_event_link.review.add', 1) -INSERT INTO Events VALUES (10, 'LINK.ADD', 1, 0, 'In-Link', 'la_event_link.add', 0) -INSERT INTO Events VALUES (11, 'LINK.APPROVE', 1, 0, 'In-Link', 'la_event_link.approve', 0) -INSERT INTO Events VALUES (12, 'LINK.DENY', 1, 0, 'In-Link', 'la_event_link.deny', 0) -INSERT INTO Events VALUES (13, 'LINK.MODIFY', 1, 0, 'In-Link', 'la_event_link.modify', 0) -INSERT INTO Events VALUES (14, 'LINK.MODIFY.APPROVE', 1, 0, 'In-Link', 'la_event_link.modify.approve', 0) -INSERT INTO Events VALUES (15, 'LINK.REVIEW.ADD', 1, 0, 'In-Link', 'la_event_link.review.add', 0) -INSERT INTO Events VALUES (16, 'LINK.REVIEW.APPROVE', 1, 0, 'In-Link', 'la_event_link.review.approve', 0) -INSERT INTO Events VALUES (17, 'LINK.REVIEW.DENY', 1, 0, 'In-Link', 'la_event_link.review.deny', 0) -INSERT INTO Events VALUES (40, 'LINK.ADD.PENDING', 1, 0, 'In-Link', 'la_event_link.add.pending', 0) -INSERT INTO Events VALUES (42, 'LINK.MODIFY.PENDING', 1, 0, 'In-Link', 'la_event_link.modify.pending', 0) -INSERT INTO Events VALUES (43, 'LINK.REVIEW.ADD.PENDING', 1, 0, 'In-Link', 'la_event_link.review.add.pending', 0) -INSERT INTO Events VALUES (46, 'LINK.MODIFY.DENY', 1, 0, 'In-Link', 'la_event_link.modify.deny', 0) -INSERT INTO Events VALUES ('', 'LINK.ENHANCE', '1', '0', 'In-Link', 'la_event_link.link.enhance', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE', '1', '0', 'In-Link', 'la_event_link.link.enhance', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.APPROVE', '0', '0', 'In-Link', 'la_event_link.link.enhance.approve', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.APPROVE', '1', '0', 'In-Link', 'la_event_link.link.enhance.approve', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.DENY', '0', '0', 'In-Link', 'la_event_link.link.enhance.deny', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.DENY', '1', '0', 'In-Link', 'la_event_link.link.enhance.deny', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXPIRE', '1', '0', 'In-Link', 'la_event_link.link.enhance.expire', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXPIRE', '1', '0', 'In-Link', 'la_event_link.link.enhance.expire', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXTEND', '1', '0', 'In-Link', 'la_event_link.link.enhance.extend', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXTEND', '1', '0', 'In-Link', 'la_event_link.link.enhance.extend', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW', '0', '0', 'In-Link', 'la_event_link.link.enhance.renew', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW.FAILED', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_failed', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW.FAILED', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_failed', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.CANCEL', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_cancel', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.CANCEL', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_cancel', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEWAL.NOTICE', '1', '0', 'In-Link', 'la_event_link.link.enhance.renewal_notice', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEWAL.NOTICE', '1', '0', 'In-Link', 'la_event_link.link.enhance.renewal_notice', '0') - -INSERT INTO ItemTypes VALUES (4, 'In-Link', 'l', 'Link', 'Name', 'CreatedById', 'Hits', 'CachedRating', 'la_ItemTab_Links', 1, 'in-link/admin/addlink.php', 'clsLink', 'Link'); - -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.ADD', 'lu_PermName_Link.Add_desc', 'lu_PermName_Link.Add_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.VIEW', 'lu_PermName_Link.View_desc', 'lu_PermName_Link.View_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.ADD.PENDING', 'lu_PermName_Link.Add.Pending_desc', 'lu_PermName_Link.Add.Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.MODIFY', 'lu_PermName_Link.Modify_desc', 'lu_PermName_Link.Modify_desc', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.DELETE', 'lu_PermName_Link.Delete_desc', 'lu_PermName_Link.Delete_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.RATE', 'lu_PermName_Link.Rate_desc', 'lu_PermName_Link.Rate_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.REVIEW', 'lu_PermName_Link.Review_desc', 'lu_PermName_Link.Review_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.REVIEW.PENDING', 'lu_PermName_Link.Review_Pending_desc', ' lu_PermName_Link.Review_Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.MODIFY.PENDING', 'lu_PermName_Link.Modify.Pending_desc', 'lu_PermName_Link.Modify.Pending_desc', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.MODIFY', 'lu_PermName_Link.Owner.Modify_desc', 'lu_PermName_Link.Owner.Modify_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.MODIFY.PENDING', 'lu_PermName_Link.Owner.Modify.Pending_desc', 'lu_PermName_Link.Owner.Modify.Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.DELETE', 'lu_PermName_Link.Owner.Delete_desc', 'lu_PermName_Link.Owner.Delete_error', 'In-Link'); - -INSERT INTO SearchConfig VALUES ('Link', 'OrgId', 0, 0, 'lu_fielddesc_link_orgid', 'lu_field_orgid', 'In-Link', 'la_text_link', 19, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'NewItem', 0, 1, 'lu_fielddesc_link_newitem', 'lu_field_newitem', 'In-Link', 'la_text_link', 18, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'PopItem', 0, 1, 'lu_fielddesc_link_popitem', 'lu_field_popitem', 'In-Link', 'la_text_link', 17, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'HotItem', 0, 1, 'lu_fielddesc_link_hotitem', 'lu_field_hotitem', 'In-Link', 'la_text_link', 16, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'ResourceId', 0, 1, 'lu_fielddesc_link_resourceid', 'lu_field_resourceid', 'In-Link', 'la_text_link', 15, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'EditorsPick', 0, 1, 'lu_fielddesc_link_editorspick', 'lu_field_editorspick', 'In-Link', 'la_text_link', 14, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Status', 0, 0, 'lu_fielddesc_link_status', 'lu_field_status', 'In-Link', 'la_text_link', 13, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Priority', 0, 0, 'lu_fielddesc_link_priority', 'lu_field_priority', 'In-Link', 'la_text_link', 12, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'ModifiedById', 0, 0, 'lu_fielddesc_link_modifiedbyid', 'lu_field_modifiedbyid', 'In-Link', 'la_text_link', 11, 0, 0, 'text', 'PortalUser.Login', '{ForeignTable}.PortalUserId={LocalTable}.ModifiedById', NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CreatedById', 0, 0, 'lu_fielddesc_link_createdbyid', 'lu_field_createdbyid', 'In-Link', 'la_text_link', 10, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedReviewsQty', 0, 0, 'lu_fielddesc_link_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Link', 'la_text_link', 9, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedVotesQty', 0, 0, 'lu_fielddesc_link_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Link', 'la_text_link', 8, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'LinkId', 0, 1, 'lu_fielddesc_link_linkid', 'lu_field_linkid', 'In-Link', 'la_text_link', 0, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Name', 1, 1, 'lu_fielddesc_link_name', 'lu_field_name', 'In-Link', 'la_text_link', 1, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Description', 1, 1, 'lu_fielddesc_link_description', 'lu_field_description', 'In-Link', 'la_text_link', 2, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Url', 1, 1, 'lu_fielddesc_link_url', 'lu_field_url', 'In-Link', 'la_text_link', 3, 0, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CreatedOn', 0, 1, 'lu_fielddesc_link_createdon', 'lu_field_createdon', 'In-Link', 'la_text_link', 4, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Modified', 0, 1, 'lu_fielddesc_link_modified', 'lu_field_modified', 'In-Link', 'la_text_link', 5, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Hits', 0, 1, 'lu_fielddesc_link_hits', 'lu_field_hits', 'In-Link', 'la_text_link', 6, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedRating', 0, 0, 'lu_fielddesc_link_cachedrating', 'lu_field_cachedrating', 'In-Link', 'la_text_link', 7, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); - -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) as LinkCount FROM <%prefix%>Link WHERE Status=1', NULL, 'la_prompt_ActiveLinks', 0, 1); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS TotalLinks FROM <%prefix%>Link', NULL, 'la_prompt_TotalLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS ActiveLinks FROM <%prefix%>Link WHERE Status = 1', NULL, 'la_prompt_ActiveLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS PendingLinks FROM <%prefix%>Link WHERE Status = 2', NULL, 'la_prompt_PendingLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS DisabledLinks FROM <%prefix%>Link WHERE Status = 0', NULL, 'la_prompt_DisabledLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS NewLinks FROM <%prefix%>Link WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Link_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>Link WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS HotLinks FROM <%prefix%>Link WHERE (HotItem = 1) OR (Hits >= <%m:config name="Link_MaxHotNumber"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS PopularLinks FROM <%prefix%>Link WHERE (PopItem = 1) OR ( (CachedRating >= <%link:hit_count type="top"%>) AND <%link:hit_count type="top"%> AND (PopItem = 2) )', NULL, 'la_prompt_PopularLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Link WHERE CachedRating > 0', NULL, 'la_prompt_LinksAverageRating', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT MAX(Hits) AS MaxLinksHits FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksHits', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT MAX(CachedVotesQty) AS MaxLinksVotes FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksVotes', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_NewestLinkDate', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_LastLinkUpdate', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_LinkReviews', 0, 2); - -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 14, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 14, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD.PENDING', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.DELETE', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.DELETE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.MODIFY', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.DELETE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.DELETE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.DELETE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:inlink_general.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:inlink_general.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_output.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_output.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_search.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_search.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_email.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_email.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.advanced:approve', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.advanced:decline', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.delete', 11, 1, 1, 0); - -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('in-link', 'In-Link', 'inlink_import', 'Intechnic In-Link 2.x', 'In-Link', 'link_image,user_admin,user_regular,init_cat', 1,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Gossamer Threads Links 2.x', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Gossamer Threads Links 2.x SQL version', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Sentraweb Indexu 3.x', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Links from CSV file [In-Link]', '', '', 1, 'csv'); - -INSERT INTO CustomField (Type, FieldName, FieldLabel, Heading, Prompt, ElementType, ValueList, DisplayOrder, OnGeneralTab, IsSystem) VALUES (1, 'l_ItemTemplate', 'l_ItemTemplate', 'la_title_SystemCF', 'l_ItemTemplate', 'text', NULL, 0, 0, 1); - -INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('In-Link', 'in-link/', 'l', '4.0.1', 1, 1, 'inlink/', 2, '1054738405'); \ No newline at end of file Index: branches/unlabeled/unlabeled-1.20.2/in-link/units/listings/listings_event_handler.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.20.2/in-link/units/listings/listings_event_handler.php (revision 12746) +++ branches/unlabeled/unlabeled-1.20.2/in-link/units/listings/listings_event_handler.php (revision 0) @@ -1,680 +0,0 @@ -Application->setUnitOption($event->Prefix,'AutoLoad',false); - $object =& $event->getObject(); - - $items_info = $this->Application->GetVar('l'); - if(is_array($items_info)) - { - $items_info = array_keys($items_info); - $link_id = array_shift($items_info); - - $object->SetDBField('ItemResourceId', $link_id); - $object->IgnoreValidation = true; - // $this->RemoveRequiredFields($object); - $object->Update(); - } - - $this->finalizePopup($event,'ls','in-link/paid_listings/paid_listing_edit'); - } - - function OnPreSaveListing(&$event) - { - $event->redirect=false; - $this->Application->setUnitOption($event->Prefix,'AutoLoad',false); - $object =& $event->getObject(); - $object->IgnoreValidation = true; - // $this->RemoveRequiredFields($object); - $event->CallSubEvent('OnPreSave'); - $this->Application->SetVar($event->getPrefixSpecial(true).'_id', $object->GetId()); - return; - } - - function OnBeforeItemUpdate(&$event) - { - $object =& $event->getObject(); - if($object->IgnoreValidation) - { - $object->UpdateFormattersMasterFields(); - } - } - - function OnBeforeItemCreate(&$event) - { - $object =& $event->getObject(); - if($object->IgnoreValidation) - { - $object->UpdateFormattersMasterFields(); - } - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnBeforeDeleteFromLive(&$event) - { - $object =& $event->getObject(); - $sql = 'SELECT * FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ListingId = '.$object->GetId(); - $original_values = $this->Conn->GetRow($sql); - - $type_modified = ($object->GetDBField('ListingTypeId') != $original_values['ListingTypeId']); - $link_modified = ($object->GetDBField('ItemResourceId') != $original_values['ItemResourceId']); - $status_modified = ($object->GetDBField('Status') != $original_values['Status']); - - if($status_modified) - { - $email_event = $object->GetDBField('Status') ? 'LINK.ENHANCE.APPROVE' : 'LINK.ENHANCE.APPROVE'; - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser($email_event, $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin($email_event); - } - - if( $type_modified || $link_modified ) - { - $this->ResetLink($original_values); - } - - if( $status_modified || $type_modified || $link_modified ) - { - $this->EnhanceLink($object, $original_values); - } - - if( $status_modified && !($type_modified || $link_modified) ) - { - $this->ResetLink($original_values); - } - } - - function EnhanceLink(&$object, $original_values) - { - if ($object->GetDBField('Status') != STATUS_ACTIVE) { - return false; - } - - if ($object->GetDBField('ExpiresOn') < adodb_mktime()) { - $object->SetDBField('Status', STATUS_PENDING); - $object->Update(); - $this->ResetLink($original_values); - return false; - } - - $this->UpdateLink('OnPurchase', $object->GetDBField('ItemResourceId'), $object->GetDBField('ListingTypeId')); - - $listtype_object =& $this->Application->recallObject('lst'); - if( $listtype_object->GetDBField('OnPurchaseAddToCatEnabled') ) - { - $link_object =& $this->Application->recallObject('l'); - $add_to_cat = (int)$listtype_object->GetDBField('OnPurchaseAddToCat'); - $sql = 'DELETE FROM '.$this->Application->getUnitOption('ci', 'TableName').' - WHERE CategoryId = '.$add_to_cat.' - AND ItemResourceId = '.$link_object->GetDBField('ResourceId').' - AND PrimaryCat = 0'; - $this->Conn->Query($sql); - $sql = 'INSERT INTO '.$this->Application->getUnitOption('ci', 'TableName').' - (CategoryId, ItemResourceId, PrimaryCat) - VALUES ('.$add_to_cat.', '.$link_object->GetDBField('ResourceId').', 0)'; - $this->Conn->Query($sql); - } - } - - function ResetLink($original_values) - { - static $has_been_reset = Array(); - - if( $original_values['Status'] != STATUS_ACTIVE || - getArrayValue($has_been_reset, $original_values['ListingId']) ) - { - return; - } - - $has_been_reset[$original_values['ListingId']] = 1; - - $this->UpdateLink('OnExpire', $original_values['ItemResourceId'], $original_values['ListingTypeId']); - - $listtype_object =& $this->Application->recallObject('lst'); - if( $listtype_object->GetDBField('OnExpireRemoveFromCatEnabled') ) - { - $remove_from_cat = $listtype_object->GetDBField('OnExpireRemoveFromCat'); - $sql = 'DELETE FROM '.$this->Application->getUnitOption('ci', 'TableName').' - WHERE ItemResourceId = '.$original_values['ItemResourceId'].' - AND CategoryId = '.$remove_from_cat.' - AND PrimaryCat = 0'; - $this->Conn->Query($sql); - } - } - - function UpdateLink($action_prefix, $resource_id, $listtype_id) - { - - $link_object =& $this->Application->recallObject('l', null, Array('skip_autoload' => true)); - $link_object->Load($resource_id, 'ResourceId'); - - - $listtype_object =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listtype_object->Load($listtype_id); - - $action_fields = Array( 'EdPick' => 'EditorsPick', - 'New' => 'NewItem', - 'Hot' => 'HotItem', - 'Pop' => 'PopItem' - ); - // $action_prefix = 'OnPurchase'; - - foreach($action_fields as $action => $field) - { - $action_value = $listtype_object->GetDBField($action_prefix.$action); - if( $action_value != 3 ) - { - $link_object->SetDBField($field, $action_value); - } - } - - $priority_value = $listtype_object->GetDBField($action_prefix.'PriorityValue'); - switch( $listtype_object->GetDBField($action_prefix.'PriorityAction') ) - { - case 1: // equal - $link_object->SetDBField('Priority', $priority_value); - break; - case 2: // increase - $original_priority = $link_object->GetDBField('Priority'); - $link_object->SetDBField('Priority', $original_priority + $priority_value); - break; - case 3: // decrease - $original_priority = $link_object->GetDBField('Priority'); - $link_object->SetDBField('Priority', $original_priority - $priority_value); - break; - default: - } - - $link_object->Update(); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnRequestEnhancement(&$event) - { - $sql = 'SELECT Loaded - FROM '.$this->Application->getUnitOption('mod', 'TableName').' - WHERE Name = "In-Commerce"'; - $incommerce_on = $this->Conn->GetOne($sql) ? 1 : 0; - if ($incommerce_on) { - $l_info = $this->Application->GetVar('l'); - if (!$l_info) { - return false; - } - - list($link_id, $link_info) = each($l_info); - $listing_type_id = $link_info['ListingTypeId']; - - $listing_type =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing_type->Load($listing_type_id); - - if ($listing_type->GetDBField('EnableBuying')) { - $add_to_cart_event =& new kEvent('ord:OnAddVirtualProductToCart'); - $this->Application->HandleEvent($add_to_cart_event); - if($add_to_cart_event->redirect) - { - $event->SetRedirectParam('pass', 'm'); - $event->redirect = $add_to_cart_event->redirect; - } - return true; - } - } - - $event->CallSubEvent('OnListingCreate'); - } - - /** - * Create listing or extend existing listing period - * - * @param kEvent $event - */ - function OnListingCreate(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - - switch ($event->Name) { - case 'EnhanceLinkAfterOrderApprove': - case 'EnhancedLinkOnCompleteOrder': - // when order with listing virtual product is approved - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $listing_type_id = $item_data['ListingTypeId']; - $link_id = $item_data['LinkId']; - - $new_processing = getArrayValue($item_data, 'HasNewProcessing'); - break; - - case 'OnListingCreate': - // when requesting enhancement from front (and not via in-commerce) - $links_info = $this->Application->GetVar('l'); - if (!$links_info) return false; - - $event->redirect = false; - list($link_id, $link_info) = each($links_info); - $listing_type_id = $link_info['ListingTypeId']; - - $new_processing = false; - break; - } - - // get resource_id of link beeing enhanced - $sql = 'SELECT ResourceId - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $resource_id = $this->Conn->GetOne($sql); - - // get listing by link's resource_id - $object->Load($resource_id, 'ItemResourceId'); - if ($object->isLoaded()) { - $original_values = $object->FieldValues; - } - else { - // set initial fields to listing - $object->SetDBField('ListingTypeId', $listing_type_id); - $object->SetDBField('ItemResourceId', $resource_id); - - if ($event->Name == 'OnListingCreate' || $new_processing) { - $item_status = STATUS_PENDING; - } - else { - $item_status = STATUS_ACTIVE; - } - - $object->SetDBField('Status', $item_status); - } - - // set date of purchase for new listings - $purchased_on = max(adodb_mktime(), $object->GetDBField('ExpiresOn')); - if (!$object->isLoaded()) { - $object->SetDBField('PurchasedOn_date', $purchased_on); - $object->SetDBField('PurchasedOn_time', $purchased_on); - } - - // set expiration time for listing - $listing_type =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing_type->Load($listing_type_id); - - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $listing_type->GetDBField('Duration'); - $duration_type = $listing_type->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $expiration_date = $purchased_on + $expiration_interval; - $object->SetDBField('ExpiresOn_date', $expiration_date); - $object->SetDBField('ExpiresOn_time', $expiration_date); - - // when extending enhancement mark listing as non-received renewal reminder - $object->SetDBField('RenewalReminderSent', 0); - - $action = $object->isLoaded() ? 'Update' : 'Create'; - if ($object->$action()) { - $event->status = erSUCCESS; - switch ($event->Name) { - case 'EnhanceLinkAfterOrderApprove': - case 'EnhancedLinkOnCompleteOrder': - // when order with listing virtual product is approved - if (getArrayValue($original_values, 'Status') != STATUS_ACTIVE) { - $this->EnhanceLink($object, Array()); - } - break; - - case 'OnListingCreate': - // when requesting enhancement from front (and not via in-commerce) - $event->redirect = $this->Application->GetVar('success_template'); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE'); - break; - } - - - } - else { - $event->status = erFAIL; - } - - - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function EnhancedLinkOnCompleteOrder(&$event) - { - // create enhancement, but pending - $this->OnListingCreate($event); - - // save created listing_id back to itemdata - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - unset($item_data['ListingTypeId']); - $item_data['ListingId'] = $object->GetID(); - - $orditems_idfield = $this->Application->getUnitOption('orditems', 'IDField'); - $orditems_table = $this->Application->getUnitOption('orditems', 'TableName'); - - $this->Conn->doUpdate( Array('ItemData' => serialize($item_data)), $orditems_table, $orditems_idfield.' = '.$fields['OrderItemId'] ); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function EnhanceLinkAfterOrderApprove(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - - if ( getArrayValue($item_data, 'HasNewProcessing') ) { - // new processing: just approve created listing here - $listing_id = $item_data['ListingId']; - $object->Load($listing_id); - $object->SetDBField('Status', STATUS_ACTIVE); - $object->Update(); - - $this->EnhanceLink($object, Array()); - return true; - } - else { - // create listing & approve it at the same time - $this->OnListingCreate($event); - } - } - - /** - * Delete listing - * - * @param kEvent $event - */ - function EnhanceLinkAfterOrderDeny(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $listing_id = $item_data['ListingId']; - - $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); - $temp_handler->DeleteItems($event->Prefix, $event->Special, Array($listing_id)); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function ExpireLink(&$event) - { - $this->Application->setUnitOption($event->Prefix, 'AutoLoad', false); - $object =& $event->getObject(); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$item_data['LinkId']; - $listing_id = $this->Conn->GetOne($sql); - $object->Load($listing_id); - $original_values = $object->FieldValues; - $object->SetDBField('Status', 2); - - if($object->Update()) - { - $event->status = erSUCCESS; - $this->ResetLink($original_values); - } - else - { - $event->status = erFAIL; - } - } - - function iterateItems(&$event) - { - $this->Application->setUnitOption($event->Prefix, 'AutoLoad', false); - $object =& $event->getObject(); - $this->StoreSelectedIDs($event); - - if($event->Name == 'OnMassApprove') - { - $ids = $this->getSelectedIDs($event); - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') != 1) - { - $original_values = $object->FieldValues; - $object->SetDBField('Status', 1); - $this->EnhanceLink($object, $original_values); - } - } - } - if($event->Name == 'OnMassDecline') - { - $ids = $this->getSelectedIDs($event); - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') == 1) - { - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.DENY', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.DENY'); - } - } - } - parent::iterateItems($event); - if($event->Name == 'OnMassApprove') - { - $this->Application->setUnitOption('lst', 'AutoLoad', false); - $lst_object =& $this->Application->recallObject('lst'); - $ids = $this->getSelectedIDs($event); - if($ids) - { - foreach($ids as $id) - { - $object->Load($id); - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $owner_id = $this->Conn->GetOne($sql); - if($object->GetDBField('PendingRenewal') == 1) - { - $lst_object->Load( $object->GetDBField('ListingTypeId') ); - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $lst_object->GetDBField('Duration'); - $duration_type = $lst_object->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $renewal_begins = max( adodb_mktime(), $object->GetDBField('ExpiresOn') ); - $expiration_date = $renewal_begins + $expiration_interval; - - $object->SetDBField('ExpiresOn_date', $expiration_date); - $object->SetDBField('ExpiresOn_time', $expiration_date); - - $object->SetDBField('RenewalReminderSent', 0); - $object->SetDBField('PendingRenewal', 0); - - if( $object->Update() ) - { - $event->status=erSUCCESS; - $event->redirect_params = Array('opener' => 's', 'pass_events' => true); //stay! - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.RENEW', $owner_id); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.RENEW'); - } - else - { - $event->status=erFAIL; - $event->redirect=false; - break; - } - } - else - { - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.APPROVE', $owner_id); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.APPROVE'); - } - } - } - } - } - - function OnCancel(&$event) - { - $event->redirect = $this->Application->GetVar('cancel_template'); - } - - function OnExtendEnhancement(&$event) - { - $link_id = $this->Application->GetVar('l_id'); - $sql = 'SELECT ResourceId FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $link_resource_id = $this->Conn->GetOne($sql); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$link_resource_id; - - $this->Application->setUnitOption($event->Prefix, 'AutoLoad', false); - $object =& $event->getObject(); - $object->Load( $this->Conn->GetOne($sql) ); - - $object->SetDBField('PendingRenewal', 1); - $object->Update(); - $event->redirect = $this->Application->GetVar('success_template'); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.EXTEND', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.EXTEND'); - } - - function OnCancelEnhancement(&$event) - { - $link_id = $this->Application->GetVar('l_id'); - $sql = 'SELECT ResourceId FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $link_resource_id = $this->Conn->GetOne($sql); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$link_resource_id; - - $this->Application->setUnitOption($event->Prefix, 'AutoLoad', false); - $object =& $this->Application->recallObject( $event->Prefix ); - $object->Load( $this->Conn->GetOne($sql) ); - $original_values = $object->FieldValues; - $original_values['Status'] = 1; - $this->ResetLink($original_values); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.CANCEL', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.CANCEL'); - - $object->Delete(); - $event->redirect = $this->Application->GetVar('success_template'); - } - - function OnCheckExpiredPaidListings(&$event) - { - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ExpiresOn < '.adodb_mktime().' AND Status = 1'; - $expired_listings = $this->Conn->GetCol($sql); - if(is_array($expired_listings) && count($expired_listings) > 0) - { - $this->Application->setUnitOption($event->Prefix, 'AutoLoad', false); - $object =& $this->Application->recallObject($event->Prefix.'.-item'); - foreach($expired_listings as $listing_id) - { - $object->Load($listing_id); - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - $object->SetDBField('Status', 2); - $object->Update(); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.EXPIRE', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.EXPIRE'); - } - } - - $sql = 'SELECT ls.ListingId, l.CreatedById FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' ls - LEFT JOIN '.$this->Application->getUnitOption('lst', 'TableName').' lst - ON ls.ListingTypeId = lst.ListingTypeId - LEFT JOIN '.$this->Application->getUnitOption('l', 'TableName').' l - ON ls.ItemResourceId = l.ResourceId - WHERE ls.Status = 1 - AND ls.ExpiresOn < '.adodb_mktime().' + lst.RenewalReminder * 3600 *24 - AND ls.RenewalReminderSent = 0'; - $res = $this->Conn->Query($sql); - if(is_array($res) && count($res) > 0) - { - $listing_ids = Array(); - foreach($res as $record) - { - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.RENEWAL.NOTICE', $record['CreatedById']); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.RENEWAL.NOTICE'); - $listing_ids[] = $record['ListingId']; - } - $sql = 'UPDATE '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - SET RenewalReminderSent = 1 - WHERE ListingId IN ('.implode(',', $listing_ids).')'; - $this->Conn->Query($sql); - } - } - - function OnMassDelete(&$event) - { - $this->Application->setUnitOption($event->Prefix, 'AutoLoad', false); - $object =& $event->getObject(); - $this->StoreSelectedIDs($event); - - $ids = $this->getSelectedIDs($event); - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') == 1) - { - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - } - } - parent::OnMassDelete($event); - } -} - -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.17.2/in-link/admin_templates/paid_listings/paid_listing_type_edit.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.17.2/in-link/admin_templates/paid_listings/paid_listing_type_edit.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.17.2/in-link/admin_templates/paid_listings/paid_listing_type_edit.tpl (revision 0) @@ -1,212 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - - - "> - - - - - - "> - - - - - - "> - - - - - - "> - - - - - - "> - - - - - - "> - - - - - - "> - - - - - - "> - - - - - - - " value="" /> - - - - ', '', null, 'OnPreSaveListingType');"> - - - - - - - - - - - "> - - - - - -
    - " id="" value="" tabindex="" size="5"> - -  
    - " id="" value="" tabindex="" size="5"> - -  
     
    - - - -
    - - - -
    - - - -
    - - - -
    - - " id="" value="" tabindex="" size="5"> - - - " id="" value="" tabindex="" size="5"> -
    - " name="" value=""> - " type="checkbox" id="_cb_" name="_cb_" onclick="update_checkbox(this, document.getElementById(''))"> - - - - - - - " name="" value=""> - " type="checkbox" id="_cb_" name="_cb_" onclick="update_checkbox(this, document.getElementById(''))"> - - - - - -
    - - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.17.2/in-link/admin_templates/catalog_tab.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.17.2/in-link/admin_templates/catalog_tab.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.17.2/in-link/admin_templates/catalog_tab.tpl (revision 0) @@ -1,74 +0,0 @@ - - - - a_toolbar.AddButton( new ToolBarButton('in-link:new_link', '', function() { - std_precreate_item('', 'in-link/links/links_edit'); - }, true - ) ); - - - - - - - - - - - - - $Catalog.setItemCount('', ''); - $Catalog.setCurrentCategory('', ); - - - - - Grids[''].AddAlternativeGrid('', true); - - Grids[''].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','sep3','cut','copy','move_up','move_down','sep6')); - $Catalog.reflectPasteButton(); - $Catalog.setViewMenu(''); - - Grids[''].EnableRadioMode(); - Grids[''].DblClick = function() {return false}; - - #separator# - - - _" sequence="" width="%"> - - checkboxradio" name="" id=""> - "> - - - - " target="_blank"> - - - -
    -
    - - [ID: / ] Filename: - -
    - - (Added: / - Hits: / - Rating: / - Votes: / - Reviews: ) - -
    -
    - - - - - - - - -
    - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.15.16/in-link/admin/addlink_category.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.15.16/in-link/admin/addlink_category.php (revision 12746) +++ branches/unlabeled/unlabeled-1.15.16/in-link/admin/addlink_category.php (revision 0) @@ -1,251 +0,0 @@ -SourceTable = $objSession->GetEditTable("Link"); -$objEditItems->EnablePaging = FALSE; -//Multiedit init -$en = (int)$_GET["en"]; -$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); -$itemcount=$objEditItems->NumItems(); -$c = $objEditItems->GetItemByIndex($en); - -if($itemcount>1) -{ - if ($en+1 == $itemcount) - $en_next = -1; - else - $en_next = $en+1; - - if ($en == 0) - $en_prev = -1; - else - $en_prev = $en-1; -} - -$action = "l_edit_link"; -$envar = "env=" . BuildEnv() . "&en=$en"; - -//Set Section -$section = 'in-link:editlink_category'; -$formaction = $_SERVER["PHP_SELF"]."?".$envar; -$saveURL = $admin."/".$objSession->GetVariable('ReturnScript'); -//Set Environment Variable -//Display header -$sec = $objSections->GetSection($section); - -$objListToolBar = new clsToolBar(); -$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('save_edit_buttons','LinkEditStatus','".$saveURL."',1);","tool_select.gif"); -$objListToolBar->Add("img_cancel", - "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", - "swap('img_cancel', 'toolbar/tool_cancel.gif');", - "do_edit_save('save_edit_buttons','LinkEditStatus','".$saveURL."',2);", - "tool_cancel.gif"); -if($itemcount == 1) $objListToolBar->Add("divider"); -$objListToolBar->Set("section",$section); -$objListToolBar->Set("load_menu_func",""); -$objListToolBar->Set("CheckClass","PermChecks"); -$objListToolBar->Set("CheckForm","link"); - -//Display header -$sec = $objSections->GetSection($section); - -$sec = $objSections->GetSection($section); - - -if( isset($en_prev) || isset($en_next) ) -{ - $url = 'in-link/admin/addlink_category.php'; - $StatusField = 'LinkEditStatus'; - $form = 'link'; - MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get('OnClick')); - $objListToolBar->Add("divider"); -} - - -$listImages = array(); - //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick - -$objListToolBar->Add("new_cat", "la_ToolTip_New_Category","#".$envar,"swap('new_cat','toolbar/tool_new_cat_f2.gif');", - "swap('new_cat', 'toolbar/tool_new_cat.gif');", - "OpenCatSelector('$envar&source=addarticle_category&destform=popup&destfield=CatList');", - "tool_new_cat.gif"); - -$objListToolBar->Add("cat_del","la_ToolTip_Delete","#", "if (PermChecks.itemChecked()) swap('cat_del','toolbar/tool_delete_f2.gif');", - "if (PermChecks.itemChecked()) swap('cat_del', 'toolbar/tool_delete.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addlink_category', 'l_cat_delete');", - "tool_delete.gif", FALSE, TRUE); -$listImages[] = "PermChecks.addImage('cat_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); "; - -// Set Primary Category -$objListToolBar->Add("cat_primary","la_ToolTip_SetPrimary","#", "if (PermChecks.itemChecked()) swap('cat_primary','toolbar/tool_primary_cat_f2.gif');", - "if (PermChecks.itemChecked()) swap('cat_primary', 'toolbar/tool_primary_cat.gif');","if (PermChecks.itemChecked()) PermChecks.check_submit('addlink_category', 'l_primary_cat');", - "tool_primary_cat.gif", TRUE, TRUE); - -$listImages[] = "PermChecks.addImage('cat_primary','$imagesURL/toolbar/tool_primary_cat.gif','$imagesURL/toolbar/tool_primary_cat_f3.gif',1); "; - - $objCats = new clsCatList(); - $objCatList = new clsCatList(); - //$objCats->UpdateMissingCacheData(); - $CatList = $c->CategoryMemberList($objSession->GetEditTable("CategoryItems")); - $Primary = $c->GetPrimaryCategory($objSession->GetEditTable("CategoryItems")); - $catlist = array(); - - if(strlen($CatList)) - { - $cats = explode(",",$CatList); - - $per_page = $objConfig->Get('Perpage_LV_Catlist'); - - $current_page = GetVar('lpn') ? GetVar('lpn') : $objSession->GetVariable('Page_LV_CatList'); - $start_from = $current_page ? ($current_page - 1) * $per_page : 0; - if( !getArrayValue($cats, $start_from) ) - { - $current_page = 1; - $start_from = 0; - $objSession->SetVariable('Page_LV_CatList', $current_page); - } - - for($i=$start_from; $i < $start_from+$per_page; $i++) - { - if( getArrayValue($cats, $i) === false ) break; - - $cat =& $objCatList->GetItem($cats[$i]); - $Status = $cat->get("Status"); - $catlist[$i] = $cat->Get("CachedNavbar"); // depricated file - if(!strlen($catlist[$i])) - { - $cat->UpdateCachedPath(); - $catlist[$i] = $cat->Get("CachedNavbar"); - } - - - if(strlen($catlist[$i])) - { - $catlist[$i] = prompt_language($objConfig->Get("Root_Name")).">".$catlist[$i]; - } - else - { - $catlist[$i] = prompt_language($objConfig->Get("Root_Name")); - $Status=1; - } - if($cats[$i]==$Primary) - { - $catlist[$i] .= "(".prompt_language("la_Text_Primary").")"; - } - $attr = array(); - $attr["CachedNavbar"] = $catlist[$i]; - $attr["CategoryId"]=$cats[$i]; - $attr["Status"]=$Status; - $objCats->AddItemFromArray($attr); - } - } - - for($i=0;$iItems);$i++) - { - $objListView->RowIcons[] = $objCats->Items[$i]->StatusIcon(); - } - - $objListView = new clsListView($objListToolBar,$objCats); - - $objListView->IdField = "CategoryId"; - - $order = $objConfig->Get("Category_LV_Sortfield"); - $SortOrder=0; - if($objConfig->Get("Category_LV_Sortorder")=="asc") - $SortOrder=1; - - $objListView->ColumnHeaders->Add("CachedNavbar",prompt_language("la_Text_Category"),1,0,$order,"width=\"30%\"","Category_LV_Sortfield","Category_LV_Sortorder","CachedNavbar"); - - $objListView->ColumnHeaders->SetSort($objConfig->Get("Category_LV_Sortfield"), $objConfig->Get("Category_LV_Sortorder")); - - $objListView->PrintToolBar = FALSE; - $objListView->checkboxes = TRUE; - - $objListView->CurrentPageVar = "Page_LV_CatList"; - $objListView->PerPageVar = "Perpage_LV_Catlist"; - $objListView->CheckboxName = "itemlist[]"; - $objListView->PriorityField = "_priority"; - $objListView->TotalItemCount = count($cats); - - $objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField, - $CurrentFilterVar,$UserView,$Bit_All); - -$objListToolBar->AddToInitScript($listImages); - -$objListToolBar->AddToInitScript("fwLoadMenus();"); - -$h = "\n\n\n"; - -$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Link")." '".$c->Get("Name")."' - ".prompt_language("la_tab_Categories"); - -int_header($objListToolBar,NULL, $title, NULL, $h); -if ($objSession->GetVariable("HasChanges") == 1) { -?> - - - - -
    - -
    - - - - - -
    " name="viewmenu"> - - - - -
    - -
    - - -
    - - - Index: branches/unlabeled/unlabeled-1.13.2/in-link/admin_templates/paid_listings/paid_listing_edit.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.13.2/in-link/admin_templates/paid_listings/paid_listing_edit.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.13.2/in-link/admin_templates/paid_listings/paid_listing_edit.tpl (revision 0) @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - "> - - - - - - - - - -
    Link Name: - - -  
    - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.13.2/in-link/admin_templates/duplicate_checker.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.13.2/in-link/admin_templates/duplicate_checker.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.13.2/in-link/admin_templates/duplicate_checker.tpl (revision 0) @@ -1,172 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - nobottomnotop"> - - - -
    - -
    -
    - - - - nobottomnotop"> - - - -
    - -
    - - - - - - - - - - - - " id="_" sequence=""> - - - - - - - - - - - - - - -
    "> - Link: (Duplicates: ) -
    - - - _Sort1" name="_Sort1" value=""> - _Sort1_Dir" name="_Sort1_Dir" value="asc"> -
    - - - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.13.2/in-link/units/listings/listings_config.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.13.2/in-link/units/listings/listings_config.php (revision 12746) +++ branches/unlabeled/unlabeled-1.13.2/in-link/units/listings/listings_config.php (revision 0) @@ -1,130 +0,0 @@ - 'ls', - 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'), - 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'), - 'EventHandlerClass' => Array('class'=>'ListingsEventHandler','file'=>'listings_event_handler.php','build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'ListingsTagProcessor','file'=>'listings_tag_processor.php','build_event'=>'OnBuild'), - 'AutoLoad' => true, - - 'Hooks' => Array( - Array( - 'Mode' => hAFTER, - 'Conditional' => false, - 'HookToPrefix' => 'l', - 'HookToSpecial' => '*', - 'HookToEvent' => Array('OnBeforeDeleteOriginal'), - 'DoPrefix' => '', - 'DoSpecial' => '*', - 'DoEvent' => 'OnMoveEnhancement', - ), - ), - - 'QueryString' => Array( - 1 => 'id', - 2 => 'page', - 3 => 'event', - 4 => 'mode', - ), - - 'RegularEvents' => Array( - 'listings_expiration' => Array('EventName' => 'OnCheckExpiredPaidListings', 'RunInterval' => 1800, 'Type' => reAFTER), - ), - - 'IDField' => 'ListingId', - 'StatusField' => Array('Status', 'PendingRenewal'), - 'TitlePresets' => Array( - 'default' => Array( 'new_status_labels' => Array('ls'=>'!la_title_AddingListing!'), - 'edit_status_labels' => Array('ls'=>'!la_title_EditingListing!'), - 'new_titlefield' => Array('ls'=>'!la_title_NewListing!'), - ), - 'listing_list'=>Array( 'prefixes' => Array('ls_List'), - 'format' => "!la_title_PaidListings! (#ls_recordcount#)", - ), - 'listing_edit'=>Array( 'prefixes' => Array('ls'), - 'new_titlefield' => Array('ls'=>'!la_title_NewListing!'), - 'format' => "#ls_status# - !la_title_General!", - ), - - - ), - - 'PermSection' => Array('main' => 'in-link:paid_listings'), - - 'Sections' => Array( - 'in-link:paid_listings_folder' => Array( - 'parent' => 'in-link', - 'icon' => 'paid_listings', - 'label' => 'la_tab_PaidListings', - 'permissions' => Array(), - 'priority' => 8, - 'type' => stTREE, - ), - - 'in-link:paid_listings' => Array( - 'parent' => 'in-link:paid_listings_folder', - 'icon' => 'paid_listings', - 'label' => 'la_tab_Listings', - 'url' => Array('t' => 'in-link/paid_listings/paid_listings_list', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:approve', 'advanced:decline'), - 'priority' => 8.1, - 'type' => stTAB, - ), - ), - - 'TableName' => TABLE_PREFIX.'Listings', - - 'ListSQLs' => Array( ''=>'SELECT * FROM %s',), // key - special, value - list select sql - - 'ItemSQLs' => Array( ''=>'SELECT * FROM %s',), - - 'ListSortings' => Array( - '' => Array( - 'Sorting' => Array('PurchasedOn' => 'desc'), - ) - ), - - 'Fields' => Array - ( - 'ListingId' => Array('type' => 'int','not_null' => '1','default' => ''), - 'ListingTypeId' => Array('type' => 'int','formatter'=>'kOptionsFormatter', 'options_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'ListingTypes ORDER BY Name', 'option_key_field'=>'ListingTypeId', 'option_title_field'=>'Name'), - 'ItemResourceId' => Array('type' => 'int','formatter'=>'kLEFTFormatter','left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'Link WHERE `%s` = \'%s\'','left_key_field'=>'ResourceId','left_title_field'=>'CONCAT(Name," (",Url,")")','required'=>1,'unique'=>Array('ItemResourceId')), - 'PurchasedOn' => Array('formatter'=>'kDateFormatter','default'=>'#NOW#'), - 'ExpiresOn' => Array('formatter'=>'kDateFormatter','default' => '#NOW#','required'=>1), - 'Status' => Array('type' => 'int','not_null' => '1','default' => '2','formatter'=>'kOptionsFormatter','options' => Array(1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'),'use_phrases' => '1'), - 'PendingRenewal' => Array('type' => 'int','formatter'=>'kOptionsFormatter','options' => Array(0 => 'la_NotPendingRenewal', 1 => 'la_PendingRenewal'),'use_phrases' => 1, 'not_null' => '1','default' => '0'), - 'RenewalReminderSent' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), - ), - - 'FilterMenu' => Array( - 'Groups' => Array( - Array('mode' => 'AND', 'filters' => Array(0,1,2), 'type' => WHERE_FILTER), - Array('mode' => 'AND', 'filters' => Array(3), 'type' => WHERE_FILTER), - ), - - 'Filters' => Array( - 0 => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), - 1 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), - 2 => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ), - 3 => Array('label' => 'la_PendingRenewal', 'on_sql' => '', 'off_sql' => '%1$s.PendingRenewal != 1' ), - ) - ), - - 'Grids' => Array( - 'Default' => Array( - 'Icons' => Array('default'=>'icon17_custom.gif','1_0'=>'icon16_listing.gif','0_0'=>'icon16_listing_disabled.gif','2_0'=>'icon16_listing_pending.gif', '1_1'=>'icon16_listing_pending.gif','0_1'=>'icon16_listing_disabled.gif','2_1'=>'icon16_listing_pending.gif'), - 'Fields' => Array( - 'ListingId' => Array( 'title'=>'la_col_Id' , 'data_block' => 'grid_checkbox_td'), - 'ListingTypeId' => Array( 'title'=>'la_col_ListingTypeName' , 'data_block' => 'listing_type_td'), - 'ItemResourceId' => Array( 'title'=>'la_col_LinkName' , 'data_block' => 'link_td'), - 'PendingRenewal' => Array( 'title'=>'la_col_PendingRenewal' ), - 'PurchasedOn' => Array( 'title'=>'la_col_PurchasedOn' ), - 'ExpiresOn' => Array( 'title'=>'la_col_ExpiresOn' ), - ), - - ), - ), - ); - -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.43.2/in-link/admin/install/inportal_data.sql =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.43.2/in-link/admin/install/inportal_data.sql (revision 12746) +++ branches/unlabeled/unlabeled-1.43.2/in-link/admin/install/inportal_data.sql (revision 0) @@ -1,265 +0,0 @@ -INSERT INTO ConfigurationAdmin VALUES ('Link_SortField', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 4) AND (IsSystem = 0)', 10.01, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.01, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortField2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 4) AND (IsSystem = 0)', 10.02, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.02, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links', 'la_Text_Links', 'la_link_perpage_prompt', 'text', '', '', 10.03, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_NewDays', 'la_Text_Links', 'la_link_newdays_prompt', 'text', '', '', 10.05, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MinPopRating', 'la_Text_Links', 'la_fld_Link_MinPopRating', 'text', '', '', 10.06, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MaxHotNumber', 'la_Text_Links', 'la_fld_Link_MaxHotNumber', 'text', '', '', 10.08, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_EnhancedLinks', 'la_Text_Links', 'la_link_EnhancedLinks', 'checkbox', '', '', 10.09, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_AllowFreeListings', 'la_Text_Links', 'la_link_AllowFreeListings', 'checkbox', '', '', 10.1, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ShowPick', 'la_Text_Links', 'la_link_editorspick_prompt', 'checkbox', '', '', 10.11, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_UrlStatus', 'la_Text_Links', 'la_link_urlstatus_prompt', 'checkbox', '', '', 10.12, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'ReviewText=la_common_ReviewText,CreatedOn=la_common_CreatedOn', 20.01, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 20.01, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'ReviewText=la_common_ReviewText,date=la_common_CreatedOn', 20.02, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 20.02, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MinPopVotes', 'la_Text_Links', 'la_fld_Link_MinPopVotes', 'text', '', '', 10.07, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_LinkReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 20.03, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links_Short', 'la_Text_Links', 'la_link_perpage_short_prompt', 'text', '', '', 10.04, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Name', 'la_Text_Link_Search', 'la_Link_Name', 'checkbox', '', '', 2, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Description', 'la_Text_Link_Search', 'la_Link_Description', 'checkbox', '', '', 1, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Url', 'la_Text_Link_Search', 'la_Link_Url', 'checkbox', '', '', 5, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CreatedOn', 'la_Text_Link_Search', 'la_Link_CreatedOn', 'checkbox', '', '', 5, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Hits', 'la_Text_Link_Search', 'la_Link_Hits', 'checkbox', '', '', 6, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedRating', 'la_Text_Link_Search', 'la_Link_CatchedRating', 'checkbox', '', '', 7, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedVotesQty', 'la_Text_Link_Search', 'la_Link_CatchedVotesQty', 'checkbox', '', '', 8, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedReviewsQty', 'la_Text_Link_Search', 'la_Link_CatchedReviewsQty', 'checkbox', '', '', 9, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Value', 'la_Text_Links', 'la_prompt_DupReviews', 'text', '', '', 10.13, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Interval', 'la_Text_Links', 'la_prompt_DupReviews', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.13, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Value', 'la_Text_Links', 'la_prompt_DupRating', 'text', '', '', 10.14, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Interval', 'la_Text_Links', 'la_prompt_DupRating', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.14, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('l_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 30.01, 0, 0); -INSERT INTO ConfigurationAdmin VALUES ('l_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 30.02, 0, 0); - -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_links', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_links', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_links', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_links', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_links', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 0, 1); - -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Links', '10', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortField', 'Name', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortOrder', 'asc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortField2', 'Description', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortOrder2', 'desc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_NewDays', '100', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_MinPopRating', '5', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_MaxHotNumber', '5', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_EnhancedLinks', '0', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_AllowFreeListings', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ShowPick', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_UrlStatus', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsSort', 'CreatedOn', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsOrder', 'desc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsSort2', 'ReviewText', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsOrder2', 'asc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_MinPopVotes', '20', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_LinkId', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Name', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Description', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Url', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CreatedOn', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Hits', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CatchedRating', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CatchedVotesQty', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CatchedReviewsQty', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_ReviewById', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Priority', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Status', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_EditorsPick', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_ResourceId', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_HotItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_PopItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_NewItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_ReviewDelay_Value', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_ReviewDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_RatingDelay_Value', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_RatingDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_Root', '{LinkCatId}', 'In-Portal', '') -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Links_Short', '3', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_Highlight_OpenTag', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_Highlight_CloseTag', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LinkReviews_Short', '3', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LinkReviews', '10', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'l_CategoryTemplate', 'inlink/index', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (NULL, 'l_ItemTemplate', 'inlink/detail', 'In-Link', 'in-link:configuration_output'); - -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Keyword_links', '90', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Pop_links', '5', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Rating_links', '5', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Increase_links', '30', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_ShowMultiple_links', '0', 'In-Link', 'in-link:configuration_search'); - -INSERT INTO ConfigurationValues VALUES (NULL, 'StartValidationTime', '0', 'In-Link', ''); -INSERT INTO ConfigurationValues VALUES (NULL, 'LastExpirationTime', '0', 'In-Link', ''); -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_RatingToPop', '5', 'In-Link', 'in-link:configuration_output'); - -INSERT INTO Events VALUES (7, 'LINK.ADD', 2, 0, 'In-Link', 'la_event_link.add', 1) -INSERT INTO Events VALUES (8, 'LINK.MODIFY', 2, 0, 'In-Link', 'la_event_link.modify', 1) -INSERT INTO Events VALUES (9, 'LINK.REVIEW.ADD', 2, 0, 'In-Link', 'la_event_link.review.add', 1) -INSERT INTO Events VALUES (10, 'LINK.ADD', 1, 0, 'In-Link', 'la_event_link.add', 0) -INSERT INTO Events VALUES (11, 'LINK.APPROVE', 1, 0, 'In-Link', 'la_event_link.approve', 0) -INSERT INTO Events VALUES (12, 'LINK.DENY', 1, 0, 'In-Link', 'la_event_link.deny', 0) -INSERT INTO Events VALUES (13, 'LINK.MODIFY', 1, 0, 'In-Link', 'la_event_link.modify', 0) -INSERT INTO Events VALUES (14, 'LINK.MODIFY.APPROVE', 1, 0, 'In-Link', 'la_event_link.modify.approve', 0) -INSERT INTO Events VALUES (15, 'LINK.REVIEW.ADD', 1, 0, 'In-Link', 'la_event_link.review.add', 0) -INSERT INTO Events VALUES (16, 'LINK.REVIEW.APPROVE', 1, 0, 'In-Link', 'la_event_link.review.approve', 0) -INSERT INTO Events VALUES (17, 'LINK.REVIEW.DENY', 1, 0, 'In-Link', 'la_event_link.review.deny', 0) -INSERT INTO Events VALUES (40, 'LINK.ADD.PENDING', 1, 0, 'In-Link', 'la_event_link.add.pending', 0) -INSERT INTO Events VALUES (42, 'LINK.MODIFY.PENDING', 1, 0, 'In-Link', 'la_event_link.modify.pending', 0) -INSERT INTO Events VALUES (43, 'LINK.REVIEW.ADD.PENDING', 1, 0, 'In-Link', 'la_event_link.review.add.pending', 0) -INSERT INTO Events VALUES (46, 'LINK.MODIFY.DENY', 1, 0, 'In-Link', 'la_event_link.modify.deny', 0) -INSERT INTO Events VALUES ('', 'LINK.ENHANCE', '1', '0', 'In-Link', 'la_event_link.link.enhance', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE', '1', '0', 'In-Link', 'la_event_link.link.enhance', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.APPROVE', '0', '0', 'In-Link', 'la_event_link.link.enhance.approve', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.APPROVE', '1', '0', 'In-Link', 'la_event_link.link.enhance.approve', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.DENY', '0', '0', 'In-Link', 'la_event_link.link.enhance.deny', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.DENY', '1', '0', 'In-Link', 'la_event_link.link.enhance.deny', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXPIRE', '1', '0', 'In-Link', 'la_event_link.link.enhance.expire', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXPIRE', '1', '0', 'In-Link', 'la_event_link.link.enhance.expire', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXTEND', '1', '0', 'In-Link', 'la_event_link.link.enhance.extend', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXTEND', '1', '0', 'In-Link', 'la_event_link.link.enhance.extend', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW', '0', '0', 'In-Link', 'la_event_link.link.enhance.renew', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW.FAILED', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_failed', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW.FAILED', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_failed', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.CANCEL', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_cancel', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.CANCEL', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_cancel', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEWAL.NOTICE', '1', '0', 'In-Link', 'la_event_link.link.enhance.renewal_notice', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEWAL.NOTICE', '1', '0', 'In-Link', 'la_event_link.link.enhance.renewal_notice', '0') - -INSERT INTO ItemTypes VALUES (4, 'In-Link', 'l', 'Link', 'Name', 'CreatedById', 'Hits', 'CachedRating', 'la_ItemTab_Links', 1, 'in-link/admin/addlink.php', 'clsLink', 'Link'); - -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.ADD', 'lu_PermName_Link.Add_desc', 'lu_PermName_Link.Add_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.VIEW', 'lu_PermName_Link.View_desc', 'lu_PermName_Link.View_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.ADD.PENDING', 'lu_PermName_Link.Add.Pending_desc', 'lu_PermName_Link.Add.Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.MODIFY', 'lu_PermName_Link.Modify_desc', 'lu_PermName_Link.Modify_desc', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.DELETE', 'lu_PermName_Link.Delete_desc', 'lu_PermName_Link.Delete_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.RATE', 'lu_PermName_Link.Rate_desc', 'lu_PermName_Link.Rate_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.REVIEW', 'lu_PermName_Link.Review_desc', 'lu_PermName_Link.Review_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.REVIEW.PENDING', 'lu_PermName_Link.Review_Pending_desc', ' lu_PermName_Link.Review_Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.MODIFY.PENDING', 'lu_PermName_Link.Modify.Pending_desc', 'lu_PermName_Link.Modify.Pending_desc', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.MODIFY', 'lu_PermName_Link.Owner.Modify_desc', 'lu_PermName_Link.Owner.Modify_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.MODIFY.PENDING', 'lu_PermName_Link.Owner.Modify.Pending_desc', 'lu_PermName_Link.Owner.Modify.Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.DELETE', 'lu_PermName_Link.Owner.Delete_desc', 'lu_PermName_Link.Owner.Delete_error', 'In-Link'); - -INSERT INTO SearchConfig VALUES ('Link', 'OrgId', 0, 0, 'lu_fielddesc_link_orgid', 'lu_field_orgid', 'In-Link', 'la_text_link', 19, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'NewItem', 0, 1, 'lu_fielddesc_link_newitem', 'lu_field_newitem', 'In-Link', 'la_text_link', 18, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'PopItem', 0, 1, 'lu_fielddesc_link_popitem', 'lu_field_popitem', 'In-Link', 'la_text_link', 17, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'HotItem', 0, 1, 'lu_fielddesc_link_hotitem', 'lu_field_hotitem', 'In-Link', 'la_text_link', 16, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'ResourceId', 0, 1, 'lu_fielddesc_link_resourceid', 'lu_field_resourceid', 'In-Link', 'la_text_link', 15, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'EditorsPick', 0, 1, 'lu_fielddesc_link_editorspick', 'lu_field_editorspick', 'In-Link', 'la_text_link', 14, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Status', 0, 0, 'lu_fielddesc_link_status', 'lu_field_status', 'In-Link', 'la_text_link', 13, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Priority', 0, 0, 'lu_fielddesc_link_priority', 'lu_field_priority', 'In-Link', 'la_text_link', 12, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'ModifiedById', 0, 0, 'lu_fielddesc_link_modifiedbyid', 'lu_field_modifiedbyid', 'In-Link', 'la_text_link', 11, 0, 0, 'text', 'PortalUser.Login', '{ForeignTable}.PortalUserId={LocalTable}.ModifiedById', NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CreatedById', 0, 0, 'lu_fielddesc_link_createdbyid', 'lu_field_createdbyid', 'In-Link', 'la_text_link', 10, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedReviewsQty', 0, 0, 'lu_fielddesc_link_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Link', 'la_text_link', 9, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedVotesQty', 0, 0, 'lu_fielddesc_link_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Link', 'la_text_link', 8, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'LinkId', 0, 1, 'lu_fielddesc_link_linkid', 'lu_field_linkid', 'In-Link', 'la_text_link', 0, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Name', 1, 1, 'lu_fielddesc_link_name', 'lu_field_name', 'In-Link', 'la_text_link', 1, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Description', 1, 1, 'lu_fielddesc_link_description', 'lu_field_description', 'In-Link', 'la_text_link', 2, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Url', 1, 1, 'lu_fielddesc_link_url', 'lu_field_url', 'In-Link', 'la_text_link', 3, 0, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CreatedOn', 0, 1, 'lu_fielddesc_link_createdon', 'lu_field_createdon', 'In-Link', 'la_text_link', 4, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Modified', 0, 1, 'lu_fielddesc_link_modified', 'lu_field_modified', 'In-Link', 'la_text_link', 5, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Hits', 0, 1, 'lu_fielddesc_link_hits', 'lu_field_hits', 'In-Link', 'la_text_link', 6, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedRating', 0, 0, 'lu_fielddesc_link_cachedrating', 'lu_field_cachedrating', 'In-Link', 'la_text_link', 7, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); - -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) as LinkCount FROM <%prefix%>Link WHERE Status=1', NULL, 'la_prompt_ActiveLinks', 0, 1); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS TotalLinks FROM <%prefix%>Link', NULL, 'la_prompt_TotalLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS ActiveLinks FROM <%prefix%>Link WHERE Status = 1', NULL, 'la_prompt_ActiveLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS PendingLinks FROM <%prefix%>Link WHERE Status = 2', NULL, 'la_prompt_PendingLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS DisabledLinks FROM <%prefix%>Link WHERE Status = 0', NULL, 'la_prompt_DisabledLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS NewLinks FROM <%prefix%>Link WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Link_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>Link WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS HotLinks FROM <%prefix%>Link WHERE (HotItem = 1) OR (Hits >= <%m:config name="Link_MaxHotNumber"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS PopularLinks FROM <%prefix%>Link WHERE (PopItem = 1) OR ( (CachedRating >= <%link:hit_count type="top"%>) AND <%link:hit_count type="top"%> AND (PopItem = 2) )', NULL, 'la_prompt_PopularLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Link WHERE CachedRating > 0', NULL, 'la_prompt_LinksAverageRating', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT MAX(Hits) AS MaxLinksHits FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksHits', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT MAX(CachedVotesQty) AS MaxLinksVotes FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksVotes', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_NewestLinkDate', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_LastLinkUpdate', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_LinkReviews', 0, 2); - -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 14, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 14, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD.PENDING', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.DELETE', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.DELETE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.MODIFY', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.DELETE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.DELETE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.DELETE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:inlink_general.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:inlink_general.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_output.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_output.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_search.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_search.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_email.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_email.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.advanced:approve', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.advanced:decline', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.delete', 11, 1, 1, 0); - -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('in-link', 'In-Link', 'inlink_import', 'Intechnic In-Link 2.x', 'In-Link', 'link_image,user_admin,user_regular,init_cat', 1,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Gossamer Threads Links 2.x', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Gossamer Threads Links 2.x SQL version', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Sentraweb Indexu 3.x', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Links from CSV file [In-Link]', '', '', 1, 'csv'); - -INSERT INTO CustomField (Type, FieldName, FieldLabel, Heading, Prompt, ElementType, ValueList, DisplayOrder, OnGeneralTab, IsSystem) VALUES (1, 'l_ItemTemplate', 'l_ItemTemplate', 'la_title_SystemCF', 'l_ItemTemplate', 'text', NULL, 0, 0, 1); - -INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('In-Link', 'in-link/', 'l', '3.3.0', 1, 1, 'inlink/', 2, '1054738405'); \ No newline at end of file Index: branches/unlabeled/unlabeled-1.8.2/themes/default/inlink/suggest_link/suggest_link_form.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.8.2/themes/default/inlink/suggest_link/suggest_link_form.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.8.2/themes/default/inlink/suggest_link/suggest_link_form.tpl (revision 0) @@ -1,102 +0,0 @@ - -
    "> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -
    (*)
    -


    >
    *
    *
    *


    - - - - - - - - - - - - - -
    - " value="" checked> - - - - - ');"> - -
    - -
     
      - " class="button"> - " class="button" onClick="javascript:history.back();"> -



    - -
    \ No newline at end of file Index: branches/unlabeled/unlabeled-1.8.2/in-link/inlink_redirect.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.8.2/in-link/inlink_redirect.php (revision 12746) +++ branches/unlabeled/unlabeled-1.8.2/in-link/inlink_redirect.php (revision 0) @@ -1,47 +0,0 @@ -ApplicationDie('error: no link id specified'); - } - - $link = new clsLink($id); - - $link->debuglevel = 0; - $link->ClearCacheData(); - $link->Increment("hits", true); - $url = $link->Get("Url"); - -// $protocol = 'http'; - - if (preg_match('/^(http|ftp|mailto:)(.*)/U', $url)) { - header('Location: '.$url); - } - else { - header('Location: http://'.$url); - } - - exit; -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.8.2/in-link/admin_templates/import.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.8.2/in-link/admin_templates/import.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.8.2/in-link/admin_templates/import.tpl (revision 0) @@ -1,226 +0,0 @@ - - - - - - - - - - - - - - - -
    - -
    - - - - - - - "> - - - - - - - - - - - - - "> - - - - - - - - - - - - - - - - "> - - - - - - - - - - - "> - - - - - -
    - - - - - - - - - - - - - -
    - " id="_1" checked value="1" /> - - - - " id="" onclick="check_radio('_1');"> -
    - " id="_2" checked value="2" /> - - - - -
    -
     
    - - - - - - - - - - - -
    - " id="btn_move_up" onclick="move_options_up('', 1)" class="button"> - " id="btn_move_down" onclick="move_options_down('', 1)" class="button">
    -
    -

    :
    - - " value="" /> - - ', '')" class="button">
    -
    - ', ''); select_sort('');" class="button"> -
    - -
    -
     
    - - " value="" /> - ', 'ImportCategory', null, 'OnSaveSettings');"> -  
    - - - - - - - - - - -
    - checked name="" id="_1" value="1" /> - - -
    - checked name="" id="_2" value="2" /> - - - - - -
    -
     
    - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.8.2/in-link/admin_templates/paid_listings/paid_listing_types_list.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.8.2/in-link/admin_templates/paid_listings/paid_listing_types_list.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.8.2/in-link/admin_templates/paid_listings/paid_listing_types_list.tpl (revision 0) @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - -
    - -
    - - - -   - - - - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.19.2/in-link/admin_templates/paid_listings/paid_listing_type_edit.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.19.2/in-link/admin_templates/paid_listings/paid_listing_type_edit.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.19.2/in-link/admin_templates/paid_listings/paid_listing_type_edit.tpl (revision 0) @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - - - "> - - - - - - "> - - - - - - "> - - - - - - "> - - - - - - "> - - - - - - - "> - - - - - - "> - - - - - - "> - - - - - - "> - - - - - - - " value="" /> - - - - ', '', null, 'OnPreSaveListingType');"> - - - - - - - - - - - "> - - - - - -
    - " id="" value="" tabindex="" size="5"> - -  
    - " id="" value="" tabindex="" size="5"> - -  
     
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - " id="" value="" tabindex="" size="5"> - - - " id="" value="" tabindex="" size="5"> -
    - " name="" value=""> - " type="checkbox" id="_cb_" name="_cb_" onclick="update_checkbox(this, document.getElementById(''))"> - - - - - - - " name="" value=""> - " type="checkbox" id="_cb_" name="_cb_" onclick="update_checkbox(this, document.getElementById(''))"> - - - - - -
    - - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.14.2/in-link/admin_templates/catalog_tab.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.14.2/in-link/admin_templates/catalog_tab.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.14.2/in-link/admin_templates/catalog_tab.tpl (revision 0) @@ -1,72 +0,0 @@ - - - - a_toolbar.AddButton( new ToolBarButton('in-link:new_link', '', function() { - std_precreate_item('', 'in-link/links/links_edit'); - }, true - ) ); - - - - - - - - - - - $Catalog.setItemCount('', ''); - $Catalog.setCurrentCategory('', ); - - - - - Grids[''].AddAlternativeGrid('', true); - - Grids[''].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','sep3','cut','copy','move_up','move_down','sep6')); - $Catalog.reflectPasteButton(); - $Catalog.setViewMenu(''); - - Grids[''].RadioMode = true; - Grids[''].DblClick = function() {return false}; - - #separator# - - - _" sequence="" width="%"> - - checkboxradio" name="" id=""> - "> - - - - " target="_blank"> - - - -
    -
    - - [ID: / ] Filename: - -
    - - (Added: / - Hits: / - Rating: / - Votes: / - Reviews: ) - -
    -
    - - - - - - - - -
    - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.14.2/in-link/units/listings/listings_config.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.14.2/in-link/units/listings/listings_config.php (revision 12746) +++ branches/unlabeled/unlabeled-1.14.2/in-link/units/listings/listings_config.php (revision 0) @@ -1,144 +0,0 @@ - 'ls', - 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'), - 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'), - 'EventHandlerClass' => Array('class'=>'ListingsEventHandler','file'=>'listings_event_handler.php','build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'ListingsTagProcessor','file'=>'listings_tag_processor.php','build_event'=>'OnBuild'), - 'AutoLoad' => true, - - 'Hooks' => Array( - Array( - 'Mode' => hAFTER, - 'Conditional' => false, - 'HookToPrefix' => 'l', - 'HookToSpecial' => '*', - 'HookToEvent' => Array('OnBeforeDeleteOriginal'), - 'DoPrefix' => '', - 'DoSpecial' => '*', - 'DoEvent' => 'OnMoveEnhancement', - ), - ), - - 'QueryString' => Array( - 1 => 'id', - 2 => 'page', - 3 => 'event', - 4 => 'mode', - ), - - 'RegularEvents' => Array( - 'listings_expiration' => Array('EventName' => 'OnCheckExpiredPaidListings', 'RunInterval' => 1800, 'Type' => reAFTER), - ), - - 'IDField' => 'ListingId', - 'StatusField' => Array('Status', 'PendingRenewal'), - 'TitleField' => 'LinkName', - - 'TitlePresets' => Array( - 'default' => Array( 'new_status_labels' => Array('ls'=>'!la_title_AddingListing!'), - 'edit_status_labels' => Array('ls'=>'!la_title_EditingListing!'), - 'new_titlefield' => Array('ls'=>'!la_title_NewListing!'), - ), - - 'listing_list' => Array('prefixes' => Array('ls_List'), 'format' => "!la_title_PaidListings! (#ls_recordcount#)",), - 'listing_edit' => Array('prefixes' => Array('ls'), 'format' => "#ls_status# '#ls_titlefield#' - !la_title_General!",), - ), - - 'PermSection' => Array('main' => 'in-link:paid_listings'), - - 'Sections' => Array( - 'in-link:paid_listings_folder' => Array( - 'parent' => 'in-link', - 'icon' => 'paid_listings', - 'label' => 'la_tab_PaidListings', - 'permissions' => Array(), - 'priority' => 8, - 'type' => stTREE, - ), - - 'in-link:paid_listings' => Array( - 'parent' => 'in-link:paid_listings_folder', - 'icon' => 'paid_listings', - 'label' => 'la_tab_Listings', - 'url' => Array('t' => 'in-link/paid_listings/paid_listings_list', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit', 'delete', 'advanced:approve', 'advanced:decline'), - 'priority' => 8.1, - 'type' => stTAB, - ), - ), - - 'TableName' => TABLE_PREFIX.'Listings', - - 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'Link item_table ON item_table.ResourceId = %1$s.ItemResourceId - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON u.PortalUserId = item_table.CreatedById'), - - 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'Link item_table ON item_table.ResourceId = %1$s.ItemResourceId - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON u.PortalUserId = item_table.CreatedById'), - - 'ListSortings' => Array( - '' => Array( - 'Sorting' => Array('PurchasedOn' => 'desc'), - ) - ), - - 'CalculatedFields' => Array ( - '' => Array ( - 'LinkName' => 'CONCAT(item_table.Name, " (", item_table.Url, ")")', - 'LinkOwner' => 'IF (ISNULL(u.Login), IF (item_table.CreatedById = -1, "root", IF (item_table.CreatedById = -2, "Guest", "n/a")), u.Login)', - ), - ), - 'Fields' => Array - ( - 'ListingId' => Array('type' => 'int','not_null' => '1','default' => ''), - 'ListingTypeId' => Array('type' => 'int','formatter'=>'kOptionsFormatter', 'options_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'ListingTypes ORDER BY Name', 'option_key_field'=>'ListingTypeId', 'option_title_field'=>'Name'), - 'ItemResourceId' => Array('type' => 'int','required'=>1,'unique'=>Array('ItemResourceId')), - 'PurchasedOn' => Array('formatter'=>'kDateFormatter','default'=>'#NOW#'), - 'ExpiresOn' => Array('formatter'=>'kDateFormatter','default' => '#NOW#','required'=>1), - 'Status' => Array('type' => 'int','not_null' => '1','default' => '2','formatter'=>'kOptionsFormatter','options' => Array(1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'),'use_phrases' => '1'), - 'PendingRenewal' => Array('type' => 'int','formatter'=>'kOptionsFormatter','options' => Array(0 => 'la_NotPendingRenewal', 1 => 'la_PendingRenewal'),'use_phrases' => 1, 'not_null' => '1','default' => '0'), - 'RenewalReminderSent' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), - ), - - 'VirtualFields' => Array ( - 'LinkName' => Array ('type' => 'string'), - 'LinkOwner' => Array ('type' => 'string'), - ), - - 'FilterMenu' => Array( - 'Groups' => Array( - Array('mode' => 'AND', 'filters' => Array(0,1,2), 'type' => WHERE_FILTER), - Array('mode' => 'AND', 'filters' => Array(3), 'type' => WHERE_FILTER), - ), - - 'Filters' => Array( - 0 => Array('label' =>'la_Enabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), - 1 => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), - 2 => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ), - 3 => Array('label' => 'la_PendingRenewal', 'on_sql' => '', 'off_sql' => '%1$s.PendingRenewal != 1' ), - ) - ), - - 'Grids' => Array( - 'Default' => Array( - 'Icons' => Array('default'=>'icon17_custom.gif','1_0'=>'icon16_listing.gif','0_0'=>'icon16_listing_disabled.gif','2_0'=>'icon16_listing_pending.gif', '1_1'=>'icon16_listing_pending.gif','0_1'=>'icon16_listing_disabled.gif','2_1'=>'icon16_listing_pending.gif'), - 'Fields' => Array( - 'ListingId' => Array( 'title'=>'la_col_Id' , 'data_block' => 'grid_checkbox_td'), - 'ListingTypeId' => Array( 'title'=>'la_col_ListingTypeName' , 'data_block' => 'listing_type_td'), - 'LinkName' => Array( 'title'=>'la_col_LinkName' , 'data_block' => 'link_td'), - 'LinkOwner' => Array( 'title'=>'la_col_LinkOwner'), - 'PendingRenewal' => Array( 'title'=>'la_col_PendingRenewal' ), - 'PurchasedOn' => Array( 'title'=>'la_col_PurchasedOn' ), - 'ExpiresOn' => Array( 'title'=>'la_col_ExpiresOn' ), - ), - - ), - ), - ); - -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.14.2/in-link/units/links/link_tag_processor.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.14.2/in-link/units/links/link_tag_processor.php (revision 12746) +++ branches/unlabeled/unlabeled-1.14.2/in-link/units/links/link_tag_processor.php (revision 0) @@ -1,164 +0,0 @@ -Application->recallObject($this->Prefix, null, Array('skip_autoload' => true)); - $object->Load( $this->Application->GetVar($this->Prefix.'_id') ); - $sql = 'SELECT ListingTypeId FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$object->GetDBField('ResourceId'); - $listtype_id = $this->Conn->GetOne($sql); - $this->Application->SetVar('lst_id', $listtype_id); - return $listtype_id ? 1 : 0; - } - - function EnhancementIsPending($params) - { - $object =& $this->Application->recallObject($this->Prefix, null, Array('skip_autoload' => true)); - $object->Load( $this->Application->GetVar($this->Prefix.'_id') ); - $sql = 'SELECT Status FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$object->GetDBField('ResourceId'); - $status = $this->Conn->GetOne($sql); - return ($status == 2) ? 1 : 0; - } - - function ListingTypeField($params) - { - $object =& $this->Application->recallObject('l', null, Array('skip_autoload' => true)); - $object->Load( $this->Application->GetVar($this->getPrefixSpecial().'_id') ); - $sql = 'SELECT ListingTypeId FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$object->GetDBField('ResourceId'); - $lst_id = $this->Conn->GetOne($sql); - - $lst_object =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $lst_object->Load($lst_id); - return $lst_object->GetField($this->SelectParam($params, 'name,field')); - } - - function EnhancementField($params) - { - $object =& $this->Application->recallObject('l', null, Array('skip_autoload' => true)); - $object->Load( $this->Application->GetVar($this->getPrefixSpecial().'_id') ); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$object->GetDBField('ResourceId'); - $listing_id = $this->Conn->GetOne($sql); - - $listing_object =& $this->Application->recallObject('ls', null, Array('skip_autoload' => true)); - $listing_object->Load($listing_id); - return $listing_object->GetField($this->SelectParam($params, 'name,field')); - } - - function IsRenewalPeriod($params) - { - $object =& $this->Application->recallObject($this->getPrefixSpecial()); - $sql = 'SELECT ExpiresOn, ListingTypeId FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$object->GetDBField('ResourceId'); - $ls_info = $this->Conn->GetRow($sql); - $expiration = $ls_info['ExpiresOn']; - $lst_id = $ls_info['ListingTypeId']; - $sql = 'SELECT RenewalReminder FROM '.$this->Application->getUnitOption('lst', 'TableName').' - WHERE ListingTypeId = '.$lst_id; - $renewal_interval = $this->Conn->GetOne($sql) * 3600 * 24; - return ($expiration - adodb_mktime() < $renewal_interval) ? 1 : 0; - } - - function FirstListingType($params) - { - static $first = true; - if($first) - { - $first = false; - return true; - } - else - { - return false; - } - } - - function IsReocurringEnhancement($params) - { - $params['name'] = 'Recurring'; - return $this->ListingTypeField($params); - } - - function EnhanceUsingInCommerce($params) - { - if (!$this->Application->isModuleEnabled('In-Commerce')) { - return 0; - } - - $object =& $this->Application->recallObject($this->Prefix, null, Array('skip_autoload' => true)); - $object->Load( $this->Application->GetVar($this->Prefix.'_id') ); - $sql = 'SELECT ListingTypeId FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$object->GetDBField('ResourceId'); - $listtype_id = $this->Conn->GetOne($sql); - - $lst_object =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $lst_object->Load($listtype_id); - - return $lst_object->GetDBField('EnableBuying'); - } - - function ClickLink($params) - { - $object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params ); - return $this->Application->HREF( $params['t'], '', Array('l_id' => $object->GetID(), 'pass'=>'all,l' ) ); - } - - function ListRelatedLinks($params) - { - return $this->PrintList2($params); - } - - function LinkLink($params) - { - $params = array_merge($params, Array('pass' => 'all,m,l') ); - - $item_id = getArrayValue($params, 'link_id'); - if (!$item_id) { - $item_id = $this->Application->GetVar($this->Prefix.'_id'); - } - $params[$this->Prefix.'_id'] = $item_id; - - $object =& $this->getObject($params); - $params['m_cat_id'] = $object->GetDBField('CategoryId'); - - $main_processor =& $this->Application->recallObject('m_TagProcessor'); - return $main_processor->T($params); - } - - function ListingDescription($params) - { - $listing =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing->Load( $this->Application->GetVar('listing_type') ); - - return $listing->GetDBField('Description'); - } - - function ListingTypeDetailsLink($params) - { - $listing =& $this->Application->recallObject('lst'); - $params['listing_type'] = $listing->GetID(); - - $main_processor =& $this->Application->recallObject('m_TagProcessor'); - return $main_processor->Link($params); - } - - function GroupTitle($params) - { - $object =& $this->getObject($params); - - $grouping = $this->Application->RecallVar($this->getPrefixSpecial().'_dupe_fields'); - $grouping = explode('|', substr($grouping, 1, -1)); - - $ret = ''; - foreach ($grouping as $group_field) { - $ret .= $object->GetField($group_field).', '; - } - return preg_replace('/(.*), $/', '\\1', $ret); - } -} - -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.26.2/in-link/admin/install/langpacks/english.lang =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.26.2/in-link/admin/install/langpacks/english.lang (revision 12746) +++ branches/unlabeled/unlabeled-1.26.2/in-link/admin/install/langpacks/english.lang (revision 0) @@ -1,148 +0,0 @@ - - m/d/Yg:i:s Am/d/Yg:i:s A.,iso-8859-12 - - QWN0aW9ucyBVcG9uIEV4cGlyYXRpb24= - QWN0aW9ucyBVcG9uIFB1cmNoYXNl - RXhwaXJlcyBPbg== - TGluaw== - TGlzdGluZyBUeXBl - TW9kaWZpZWQ= - UGVuZGluZyBSZW5ld2Fs - RW5hYmxlZCBPbg== - RGVjcmVhc2UgQnk= - VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgZHVwbGljYXRlIGxpbmtz - VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgcGFpZCBsaXN0aW5ncw== - VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgcGFpZCBsaXN0aW5ncw== - RG9uJ3QgQ2hhbmdl - TGluayBlbmhhbmNlbWVudCBzdWJtaXR0ZWQ= - TGluayBlbmhhbmNlbWVudCBhcHByb3ZlZA== - TGluayBlbmhhbmNlbWVudCBkZW5pZWQ= - TGluayBlbmhhbmNlbWVudCBleHBpcmVk - TGluayBlbmhhbmNlbWVudCByZW5ld2FsIHN1Ym1pdHRlZA== - TGluayBlbmhhbmNlbWVudCBleHRlbmRlZA== - TGluayBlbmhhbmNlbWVudCBpcyBhYm91dCB0byBleHBpcmU= - TGluayBlbmhhbmNlbWVudCBjYW5jZWxsZWQ= - TGluayBlbmhhbmNlbWVudCByZW5ld2FsIGZhaWxlZA== - TGluayBJdGVtIFRlbXBsYXRl - RW5hYmxlIFB1cmNoYXNpbmc= - RXhwaXJhdGlvbiBEYXRl - TGluayBPd25lcg== - TWF4aW11bSBudW1iZXIgb2YgSE9UIGxpbmtz - TWluaW11bSByYXRpbmcgdG8gY29uc2lkZXIgbGluayBQT1A= - TWluaW11bSBudW1iZXIgb2Ygdm90ZXMgdG8gY29uc2lkZXIgbGluayBQT1A= - SUQ= - TGlzdGluZyBUeXBl - RGVzY3JpcHRpb24= - SUQ= - TmFtZQ== - UGVuZGluZyBSZW5ld2Fs - UHVyY2hhc2UgRGF0ZQ== - UmVjdXJyaW5n - UmVuZXdhbCBSZW1pbmRlcg== - UHJvZHVjdCBOYW1l - VXNlcm5hbWU= - SW4tbGluaw== - SW5jcmVhc2UgQnk= - SzQgTGlua3M= - QWxsb3cgRnJlZSBMaXN0aW5ncw== - RW5oYW5jZWQgTGlzdGluZ3M= - R3JvdXBpbmcgQnk= - TXVsdGlwbGUgbGlua3MgZnJvbSBvbmUgZ3JvdXAgY291bGQgbm90IGJlIHNlbGVjdGVkIGF0IG9uY2UuIFBsZWFzZSBzZWxlY3Qgb25seSBvbmUgbGluayBmcm9tIGdyb3VwLg== - Tm8gQ2F0ZWdvcmllcw== - Tm8= - UGVuZGluZyBSZW5ld2Fs - TGluaw== - U2V0IEVxdWFsIFRv - RHVwbGljYXRlIENoZWNrZXI= - TGlzdGluZ3M= - TGlzdGluZyBUeXBlcw== - UGFpZCBMaXN0aW5ncw== - U2hvcHBpbmcgQ2FydCBFbnRyeQ== - SzQgTGlua3M= - UGFpZCBMaXN0aW5n - TGlzdGluZyBUeXBl - U2hvcHBpbmcgQ2FydCBJdGVt - QWRkaW5nIExpbms= - QWRkaW5nIExpc3Rpbmc= - QWRkaW5nIExpc3RpbmcgVHlwZQ== - RHVwbGljYXRlIExpbmtz - RWRpdGluZyBMaW5r - RWRpdGluZyBMaXN0aW5n - RWRpdGluZyBMaXN0aW5nIFR5cGU= - SW1wb3J0IExpbmtz - TGlua3M= - TGlua3MgRHVwbGljYXRlIENoZWNrZXI= - TGlua3MgRXhwb3J0 - TGlzdGluZyBUeXBlcw== - TmV3IExpbms= - TmV3IExpc3Rpbmc= - TmV3IExpc3RpbmcgVHlwZQ== - UGFpZCBMaXN0aW5ncw== - TGlzdGluZyBUeXBlcw== - U2hvcHBpbmcgQ2FydCBFbnRyeQ== - TWVyZ2U= - TmV3IEZpbGU= - TmV3IExpc3Rpbmc= - TmV3IExpc3RpbmcgVHlwZQ== - WW91IGFyZSBhYm91dCB0byBjYW5jZWwgeW91ciBsaW5rIGVuaGFuY2VtZW50Lg== - WW91IGFyZSBhYm91dCB0byBleHRlbmQgeW91ciBsaW5rIGVuaGFuY2VtZW50Lg== - Q2FuY2VsIExpbmsgRW5oYW5jZW1lbnQ= - QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGNhbmNlbCB5b3VyIGVuaGFuY2VkIGxpbms/IFRoZSBsaXN0aW5nIHR5cGUgd2lsbCBiZSByZXNldCB0byByZWd1bGFyLg== - Q2hvb3NlIExpc3RpbmcgVHlwZQ== - Q29uZmlybSBFbmhhbmNlbWVudCBDYW5jZWw= - Q29uZmlybSBFbmhhbmNlbWVudCBFeHRlbmQ= - RW5oYW5jZQ== - RW5oYW5jZSBMaW5r - VGhhbmsgeW91IGZvciBlbmhhbmNpbmcgeW91ciBsaW5rLiBZb3UgbGluayBlbmhhbmNlbWVudCBpcyBub3cgcGVuZGluZyBhZG1pbmlzdHJhdG9yIGFwcHJvdmFsLiBZb3Ugd2lsbCBiZSBub3RpZmllZCBieSBlbWFpbCB3aGVuIHlvdXIgbGluayBlbmhhbmNlbWVudCBpcyBhcHByb3ZlZC4= - RW5oYW5jZW1lbnQgc2V0IHRvIHJlbmV3IGF1dG9tYXRpY2FsbHkgb24= - RXh0ZW5kL0NhbmNlbCBFbmhhbmNlbWVudA== - RXh0ZW5kIExpbmsgRW5oYW5jZW1lbnQ= - QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGV4dGVuZCB5b3VyIGxpbmsgZW5oYW5jZW1lbnQ/ - Tm8gZGVzY3JpcHRpb24gZW50ZXJlZCE= - Tm8gbmFtZSBlbnRlcmVkIQ== - Tm8gVVJMIGVudGVyZWQh - RnJlZSBMaXN0aW5n - TGluayBFbmhhbmNlbWVudCBSZXN1bHRz - RXhwaXJhdGlvbiBEYXRl - TGlzdGluZyBUeXBl - TGlzdGluZyBUeXBl - QWZ0ZXIgc2VsZWN0aW5nIGxpc3RpbmcgdHlwZSBpdCB3aWxsIGJlIGFkZGVkIHRvIHlvdXIgc2hvcHBpbmcgY2FydC4gT25jZSB5b3UgY29tcGxldGUgY2hlY2tvdXQgYW5kIHlvdXIgb3JkZXIgaXMgYXBwcm92ZWQgeW91ciBsaW5rIHN0YXR1cyB3aWxsIGJlIHVwZ3JhZGVkLiBZb3Ugd2lsbCBiZSBub3RpZmllZCBieSBlbWFpbCB3aGVuIHRoaXMgaXMgZG9uZS4= - cGVuZGluZw== - TGlzdGluZyBUeXBl - dG8gY2FuY2VsIGxpbmsgZW5oYW5jZW1lbnQ= - - - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgYWRkZWQKCllvdXIgbGluayBoYXMgYmVlbiBhZGRlZC4NCjE= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBhZGRlZAoKQSBsaW5rIGhhcyBiZWVuIGFkZGVk - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBhcHByb3ZlZAoKWW91ciBsaW5rIGhhcyBiZWVuIGFwcHJvdmVk - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBkZW5pZWQKCllvdXIgbGluayBoYXMgYmVlbiBkZW5pZWQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQKCkRlYXIgPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJGaXJzdE5hbWUiIC8+IDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iTGFzdE5hbWUiIC8+LA0KDQpUaGFuayB5b3UgZm9yIHN1Ym1pdHRpbmcgbGluayBlbmhhbmNlbWVudCByZXF1ZXN0LiBZb3Ugd2lsbCBiZSBub3RpZmllZCB3aGVuIHlvdXIgbGluayBlbmhhbmNlbWVudCBpcyBwcm9jZXNzZWQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgRW5oYW5jZW1lbnQgc3VibWl0dGVkCgpBIHVzZXIgaGFzIHN1Ym1pdHRlZCBhIGxpbmsgZW5oYW5jZW1lbnQgcmVxdWVzdC4gUGxlYXNlIHByb2NlZWQgdG8gYWRtaW5pc3RyYXRpdmUgY29uc29sZSB0byByZXZpZXcgaXQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgYXBwcm92ZWQKCkRlYXIgPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJGaXJzdE5hbWUiIC8+IDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iTGFzdE5hbWUiIC8+LA0KDQpZb3VyIHJlY2VudCBsaW5rIGVuaGFuY2VtZW50IHJlcXVlc3QgaGFzIGJlZW4gYXBwcm92ZWQuIFRoYW5rIHlvdSENCg== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgYXBwcm92ZWQKCkxpbmsgZW5oYW5jZW1lbnQgaGFzIGJlZW4gYXBwcm92ZWQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgY2FuY2VsbGVkCgpEZWFyIDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iRmlyc3ROYW1lIiAvPiA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9Ikxhc3ROYW1lIiAvPiwNCg0KWW91ciBsaW5rIGVuaGFuY2VtZW50IG9uIDxpbnAyOmNvbmZfQ29uZmlnVmFsdWUgbmFtZT0iU2l0ZV9OYW1lIi8+IGhhcyBiZWVuIGNhbmNlbGxlZC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgY2FuY2VsbGVkCgpMaW5rIGVuaGFuY2VtZW50IGhhcyBiZWVuIGNhbmNlbGxlZC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZGVuaWVkCgpEZWFyIDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iRmlyc3ROYW1lIiAvPiA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9Ikxhc3ROYW1lIiAvPiwNCg0KU29ycnksIGJ1dCB5b3VyIHJlY2VudCBsaW5rIGVuaGFuY2VtZW50IHJlcXVlc3QgaGFzIGJlZW4gZGVuaWVkLg== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZGVuaWVkCgpMaW5rIGVuaGFuY2VtZW50IGhhcyBiZWVuIGRlbmllZC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZXhwaXJlZAoKRGVhciA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9IkZpcnN0TmFtZSIgLz4gPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJMYXN0TmFtZSIgLz4sDQoNCllvdXIgZW5oYW5jZWQgbGluayBhdCA8aW5wMjpjb25mX0NvbmZpZ1ZhbHVlIG5hbWU9IlNpdGVfTmFtZSIvPiBoYXMgZXhwaXJlZC4gSWYgeW91IHdhbnQgdG8gcmVuZXcgeW91ciBlbmhhbmNlZCBsaW5rLCBwbGVhc2UgcmUtc3VibWl0IGxpbmsgZW5oYW5jZW1lbnQgcmVxdWVzdC4gVGhhbmsgeW91IQ== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZXhwaXJlZAoKRW5oYW5jZWQgbGluayBoYXMgZXhwaXJlZC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgcmVuZXdhbAoKRGVhciA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9IkZpcnN0TmFtZSIgLz4gPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJMYXN0TmFtZSIgLz4sDQoNClRoYW5rIHlvdSBmb3Igc3VibWl0dGluZyBsaW5rIGVuaGFuY2VtZW50IHJlbmV3YWwgcmVxdWVzdC4gWW91IHdpbGwgYmUgbm90aWZpZWQgd2hlbiB5b3UgcmVxdWVzdCBpcyBwcm9jZXNzZWQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgcmVuZXdhbCBzdWJtaXRlZAoKTGluayBlbmhhbmNlbWVudCByZW5ld2FsIHJlcXVlc3QgaGFzIGJlZW4gc3VibWl0dGVkLCBwbGVhc2UgcHJvY2VlZCB0byBhZG1pbmlzdHJhdGl2ZSBjb25zb2xlIHRvIHJldmlldyBpdC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZXh0ZW5kZWQKCkRlYXIgPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJGaXJzdE5hbWUiIC8+IDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iTGFzdE5hbWUiIC8+LA0KDQpZb3UgbGluayBlbmhhbmNlbWVudCBvbiA8aW5wMjpjb25mX0NvbmZpZ1ZhbHVlIG5hbWU9IlNpdGVfTmFtZSIvPiBoYXMgYmVlbiBleHRlbmRlZC4gVGhhbmsgeW91IQ== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZXh0ZW5kZWQKCkxpbmsgZW5oYW5jZW1lbnQgaGFzIGJlZW4gZXh0ZW5kZWQ= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IEVuaGFuY2UgTGluayBSZW5ld2FsIEZhaWxlZAoKRW5oYW5jZSBMaW5rIFJlbmV3YWwgRmFpbGVk - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IEVuaGFuY2UgTGluayBSZW5ld2FsIEZhaWxlZAoKRW5oYW5jZSBMaW5rIFJlbmV3YWwgRmFpbGVk - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgcmVuZXdhbCBub3RpY2UKCkRlYXIgPGlucDI6dV9GaWVsZCBuYW1lPSJGaXJzdE5hbWUiIC8+IDxpbnAyOnVfRmllbGQgbmFtZT0iTGFzdE5hbWUiIC8+LA0KDQpZb3VyIGxpbmsgZW5oYW5jZW1lbnQgb24gPGlucDI6Y29uZl9Db25maWdWYWx1ZSBuYW1lPSJTaXRlX05hbWUiLz4gaXMgYWJvdXQgdG8gZXhwaXJlLiBQbGVhc2UgbG9naW4gdG8geW91ciBhY2NvdW50IHRvIHJlbmV3IHlvdXIgbGluayBlbmhhbmNlbWVudC4gVGhhbmsgeW91IQ== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgYWJvdXQgdG8gZXhwaXJlCgpMaW5rIGVuaGFuY2VtZW50IGlzIGFib3V0IHRvIGV4cGlyZS4= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBtb2RpZmVkCgpZb3VyIGxpbmsgaGFzIGJlZW4gbW9kaWZpZWQ= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBtb2RpZmllZAoKQSBsaW5rIGhhcyBiZWVuIG1vZGlmaWVkLg== - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBhcHByb3ZlZAoKWW91ciBsaW5rIG1vZGlmaWNhdGlvbiBoYXMgYmVlbiBhcHByb3ZlZA== - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBtb2RpZmljYXRpb24gZGVuaWVkCgpZb3VyIGxpbmsgbW9kaWZpY2F0aW9uIGhhcyBiZWVuIGRlbmllZC4= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYWRkZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gYWRkZWQ= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYWRkZWQKCkEgbGluayByZXZpZXcgaGFzIGJlZW4gYWRkZWQ= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYWRkZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gYWRkZWQgYW5kIGlzIHBlbmRpbmcgYXBwcm92YWwu - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYXBwcm92ZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gYXBwcm92ZWQ= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgZGVjbGluZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gZGVjbGluZWQ= - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.26.2/in-link/admin/install.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.26.2/in-link/admin/install.php (revision 12746) +++ branches/unlabeled/unlabeled-1.26.2/in-link/admin/install.php (revision 0) @@ -1,85 +0,0 @@ -Init(); - - require_once FULL_PATH.'/admin/install/install_lib.php'; - require_once FULL_PATH.'/kernel/include/tag-class.php'; - if( !isset($objTagList) ) $objTagList = new clsTagList(); - - $ado =& GetADODBConnection(); - - // create module category - $ml_formatter =& $application->recallObject('kMultiLanguage'); - $name_field = $ml_formatter->LangFieldName('Name'); - $description_field = $ml_formatter->LangFieldName('Description'); - - $cat =& $application->recallObject('c', null, Array('skip_autoload' => true)); - $cat->Clear(); - $cat_fields = Array($name_field => 'Directory', 'AutomaticFilename' => 1, 'Filename' => 'Directory', - $description_field => 'Link Directory', 'Status' => 1, 'ParentId' => 0, - 'CategoryTemplate' => 'inlink/index', 'CachedCategoryTemplate' => 'inlink/index'); - $cat->SetDBFieldsFromHash($cat_fields); - $cat->Create(); - $cat_id = $cat->GetID(); - - $filename = FULL_PATH.'/'.$MODULE_NAME.'/admin/install/inportal_schema.sql'; - if (file_exists($filename)) RunSchemaFile($ado, $filename); - - $filename = FULL_PATH.'/'.$MODULE_NAME.'/admin/install/inportal_data.sql'; - if (file_exists($filename)) - { - $sql = file($filename); - for ($x = 0; $x < count($sql); $x++) - { - $sql[$x] = str_replace('{LinkCatId}', $cat_id, $sql[$x]); - } - RunSQLText($ado, $sql); - - $sql = 'SELECT Version FROM '.TABLE_PREFIX.'Modules WHERE Name = '.$ado->qstr('In-Link'); - $mod_version = $application->Conn->GetOne($sql); - - if (!(isset($ini_file) && $ini_file)) { - $ini_file = FULL_PATH.'/config.php'; - $ini_vars = inst_parse_portal_ini($ini_file, true); - } - - set_ini_value('Module Versions', 'In-Link', $mod_version); - save_values(); - - $objTagList->ParseFile(FULL_PATH.'/'.$MODULE_NAME.'/parser.php'); - } - - linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field - - $cat->defineFields(); - $application->removeObject('c-cdata'); - $cat->SetDBField('cust_l_ItemTemplate', 'inlink/detail'); - $cat->Update(); - - $sql = 'DELETE FROM '.TABLE_PREFIX.'Cache WHERE (VarName = "config_files") OR (VarName LIKE "%_parsed")'; - $application->Conn->Query($sql); - - $objModules->Refresh(); - $objModules->SetModuleRoot('In-Link', $cat_id); - - $inp_cat =& $objCatList->GetCategory($cat_id); - $inp_cat->UpdateCachedPath(); - $inp_cat->UpdateACL(); - - finalizeModuleInstall($MODULE_NAME); - -?> Index: branches/unlabeled/unlabeled-1.26.2/in-link/units/listings/listings_event_handler.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.26.2/in-link/units/listings/listings_event_handler.php (revision 12746) +++ branches/unlabeled/unlabeled-1.26.2/in-link/units/listings/listings_event_handler.php (revision 0) @@ -1,673 +0,0 @@ -getObject(); - - $items_info = $this->Application->GetVar('l'); - if (is_array($items_info)) { - $items_info = array_keys($items_info); - $link_id = array_shift($items_info); - - $object->SetDBField($this->Application->RecallVar('dst_field'), $link_id); - $object->IgnoreValidation = true; - // $this->RemoveRequiredFields($object); - $object->Update(); - } - - $this->finalizePopup($event); - } - - function OnPreSaveListing(&$event) - { - $event->redirect=false; - $object =& $event->getObject( Array('skip_autoload' => true) ); - $object->IgnoreValidation = true; - // $this->RemoveRequiredFields($object); - $event->CallSubEvent('OnPreSave'); - $this->Application->SetVar($event->getPrefixSpecial(true).'_id', $object->GetId()); - return; - } - - function OnBeforeItemUpdate(&$event) - { - $object =& $event->getObject(); - if($object->IgnoreValidation) - { - $object->UpdateFormattersMasterFields(); - } - } - - function OnBeforeItemCreate(&$event) - { - $object =& $event->getObject(); - if($object->IgnoreValidation) - { - $object->UpdateFormattersMasterFields(); - } - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnBeforeDeleteFromLive(&$event) - { - $object =& $event->getObject(); - $sql = 'SELECT * FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ListingId = '.$object->GetId(); - $original_values = $this->Conn->GetRow($sql); - - $type_modified = ($object->GetDBField('ListingTypeId') != $original_values['ListingTypeId']); - $link_modified = ($object->GetDBField('ItemResourceId') != $original_values['ItemResourceId']); - $status_modified = ($object->GetDBField('Status') != $original_values['Status']); - - if($status_modified) - { - $email_event = $object->GetDBField('Status') ? 'LINK.ENHANCE.APPROVE' : 'LINK.ENHANCE.APPROVE'; - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser($email_event, $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin($email_event); - } - - if( $type_modified || $link_modified ) - { - $this->ResetLink($original_values); - } - - if( $status_modified || $type_modified || $link_modified ) - { - $this->EnhanceLink($object, $original_values); - } - - if( $status_modified && !($type_modified || $link_modified) ) - { - $this->ResetLink($original_values); - } - } - - function EnhanceLink(&$object, $original_values) - { - if ($object->GetDBField('Status') != STATUS_ACTIVE) { - return false; - } - - if ($object->GetDBField('ExpiresOn') < adodb_mktime()) { - $object->SetDBField('Status', STATUS_PENDING); - $object->Update(); - $this->ResetLink($original_values); - return false; - } - - $this->UpdateLink('OnPurchase', $object->GetDBField('ItemResourceId'), $object->GetDBField('ListingTypeId')); - - $listtype_object =& $this->Application->recallObject('lst'); - if( $listtype_object->GetDBField('OnPurchaseAddToCatEnabled') ) - { - $link_object =& $this->Application->recallObject('l'); - $add_to_cat = (int)$listtype_object->GetDBField('OnPurchaseAddToCat'); - $sql = 'DELETE FROM '.$this->Application->getUnitOption('l-ci', 'TableName').' - WHERE CategoryId = '.$add_to_cat.' - AND ItemResourceId = '.$link_object->GetDBField('ResourceId').' - AND PrimaryCat = 0'; - $this->Conn->Query($sql); - $sql = 'INSERT INTO '.$this->Application->getUnitOption('l-ci', 'TableName').' - (CategoryId, ItemResourceId, PrimaryCat) - VALUES ('.$add_to_cat.', '.$link_object->GetDBField('ResourceId').', 0)'; - $this->Conn->Query($sql); - } - } - - function ResetLink($original_values) - { - static $has_been_reset = Array(); - - if( $original_values['Status'] != STATUS_ACTIVE || - getArrayValue($has_been_reset, $original_values['ListingId']) ) - { - return; - } - - $has_been_reset[$original_values['ListingId']] = 1; - - $this->UpdateLink('OnExpire', $original_values['ItemResourceId'], $original_values['ListingTypeId']); - - $listtype_object =& $this->Application->recallObject('lst'); - if( $listtype_object->GetDBField('OnExpireRemoveFromCatEnabled') ) - { - $remove_from_cat = $listtype_object->GetDBField('OnExpireRemoveFromCat'); - $sql = 'DELETE FROM '.$this->Application->getUnitOption('l-ci', 'TableName').' - WHERE ItemResourceId = '.$original_values['ItemResourceId'].' - AND CategoryId = '.$remove_from_cat.' - AND PrimaryCat = 0'; - $this->Conn->Query($sql); - } - } - - function UpdateLink($action_prefix, $resource_id, $listtype_id) - { - - $link_object =& $this->Application->recallObject('l', null, Array('skip_autoload' => true)); - $link_object->Load($resource_id, 'ResourceId'); - - // "-item", because can be called as regular after event, and just "lst" recalls list instead - $listtype_object =& $this->Application->recallObject('lst.-item', null, Array('skip_autoload' => true)); - $listtype_object->Load($listtype_id); - - $action_fields = Array( 'EdPick' => 'EditorsPick', - 'New' => 'NewItem', - 'Hot' => 'HotItem', - 'Pop' => 'PopItem' - ); - // $action_prefix = 'OnPurchase'; - - foreach($action_fields as $action => $field) - { - $action_value = $listtype_object->GetDBField($action_prefix.$action); - if( $action_value != 3 ) - { - $link_object->SetDBField($field, $action_value); - } - } - - $priority_value = $listtype_object->GetDBField($action_prefix.'PriorityValue'); - switch( $listtype_object->GetDBField($action_prefix.'PriorityAction') ) - { - case 1: // equal - $link_object->SetDBField('Priority', $priority_value); - break; - case 2: // increase - $original_priority = $link_object->GetDBField('Priority'); - $link_object->SetDBField('Priority', $original_priority + $priority_value); - break; - case 3: // decrease - $original_priority = $link_object->GetDBField('Priority'); - $link_object->SetDBField('Priority', $original_priority - $priority_value); - break; - default: - } - - $link_object->Update(); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnRequestEnhancement(&$event) - { - if ($this->Application->isModuleEnabled('In-Commerce')) { - $l_info = $this->Application->GetVar('l'); - if (!$l_info) { - return false; - } - - list($link_id, $link_info) = each($l_info); - $listing_type_id = $link_info['ListingTypeId']; - - $listing_type =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing_type->Load($listing_type_id); - - if ($listing_type->GetDBField('EnableBuying')) { - $add_to_cart_event =& new kEvent('ord:OnAddVirtualProductToCart'); - $this->Application->HandleEvent($add_to_cart_event); - if($add_to_cart_event->redirect) - { - $event->SetRedirectParam('pass', 'm'); - $event->redirect = $add_to_cart_event->redirect; - } - return true; - } - } - - $event->CallSubEvent('OnListingCreate'); - } - - /** - * Create listing or extend existing listing period - * - * @param kEvent $event - */ - function OnListingCreate(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - - switch ($event->Name) { - case 'EnhanceLinkAfterOrderApprove': - case 'EnhancedLinkOnCompleteOrder': - // when order with listing virtual product is approved - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $listing_type_id = $item_data['ListingTypeId']; - $link_id = $item_data['LinkId']; - - $new_processing = getArrayValue($item_data, 'HasNewProcessing'); - break; - - case 'OnListingCreate': - // when requesting enhancement from front (and not via in-commerce) - $links_info = $this->Application->GetVar('l'); - if (!$links_info) return false; - - $event->redirect = false; - list($link_id, $link_info) = each($links_info); - $listing_type_id = $link_info['ListingTypeId']; - - $new_processing = false; - break; - } - - // get resource_id of link beeing enhanced - $sql = 'SELECT ResourceId - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $resource_id = $this->Conn->GetOne($sql); - - // get listing by link's resource_id - $object->Load($resource_id, 'ItemResourceId'); - if ($object->isLoaded()) { - $original_values = $object->FieldValues; - } - else { - // set initial fields to listing - $object->SetDBField('ListingTypeId', $listing_type_id); - $object->SetDBField('ItemResourceId', $resource_id); - - if ($event->Name == 'OnListingCreate' || $new_processing) { - $item_status = STATUS_PENDING; - } - else { - $item_status = STATUS_ACTIVE; - } - - $object->SetDBField('Status', $item_status); - } - - // set date of purchase for new listings - $purchased_on = max(adodb_mktime(), $object->GetDBField('ExpiresOn')); - if (!$object->isLoaded()) { - $object->SetDBField('PurchasedOn_date', $purchased_on); - $object->SetDBField('PurchasedOn_time', $purchased_on); - } - - // set expiration time for listing - $listing_type =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing_type->Load($listing_type_id); - - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $listing_type->GetDBField('Duration'); - $duration_type = $listing_type->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $expiration_date = $purchased_on + $expiration_interval; - $object->SetDBField('ExpiresOn_date', $expiration_date); - $object->SetDBField('ExpiresOn_time', $expiration_date); - - // when extending enhancement mark listing as non-received renewal reminder - $object->SetDBField('RenewalReminderSent', 0); - - $action = $object->isLoaded() ? 'Update' : 'Create'; - if ($object->$action()) { - $event->status = erSUCCESS; - switch ($event->Name) { - case 'EnhanceLinkAfterOrderApprove': - case 'EnhancedLinkOnCompleteOrder': - // when order with listing virtual product is approved - if (getArrayValue($original_values, 'Status') != STATUS_ACTIVE) { - $this->EnhanceLink($object, Array()); - } - break; - - case 'OnListingCreate': - // when requesting enhancement from front (and not via in-commerce) - $event->redirect = $this->Application->GetVar('success_template'); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE'); - break; - } - - - } - else { - $event->status = erFAIL; - } - - - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function EnhancedLinkOnCompleteOrder(&$event) - { - // create enhancement, but pending - $this->OnListingCreate($event); - - // save created listing_id back to itemdata - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - unset($item_data['ListingTypeId']); - $item_data['ListingId'] = $object->GetID(); - - $orditems_idfield = $this->Application->getUnitOption('orditems', 'IDField'); - $orditems_table = $this->Application->getUnitOption('orditems', 'TableName'); - - $this->Conn->doUpdate( Array('ItemData' => serialize($item_data)), $orditems_table, $orditems_idfield.' = '.$fields['OrderItemId'] ); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function EnhanceLinkAfterOrderApprove(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - - if ( getArrayValue($item_data, 'HasNewProcessing') ) { - // new processing: just approve created listing here - $listing_id = $item_data['ListingId']; - $object->Load($listing_id); - $object->SetDBField('Status', STATUS_ACTIVE); - $object->Update(); - - $this->EnhanceLink($object, Array()); - return true; - } - else { - // create listing & approve it at the same time - $this->OnListingCreate($event); - } - } - - /** - * Delete listing - * - * @param kEvent $event - */ - function EnhanceLinkAfterOrderDeny(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $listing_id = $item_data['ListingId']; - - $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); - $temp_handler->DeleteItems($event->Prefix, $event->Special, Array($listing_id)); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function ExpireLink(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$item_data['LinkId']; - $listing_id = $this->Conn->GetOne($sql); - $object->Load($listing_id); - $original_values = $object->FieldValues; - $object->SetDBField('Status', 2); - - if($object->Update()) - { - $event->status = erSUCCESS; - $this->ResetLink($original_values); - } - else - { - $event->status = erFAIL; - } - } - - function iterateItems(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $this->StoreSelectedIDs($event); - - if($event->Name == 'OnMassApprove') - { - $ids = $this->getSelectedIDs($event); - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') != 1) - { - $original_values = $object->FieldValues; - $object->SetDBField('Status', 1); - $this->EnhanceLink($object, $original_values); - } - } - } - if($event->Name == 'OnMassDecline') - { - $ids = $this->getSelectedIDs($event); - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') == 1) - { - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.DENY', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.DENY'); - } - } - } - parent::iterateItems($event); - if($event->Name == 'OnMassApprove') - { - $lst_object =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $ids = $this->getSelectedIDs($event); - if($ids) - { - foreach($ids as $id) - { - $object->Load($id); - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $owner_id = $this->Conn->GetOne($sql); - if($object->GetDBField('PendingRenewal') == 1) - { - $lst_object->Load( $object->GetDBField('ListingTypeId') ); - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $lst_object->GetDBField('Duration'); - $duration_type = $lst_object->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $renewal_begins = max( adodb_mktime(), $object->GetDBField('ExpiresOn') ); - $expiration_date = $renewal_begins + $expiration_interval; - - $object->SetDBField('ExpiresOn_date', $expiration_date); - $object->SetDBField('ExpiresOn_time', $expiration_date); - - $object->SetDBField('RenewalReminderSent', 0); - $object->SetDBField('PendingRenewal', 0); - - if( $object->Update() ) - { - $event->status=erSUCCESS; - $event->redirect_params = Array('opener' => 's', 'pass_events' => true); //stay! - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.RENEW', $owner_id); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.RENEW'); - } - else - { - $event->status=erFAIL; - $event->redirect=false; - break; - } - } - else - { - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.APPROVE', $owner_id); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.APPROVE'); - } - } - } - } - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnCancel(&$event) - { - parent::OnCancel($event); - $event->SetRedirectParam('opener', 's'); - $event->redirect = $this->Application->GetVar('cancel_template'); - } - - function OnExtendEnhancement(&$event) - { - $link_id = $this->Application->GetVar('l_id'); - $sql = 'SELECT ResourceId FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $link_resource_id = $this->Conn->GetOne($sql); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$link_resource_id; - - $object =& $event->getObject( Array('skip_autoload' => true) ); - $object->Load( $this->Conn->GetOne($sql) ); - - $object->SetDBField('PendingRenewal', 1); - $object->Update(); - $event->redirect = $this->Application->GetVar('success_template'); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.EXTEND', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.EXTEND'); - } - - function OnCancelEnhancement(&$event) - { - $link_id = $this->Application->GetVar('l_id'); - $sql = 'SELECT ResourceId FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $link_resource_id = $this->Conn->GetOne($sql); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$link_resource_id; - - $object =& $this->Application->recallObject($event->Prefix, null, Array('skip_autoload' => true)); - $object->Load( $this->Conn->GetOne($sql) ); - $original_values = $object->FieldValues; - $original_values['Status'] = 1; - $this->ResetLink($original_values); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.CANCEL', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.CANCEL'); - - $object->Delete(); - $event->redirect = $this->Application->GetVar('success_template'); - } - - function OnCheckExpiredPaidListings(&$event) - { - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ExpiresOn < '.adodb_mktime().' AND Status = 1'; - $expired_listings = $this->Conn->GetCol($sql); - if(is_array($expired_listings) && count($expired_listings) > 0) - { - $object =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true)); - foreach($expired_listings as $listing_id) - { - $object->Load($listing_id); - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - $object->SetDBField('Status', 2); - $object->Update(); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.EXPIRE', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.EXPIRE'); - } - } - - $sql = 'SELECT ls.ListingId, l.CreatedById FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' ls - LEFT JOIN '.$this->Application->getUnitOption('lst', 'TableName').' lst - ON ls.ListingTypeId = lst.ListingTypeId - LEFT JOIN '.$this->Application->getUnitOption('l', 'TableName').' l - ON ls.ItemResourceId = l.ResourceId - WHERE ls.Status = 1 - AND ls.ExpiresOn < '.adodb_mktime().' + lst.RenewalReminder * 3600 *24 - AND ls.RenewalReminderSent = 0'; - $res = $this->Conn->Query($sql); - if(is_array($res) && count($res) > 0) - { - $listing_ids = Array(); - foreach($res as $record) - { - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.RENEWAL.NOTICE', $record['CreatedById']); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.RENEWAL.NOTICE'); - $listing_ids[] = $record['ListingId']; - } - $sql = 'UPDATE '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - SET RenewalReminderSent = 1 - WHERE ListingId IN ('.implode(',', $listing_ids).')'; - $this->Conn->Query($sql); - } - } - - function OnMassDelete(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $this->StoreSelectedIDs($event); - - $ids = $this->getSelectedIDs($event); - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') == 1) - { - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - } - } - parent::OnMassDelete($event); - } -} - -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.2.2/in-link/admin/install/upgrades/inportal_upgrade_v3.2.1.sql =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.2.2/in-link/admin/install/upgrades/inportal_upgrade_v3.2.1.sql (revision 12746) +++ branches/unlabeled/unlabeled-1.2.2/in-link/admin/install/upgrades/inportal_upgrade_v3.2.1.sql (revision 0) @@ -1,40 +0,0 @@ -UPDATE ConfigurationAdmin SET VariableName = 'Link_MinPopVotes', prompt = 'la_fld_Link_MinPopVotes' WHERE VariableName = 'Link_MinVotes'; -UPDATE ConfigurationAdmin SET VariableName = 'Link_MinPopRating', prompt = 'la_fld_Link_MinPopRating' WHERE VariableName = 'Link_TopCount'; -UPDATE ConfigurationAdmin SET VariableName = 'Link_MaxHotNumber', prompt = 'la_fld_Link_MaxHotNumber' WHERE VariableName = 'Link_VotesToHot'; - -UPDATE ConfigurationValues SET VariableName = 'Link_MinPopVotes' WHERE VariableName = 'Link_MinVotes'; -UPDATE ConfigurationValues SET VariableName = 'Link_MinPopRating' WHERE VariableName = 'Link_TopCount'; -UPDATE ConfigurationValues SET VariableName = 'Link_MaxHotNumber' WHERE VariableName = 'Link_VotesToHot'; - -UPDATE ConfigurationAdmin SET DisplayOrder = '10.01', GroupDisplayOrder = 1 WHERE VariableName = 'Link_SortField'; -UPDATE ConfigurationAdmin SET DisplayOrder = '10.01', GroupDisplayOrder = 2 WHERE VariableName = 'Link_SortOrder'; -UPDATE ConfigurationAdmin SET DisplayOrder = '10.02', GroupDisplayOrder = 1 WHERE VariableName = 'Link_SortField2'; -UPDATE ConfigurationAdmin SET DisplayOrder = '10.02', GroupDisplayOrder = 2 WHERE VariableName = 'Link_SortOrder2'; -UPDATE ConfigurationAdmin SET DisplayOrder = '10.03' WHERE VariableName = 'Perpage_Links'; -UPDATE ConfigurationAdmin SET DisplayOrder = '10.04' WHERE VariableName = 'Perpage_Links_Short'; -UPDATE ConfigurationAdmin SET DisplayOrder = '10.05' WHERE VariableName = 'Link_NewDays'; -UPDATE ConfigurationAdmin SET DisplayOrder = '10.06' WHERE VariableName = 'Link_MinPopRating'; -UPDATE ConfigurationAdmin SET DisplayOrder = '10.07' WHERE VariableName = 'Link_MinPopVotes'; -UPDATE ConfigurationAdmin SET DisplayOrder = '10.08' WHERE VariableName = 'Link_MaxHotNumber'; -UPDATE ConfigurationAdmin SET DisplayOrder = '10.09' WHERE VariableName = 'Link_EnhancedLinks'; -UPDATE ConfigurationAdmin SET DisplayOrder = '10.10' WHERE VariableName = 'Link_AllowFreeListings'; -UPDATE ConfigurationAdmin SET DisplayOrder = '10.11' WHERE VariableName = 'Link_ShowPick'; -UPDATE ConfigurationAdmin SET DisplayOrder = '10.12' WHERE VariableName = 'Link_UrlStatus'; -UPDATE ConfigurationAdmin SET DisplayOrder = '10.13', GroupDisplayOrder = 1 WHERE VariableName = 'link_ReviewDelay_Value'; -UPDATE ConfigurationAdmin SET DisplayOrder = '10.13', GroupDisplayOrder = 2 WHERE VariableName = 'link_ReviewDelay_Interval'; -UPDATE ConfigurationAdmin SET DisplayOrder = '10.14', GroupDisplayOrder = 1 WHERE VariableName = 'link_RatingDelay_Value'; -UPDATE ConfigurationAdmin SET DisplayOrder = '10.14', GroupDisplayOrder = 2 WHERE VariableName = 'link_RatingDelay_Interval'; -UPDATE ConfigurationAdmin SET DisplayOrder = '20.01', GroupDisplayOrder = 1 WHERE VariableName = 'Link_ReviewsSort'; -UPDATE ConfigurationAdmin SET DisplayOrder = '20.01', GroupDisplayOrder = 2 WHERE VariableName = 'Link_ReviewsOrder'; -UPDATE ConfigurationAdmin SET DisplayOrder = '20.02', GroupDisplayOrder = 1 WHERE VariableName = 'Link_ReviewsSort2'; -UPDATE ConfigurationAdmin SET DisplayOrder = '20.02', GroupDisplayOrder = 2 WHERE VariableName = 'Link_ReviewsOrder2'; -UPDATE ConfigurationAdmin SET DisplayOrder = '20.03' WHERE VariableName = 'Perpage_LinkReviews'; -UPDATE ConfigurationAdmin SET DisplayOrder = '30.01' WHERE VariableName = 'l_CategoryTemplate'; -UPDATE ConfigurationAdmin SET DisplayOrder = '30.02' WHERE VariableName = 'l_ItemTemplate'; - -ALTER TABLE Link CHANGE EditorsPick EditorsPick TINYINT(4) NOT NULL DEFAULT '0'; -ALTER TABLE Link CHANGE Status Status TINYINT(4) NOT NULL DEFAULT '2'; - -INSERT INTO CustomField (Type, FieldName, FieldLabel, Heading, Prompt, ElementType, ValueList, DisplayOrder, OnGeneralTab, IsSystem) VALUES (1, 'l_ItemTemplate', 'l_ItemTemplate', 'la_title_SystemCF', 'l_ItemTemplate', 'text', NULL, 0, 0, 1); - -UPDATE Modules SET Version = '3.2.1' WHERE Name = 'In-Link'; \ No newline at end of file Index: branches/unlabeled/unlabeled-1.2.2/in-link/admin/install/upgrades/inportal_upgrade_v3.1.7.sql =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.2.2/in-link/admin/install/upgrades/inportal_upgrade_v3.1.7.sql (revision 12746) +++ branches/unlabeled/unlabeled-1.2.2/in-link/admin/install/upgrades/inportal_upgrade_v3.1.7.sql (revision 0) @@ -1,18 +0,0 @@ -UPDATE ConfigurationValues SET ModuleOwner = 'In-Link', Section = 'in-link:configuration_search' WHERE VariableName LIKE 'SearchRel_%_links' OR VariableName = 'Search_ShowMultiple_link'; -UPDATE ConfigurationValues SET VariableName = 'Search_ShowMultiple_links' WHERE VariableName = 'Search_ShowMultiple_link'; - -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_links', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_links', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_links', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_links', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_links', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 1); - -CREATE TABLE LinkCustomData (CustomDataId int(11) NOT NULL auto_increment, ResourceId int(10) unsigned NOT NULL default '0', PRIMARY KEY (CustomDataId)); - -INSERT INTO ConfigurationAdmin VALUES ('l_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 1, 0); -INSERT INTO ConfigurationAdmin VALUES ('l_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 1, 0); - -INSERT INTO ConfigurationValues VALUES ('l_CategoryTemplate', 'inlink/index', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES ('l_ItemTemplate', 'inlink/detail', 'In-Link', 'in-link:configuration_output'); - -UPDATE Modules SET Version = '3.1.7' WHERE Name = 'In-Link'; \ No newline at end of file Index: branches/unlabeled/unlabeled-1.2.2/in-link/admin/install/upgrades/inportal_upgrade_v3.2.0.sql =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.2.2/in-link/admin/install/upgrades/inportal_upgrade_v3.2.0.sql (revision 12746) +++ branches/unlabeled/unlabeled-1.2.2/in-link/admin/install/upgrades/inportal_upgrade_v3.2.0.sql (revision 0) @@ -1,35 +0,0 @@ -ALTER TABLE LinkCustomData ADD INDEX (ResourceId); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:inlink_general.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:inlink_general.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_output.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_output.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_search.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_search.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_email.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_email.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.advanced:approve', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.advanced:decline', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.delete', 11, 1, 1, 0); - -UPDATE ConfigurationAdmin SET ValueList = 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 4) AND (IsSystem = 0)' WHERE VariableName IN ('Link_SortField', 'Link_SortField2'); - -UPDATE Modules SET Version = '3.2.0' WHERE Name = 'In-Link'; \ No newline at end of file Index: branches/unlabeled/unlabeled-1.2.2/in-link/admin_templates/links/relations_edit.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.2.2/in-link/admin_templates/links/relations_edit.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.2.2/in-link/admin_templates/links/relations_edit.tpl (revision 0) @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - - - - - - - -
    - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.2.2/in-link/admin_templates/links/links_categories.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.2.2/in-link/admin_templates/links/links_categories.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.2.2/in-link/admin_templates/links/links_categories.tpl (revision 0) @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - -
    - -
    - - - - " id=""> - ">  - - - - - - - - Index: branches/unlabeled/unlabeled-1.2.2/in-link/admin_templates/links/review_edit.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.2.2/in-link/admin_templates/links/review_edit.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.2.2/in-link/admin_templates/links/review_edit.tpl (revision 0) @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - - - - -
    - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.2.2/in-link/admin_templates/export_finish.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.2.2/in-link/admin_templates/export_finish.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.2.2/in-link/admin_templates/export_finish.tpl (revision 0) @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - "> - - - - - "> - - - - -
    - - - "> -  
    - -
    - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.34.2/in-link/units/listings/listings_event_handler.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.34.2/in-link/units/listings/listings_event_handler.php (revision 12746) +++ branches/unlabeled/unlabeled-1.34.2/in-link/units/listings/listings_event_handler.php (revision 0) @@ -1,748 +0,0 @@ - Array ('self' => true), - 'OnCancelEnhancement' => Array ('self' => true), - 'OnExtendEnhancement' => Array ('self' => true), - - ); - $this->permMapping = array_merge($this->permMapping, $permissions); - } - - /** - * Adds selected link to listing - * - * @param kEvent $event - */ - function OnProcessSelected(&$event) - { - $object =& $event->getObject(); - - $selected_ids = $this->Application->GetVar('selected_ids'); - if ($selected_ids['l']) { - $link_id = $selected_ids['l']; - $sql = 'SELECT ResourceId - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE '.$this->Application->getUnitOption('l', 'IDField').' = '.$link_id; - - $object->SetDBField($this->Application->RecallVar('dst_field'), $this->Conn->GetOne($sql)); - $object->IgnoreValidation = true; - // $this->RemoveRequiredFields($object); - $object->Update(); - } - - $this->finalizePopup($event); - } - - function OnPreSaveListing(&$event) - { - $event->redirect=false; - $object =& $event->getObject( Array('skip_autoload' => true) ); - $object->IgnoreValidation = true; - // $this->RemoveRequiredFields($object); - $event->CallSubEvent('OnPreSave'); - $this->Application->SetVar($event->getPrefixSpecial(true).'_id', $object->GetId()); - return; - } - - function OnBeforeItemUpdate(&$event) - { - $object =& $event->getObject(); - if($object->IgnoreValidation) - { - $object->UpdateFormattersMasterFields(); - } - } - - function OnBeforeItemCreate(&$event) - { - $object =& $event->getObject(); - if($object->IgnoreValidation) - { - $object->UpdateFormattersMasterFields(); - } - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnBeforeDeleteFromLive(&$event) - { - $object =& $event->getObject(); - $sql = 'SELECT * FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ListingId = '.$object->GetId(); - $original_values = $this->Conn->GetRow($sql); - - $type_modified = ($object->GetDBField('ListingTypeId') != $original_values['ListingTypeId']); - $link_modified = ($object->GetDBField('ItemResourceId') != $original_values['ItemResourceId']); - $status_modified = ($object->GetDBField('Status') != $original_values['Status']); - - if($status_modified) - { - $email_event = $object->GetDBField('Status') ? 'LINK.ENHANCE.APPROVE' : 'LINK.ENHANCE.APPROVE'; - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser($email_event, $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin($email_event); - } - - if( $type_modified || $link_modified ) - { - $this->ResetLink($original_values); - } - - if( $status_modified || $type_modified || $link_modified ) - { - $this->EnhanceLink($object, $original_values); - } - - if( $status_modified && !($type_modified || $link_modified) ) - { - $this->ResetLink($original_values); - } - } - - function EnhanceLink(&$object, $original_values) - { - if ($object->GetDBField('Status') != STATUS_ACTIVE) { - return false; - } - - if ($object->GetDBField('ExpiresOn') < adodb_mktime()) { - $object->SetDBField('Status', STATUS_PENDING); - $object->Update(); - $this->ResetLink($original_values); - return false; - } - - $this->UpdateLink('OnPurchase', $object->GetDBField('ItemResourceId'), $object->GetDBField('ListingTypeId')); - - $listtype_object =& $this->Application->recallObject('lst'); - if( $listtype_object->GetDBField('OnPurchaseAddToCatEnabled') ) - { - $link_object =& $this->Application->recallObject('l'); - $add_to_cat = (int)$listtype_object->GetDBField('OnPurchaseAddToCat'); - $sql = 'DELETE FROM '.$this->Application->getUnitOption('l-ci', 'TableName').' - WHERE CategoryId = '.$add_to_cat.' - AND ItemResourceId = '.$link_object->GetDBField('ResourceId').' - AND PrimaryCat = 0'; - $this->Conn->Query($sql); - $sql = 'INSERT INTO '.$this->Application->getUnitOption('l-ci', 'TableName').' - (CategoryId, ItemResourceId, PrimaryCat) - VALUES ('.$add_to_cat.', '.$link_object->GetDBField('ResourceId').', 0)'; - $this->Conn->Query($sql); - } - } - - function ResetLink($original_values) - { - static $has_been_reset = Array(); - - if( $original_values['Status'] != STATUS_ACTIVE || - getArrayValue($has_been_reset, $original_values['ListingId']) ) - { - return; - } - - $has_been_reset[$original_values['ListingId']] = 1; - - $this->UpdateLink('OnExpire', $original_values['ItemResourceId'], $original_values['ListingTypeId']); - - $listtype_object =& $this->Application->recallObject('lst'); - if( $listtype_object->GetDBField('OnExpireRemoveFromCatEnabled') ) - { - $remove_from_cat = $listtype_object->GetDBField('OnExpireRemoveFromCat'); - $sql = 'DELETE FROM '.$this->Application->getUnitOption('l-ci', 'TableName').' - WHERE ItemResourceId = '.$original_values['ItemResourceId'].' - AND CategoryId = '.$remove_from_cat.' - AND PrimaryCat = 0'; - $this->Conn->Query($sql); - } - } - - function UpdateLink($action_prefix, $resource_id, $listtype_id) - { - - $link_object =& $this->Application->recallObject('l', null, Array('skip_autoload' => true)); - $link_object->Load($resource_id, 'ResourceId'); - - // "-item", because can be called as regular after event, and just "lst" recalls list instead - $listtype_object =& $this->Application->recallObject('lst.-item', null, Array('skip_autoload' => true)); - $listtype_object->Load($listtype_id); - - $action_fields = Array( 'EdPick' => 'EditorsPick', - 'New' => 'NewItem', - 'Hot' => 'HotItem', - 'Pop' => 'PopItem', - 'Status' => 'Status' - ); - // $action_prefix = 'OnPurchase'; - - foreach($action_fields as $action => $field) - { - $action_value = $listtype_object->GetDBField($action_prefix.$action); - if( $action_value != 3 ) - { - $link_object->SetDBField($field, $action_value); - } - } - - $priority_value = $listtype_object->GetDBField($action_prefix.'PriorityValue'); - switch( $listtype_object->GetDBField($action_prefix.'PriorityAction') ) - { - case 1: // equal - $link_object->SetDBField('Priority', $priority_value); - break; - case 2: // increase - $original_priority = $link_object->GetDBField('Priority'); - $link_object->SetDBField('Priority', $original_priority + $priority_value); - break; - case 3: // decrease - $original_priority = $link_object->GetDBField('Priority'); - $link_object->SetDBField('Priority', $original_priority - $priority_value); - break; - default: - } - - $link_object->Update(); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnRequestEnhancement(&$event) - { - if ($this->Application->isModuleEnabled('In-Commerce')) { - $l_info = $this->Application->GetVar('l'); - if (!$l_info) { - return false; - } - - list($link_id, $link_info) = each($l_info); - $listing_type_id = $link_info['ListingTypeId']; - - $listing_type =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing_type->Load($listing_type_id); - - if ($listing_type->GetDBField('EnableBuying')) { - $add_to_cart_event =& new kEvent('ord:OnAddVirtualProductToCart'); - $this->Application->HandleEvent($add_to_cart_event); - - if($add_to_cart_event->redirect) - { - $event->SetRedirectParam('pass', 'm'); - $event->redirect = $add_to_cart_event->redirect; - } - return true; - } - } - - $event->CallSubEvent('OnListingCreate'); - } - - /** - * Create listing or extend existing listing period - * - * @param kEvent $event - */ - function OnListingCreate(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - - switch ($event->Name) { - case 'EnhanceLinkAfterOrderApprove': - case 'EnhancedLinkOnCompleteOrder': - // when order with listing virtual product is approved - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $listing_type_id = $item_data['ListingTypeId']; - $link_id = $item_data['LinkId']; - - $new_processing = getArrayValue($item_data, 'HasNewProcessing'); - break; - - case 'OnListingCreate': - // when requesting enhancement from front (and not via in-commerce) - $links_info = $this->Application->GetVar('l'); - if (!$links_info) return false; - - $event->redirect = false; - list($link_id, $link_info) = each($links_info); - $listing_type_id = $link_info['ListingTypeId']; - - $new_processing = false; - break; - } - - // get resource_id of link beeing enhanced - $sql = 'SELECT ResourceId - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $resource_id = $this->Conn->GetOne($sql); - - // get listing by link's resource_id - $object->Load($resource_id, 'ItemResourceId'); - if ($object->isLoaded()) { - $original_values = $object->FieldValues; - } - else { - // set initial fields to listing - $object->SetDBField('ListingTypeId', $listing_type_id); - $object->SetDBField('ItemResourceId', $resource_id); - - if ($event->Name == 'OnListingCreate' || $new_processing) { - $item_status = STATUS_PENDING; - } - else { - $item_status = STATUS_ACTIVE; - } - - $object->SetDBField('Status', $item_status); - } - - // set date of purchase for new listings - $purchased_on = max(adodb_mktime(), $object->GetDBField('ExpiresOn')); - if (!$object->isLoaded()) { - $object->SetDBField('PurchasedOn_date', $purchased_on); - $object->SetDBField('PurchasedOn_time', $purchased_on); - } - - // set expiration time for listing - $listing_type =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing_type->Load($listing_type_id); - - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $listing_type->GetDBField('Duration'); - $duration_type = $listing_type->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $expiration_date = $purchased_on + $expiration_interval; - $object->SetDBField('ExpiresOn_date', $expiration_date); - $object->SetDBField('ExpiresOn_time', $expiration_date); - - // when extending enhancement mark listing as non-received renewal reminder - $object->SetDBField('RenewalReminderSent', 0); - - $action = $object->isLoaded() ? 'Update' : 'Create'; - if ($object->$action()) { - $event->status = erSUCCESS; - switch ($event->Name) { - case 'EnhanceLinkAfterOrderApprove': - case 'EnhancedLinkOnCompleteOrder': - // when order with listing virtual product is approved - if (getArrayValue($original_values, 'Status') != STATUS_ACTIVE) { - $this->EnhanceLink($object, Array()); - } - break; - - case 'OnListingCreate': - // when requesting enhancement from front (and not via in-commerce) - $event->redirect = $this->Application->GetVar('success_template'); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE'); - break; - } - - - } - else { - $event->status = erFAIL; - } - - - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function EnhancedLinkOnCompleteOrder(&$event) - { - // create enhancement, but pending - $this->OnListingCreate($event); - - // save created listing_id back to itemdata - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - unset($item_data['ListingTypeId']); - $item_data['ListingId'] = $object->GetID(); - - $orditems_idfield = $this->Application->getUnitOption('orditems', 'IDField'); - $orditems_table = $this->Application->getUnitOption('orditems', 'TableName'); - - $this->Conn->doUpdate( Array('ItemData' => serialize($item_data)), $orditems_table, $orditems_idfield.' = '.$fields['OrderItemId'] ); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function EnhanceLinkAfterOrderApprove(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - - if ( getArrayValue($item_data, 'HasNewProcessing') ) { - // new processing: just approve created listing here - $listing_id = $item_data['ListingId']; - $object->Load($listing_id); - - // moved enhancement period to time admin approved enhancement - $time_diff = adodb_mktime() - $object->GetDBField('PurchasedOn'); - $object->SetDBField('PurchasedOn_date', $object->GetDBField('PurchasedOn_date') + $time_diff); - $object->SetDBField('PurchasedOn_time', $object->GetDBField('PurchasedOn_time') + $time_diff); - $object->SetDBField('ExpiresOn_date', $object->GetDBField('ExpiresOn_date') + $time_diff); - $object->SetDBField('ExpiresOn_time', $object->GetDBField('ExpiresOn_time') + $time_diff); - - $object->SetDBField('Status', STATUS_ACTIVE); - $object->Update(); - - $this->EnhanceLink($object, Array()); - return true; - } - else { - // create listing & approve it at the same time - $this->OnListingCreate($event); - } - } - - /** - * Delete listing - * - * @param kEvent $event - */ - function EnhanceLinkAfterOrderDeny(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $listing_id = $item_data['ListingId']; - - $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); - $temp_handler->DeleteItems($event->Prefix, $event->Special, Array($listing_id)); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function ExpireLink(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$item_data['LinkId']; - $listing_id = $this->Conn->GetOne($sql); - $object->Load($listing_id); - $original_values = $object->FieldValues; - $object->SetDBField('Status', 2); - - if($object->Update()) - { - $event->status = erSUCCESS; - $this->ResetLink($original_values); - } - else - { - $event->status = erFAIL; - } - } - - function iterateItems(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $ids = $this->StoreSelectedIDs($event); - - if($event->Name == 'OnMassApprove') - { - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') != 1) - { - $original_values = $object->FieldValues; - $object->SetDBField('Status', 1); - $this->EnhanceLink($object, $original_values); - } - } - } - if($event->Name == 'OnMassDecline') - { - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') == 1) - { - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.DENY', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.DENY'); - } - } - } - parent::iterateItems($event); - if($event->Name == 'OnMassApprove') - { - $lst_object =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $ids = $this->getSelectedIDs($event); - if($ids) - { - foreach($ids as $id) - { - $object->Load($id); - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $owner_id = $this->Conn->GetOne($sql); - if($object->GetDBField('PendingRenewal') == 1) - { - $lst_object->Load( $object->GetDBField('ListingTypeId') ); - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $lst_object->GetDBField('Duration'); - $duration_type = $lst_object->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $renewal_begins = max( adodb_mktime(), $object->GetDBField('ExpiresOn') ); - $expiration_date = $renewal_begins + $expiration_interval; - - $object->SetDBField('ExpiresOn_date', $expiration_date); - $object->SetDBField('ExpiresOn_time', $expiration_date); - - $object->SetDBField('RenewalReminderSent', 0); - $object->SetDBField('PendingRenewal', 0); - - if( $object->Update() ) - { - $event->status=erSUCCESS; - $event->redirect_params = Array('opener' => 's'); //stay! - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.RENEW', $owner_id); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.RENEW'); - } - else - { - $event->status=erFAIL; - $event->redirect=false; - break; - } - } - else - { - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.APPROVE', $owner_id); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.APPROVE'); - } - } - } - } - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnCancel(&$event) - { - parent::OnCancel($event); - $event->SetRedirectParam('opener', 's'); - $event->redirect = $this->Application->GetVar('cancel_template'); - } - - /** - * Checks that user is owner of link & returns listing id if permissions are ok - * - * @param kEvent $event - * @return mixed - */ - function verifyListingOwner(&$event) - { - $link_id = $this->Application->GetVar('l_id'); - $user_id = $this->Application->RecallVar('user_id'); - $sql = 'SELECT ResourceId - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE (LinkId = '.$link_id.') AND (CreatedById = '.$user_id.')'; - $resource_id = $this->Conn->GetOne($sql); - - if (!$resource_id) { - $event->status = erFAIL; - return false; - } - - $sql = 'SELECT ListingId - FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$resource_id; - - return $this->Conn->GetOne($sql); - } - - function OnExtendEnhancement(&$event) - { - $listing_id = $this->verifyListingOwner($event); - if (!$listing_id) { - return ; - } - - $object =& $event->getObject( Array('skip_autoload' => true) ); - $object->Load($listing_id); - - $object->SetDBField('PendingRenewal', 1); - $object->Update(); - $event->redirect = $this->Application->GetVar('success_template'); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.EXTEND', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.EXTEND'); - } - - function OnCancelEnhancement(&$event) - { - $listing_id = $this->verifyListingOwner($event); - if (!$listing_id) { - return ; - } - - $object =& $event->getObject( Array('skip_autoload' => true) ); - $object->Load($listing_id); - - $original_values = $object->FieldValues; - $original_values['Status'] = 1; - $this->ResetLink($original_values); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.CANCEL', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.CANCEL'); - - $object->Delete(); - $event->redirect = $this->Application->GetVar('success_template'); - } - - function OnCheckExpiredPaidListings(&$event) - { - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ExpiresOn < '.adodb_mktime().' AND Status = 1'; - $expired_listings = $this->Conn->GetCol($sql); - if(is_array($expired_listings) && count($expired_listings) > 0) - { - $object =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true)); - foreach($expired_listings as $listing_id) - { - $object->Load($listing_id); - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - $object->SetDBField('Status', 2); - $object->Update(); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.EXPIRE', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.EXPIRE'); - } - } - - $sql = 'SELECT ls.ListingId, l.CreatedById FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' ls - LEFT JOIN '.$this->Application->getUnitOption('lst', 'TableName').' lst - ON ls.ListingTypeId = lst.ListingTypeId - LEFT JOIN '.$this->Application->getUnitOption('l', 'TableName').' l - ON ls.ItemResourceId = l.ResourceId - WHERE ls.Status = 1 - AND ls.ExpiresOn < '.adodb_mktime().' + lst.RenewalReminder * 3600 *24 - AND ls.RenewalReminderSent = 0'; - $res = $this->Conn->Query($sql); - if(is_array($res) && count($res) > 0) - { - $listing_ids = Array(); - foreach($res as $record) - { - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.RENEWAL.NOTICE', $record['CreatedById']); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.RENEWAL.NOTICE'); - $listing_ids[] = $record['ListingId']; - } - $sql = 'UPDATE '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - SET RenewalReminderSent = 1 - WHERE ListingId IN ('.implode(',', $listing_ids).')'; - $this->Conn->Query($sql); - } - } - - function OnMassDelete(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $ids = $this->StoreSelectedIDs($event); - - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') == 1) - { - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - } - } - parent::OnMassDelete($event); - } - - /** - * Moves enhancement from original link to it's pending copy, that is going to be approved - * - * @param kEvent $event - */ - function OnMoveEnhancement(&$event) - { - $id_field = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'IDField'); - $item_table_name = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'TableName'); - - $pending_id = $event->MasterEvent->getEventParam('id'); - $original_id = $event->MasterEvent->getEventParam('original_id'); - - $sql = 'SELECT ResourceId, '.$id_field.' - FROM '.$item_table_name.' - WHERE '.$id_field.' IN ('.$pending_id.','.$original_id.')'; - $resource_ids = $this->Conn->GetCol($sql, $id_field); - - $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); - $sql = 'UPDATE '.$table_name.' - SET ItemResourceId = '.$resource_ids[$pending_id].' - WHERE ItemResourceId = '.$resource_ids[$original_id]; - $this->Conn->Query($sql); - } -} - -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.62.2/in-link/units/links/links_config.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.62.2/in-link/units/links/links_config.php (revision 12746) +++ branches/unlabeled/unlabeled-1.62.2/in-link/units/links/links_config.php (revision 0) @@ -1,356 +0,0 @@ - 'l', - 'ItemClass' => Array('class'=>'kCatDBItem','file'=>'','build_event'=>'OnItemBuild'), - 'ListClass' => Array('class'=>'kCatDBList','file'=>'','build_event'=>'OnListBuild'), - 'EventHandlerClass' => Array('class' => 'LinksEventHandler', 'file' => 'links_event_handler.php', 'require_classes' => Array('kCatDBEventHandler'), 'build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'LinkTagProcessor','file'=>'link_tag_processor.php', 'require_classes' => Array('kCatDBTagProcessor'), 'build_event'=>'OnBuild'), - 'AutoLoad' => true, - 'Hooks' => Array(), - 'QueryString' => Array( - 1 => 'id', - 2 => 'Page', - 3 => 'Reviews_Page', // depricated (for old in-link) - 4 => 'event', - 5 => 'mode', - ), - 'CatalogItem' => true, - 'AdminTemplatePath' => 'links', - 'AdminTemplatePrefix' => 'links_', - 'IDField' => 'LinkId', - 'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events - - 'ItemType' => 4, - - 'StatisticsInfo' => Array( - 'pending' => Array( - 'icon' => 'icon16_link_pending.gif', - 'label' => 'la_Text_Links', - 'js_url' => '#url#', - 'url' => Array('t' => 'in-portal/advanced_view', 'SetTab' => 'l', 'pass' => 'm,l.showall', 'l.showall_event' => 'OnSetFilterPattern', 'l.showall_filters' => 'show_active=0,show_pending=1,show_disabled=0,show_new=1,show_hot=1,show_pop=1,show_pick=1'), - 'status' => STATUS_PENDING, - ), - ), - - 'TitlePhrase' => 'la_Text_Link', // phrase used to specify item type in relationship list - - 'ViewMenuPhrase' => 'la_title_Links', - 'UsePendingEditing' => true, // item editing is controlled by LINK.ADD/EDIT, LINK.ADD/EDIT.PENDING permissions - - 'CatalogSelectorName' => 'linklist', // used in old catalog section - - 'ItemPropertyMappings' => Array( - 'NewDays' => 'Link_NewDays', // number of days item to be NEW - 'MinPopVotes' => 'Link_MinPopVotes', // minimum number of votes for an item to be POP - 'MinPopRating' => 'Link_MinPopRating', // minimum rating for an item to be POP - 'MaxHotNumber' => 'Link_MaxHotNumber', // maximum number of HOT items - - 'HotLimit' => 'Link_HotLimit', // variable name in inp_Cache table - 'ClickField' => 'Hits', // item click count is stored here (in item table) - ), - - 'TitleField' => 'Name', - - 'TitlePresets' => Array( - 'default' => Array( 'new_status_labels' => Array('l'=>'!la_title_AddingLink!'), - 'edit_status_labels' => Array('l'=>'!la_title_EditingLink!'), - 'new_titlefield' => Array('l'=>'!la_title_NewLink!'), - ), - - 'links_edit' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_General!"), - - 'link_list'=>Array( 'prefixes' => Array('c_List', 'l_List'), - 'format' => "!la_title_Categories! (#c_recordcount#) - !la_title_Links! (#l_recordcount#)", - ), - 'link_edit'=>Array( 'prefixes' => Array('l'), - 'new_titlefield' => Array('l'=>'!la_title_NewLink!'), - 'format' => "#l_status# '#l_titlefield#' - !la_title_General!", - ), - - 'links_categories'=>Array('prefixes' => Array('l','l-ci_List'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Categories!"), - 'links_relations'=> Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Relations!"), - 'links_images' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Images!"), - 'links_reviews' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Reviews!"), - 'links_custom' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Custom!"), - - 'images_edit' => Array( 'prefixes' => Array('l', 'l-img'), - 'new_status_labels' => Array('l-img'=>'!la_title_Adding_Image!'), - 'edit_status_labels' => Array('l-img'=>'!la_title_Editing_Image!'), - 'new_titlefield' => Array('l-img'=>'!la_title_New_Image!'), - 'format' => "#l_status# '#l_titlefield#' - #l-img_status# '#l-img_titlefield#'", - ), - - 'reviews_edit' => Array( 'prefixes' => Array('l', 'l-rev'), - 'new_status_labels' => Array('l-rev'=>"!la_title_Adding_Review! '!la_title_New_Review!'"), - 'edit_status_labels' => Array('l-rev'=>'!la_title_Editing_Review!'), - 'format' => "#l_status# '#l_titlefield#' - #l-rev_status#", - ), - - 'relations_edit' => Array( 'prefixes' => Array('l', 'l-rel'), - 'new_status_labels' => Array('l-rel'=>"!la_title_Adding_Relationship! '!la_title_New_Relationship!'"), - 'edit_status_labels' => Array('l-rel'=>'!la_title_Editing_Relationship!'), - 'format' => "#l_status# '#l_titlefield#' - #l-rel_status#", - ), - - 'links_export' => Array('format' => '!la_title_LinksExport!'), - - 'links_import' => Array('format' => '!la_title_ImportLinks!'), - - 'duplicate_links' => Array('prefixes' => Array('l.duplicates_List'), 'format' => "!la_title_DuplicateLinks! (#l.duplicates_recordcount#)"), - - 'tree_in-link' => Array('format' => '!la_Text_Version! '.$this->Application->findModule('Name', 'In-Link', 'Version')), - ), - - 'PermItemPrefix' => 'LINK', - - 'PermTabText' => 'In-Link', - 'PermSection' => Array('main' => 'CATEGORY:in-link:links_list', 'search' => 'in-link:configuration_search', 'email' => 'in-link:configuration_email', 'custom' => 'in-link:configuration_custom'), - - 'Sections' => Array( - 'in-link' => Array( - 'parent' => 'in-portal:root', - 'icon' => 'settings_in-link', - 'label' => 'la_title_In-Link', - 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view'), - 'priority' => 3.1, - 'type' => stTREE, - ), - - 'in-link:inlink_general' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_general', - 'label' => 'la_tab_GeneralSettings', - 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 1, - 'type' => stTREE, - ), - - 'in-link:configuration_output' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_output', - 'label' => 'la_tab_ConfigOutput', - 'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 2, - 'type' => stTREE, - ), - - 'in-link:configuration_search' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_search', - 'label' => 'la_tab_ConfigSearch', - 'url' => Array('t' => 'config/config_search', 'module_key' => 'links', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 3, - 'type' => stTREE, - ), - - 'in-link:configuration_email' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_email', - 'label' => 'la_tab_ConfigE-mail', - 'url' => Array('t' => 'config/config_email', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 4, - 'type' => stTREE, - ), - - 'in-link:configuration_custom' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_custom', - 'label' => 'la_tab_ConfigCustom', - 'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 4, 'pass_section' => true, 'pass' => 'm,cf'), - 'permissions' => Array('view', 'add', 'edit', 'delete'), - 'priority' => 5, - 'type' => stTREE, - ), - - 'in-link:duplicate_checker' => Array( - 'parent' => 'in-link', - 'icon' => 'duplicate_checker', - 'label' => 'la_tab_DuplicateChecker', - 'url' => Array('t' => 'in-link/duplicate_checker', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit', 'delete'), - 'priority' => 6, - 'type' => stTREE, - ), - - 'in-link:validation_list' => Array( - 'parent' => 'in-link', - 'icon' => 'validate', - 'label' => 'la_tab_LinkValidation', - 'url' => Array('index_file' => '../in-link/admin/validation.php', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit'), - 'priority' => 7, - 'type' => stTREE, - ), - ), - - 'FilterMenu' => Array( - 'Groups' => Array( - Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_new'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_hot'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_pop'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_pick'), 'type' => WHERE_FILTER), - ), - 'Filters' => Array( - 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), - 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ), - 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), - 's1' => Array(), - 'show_new' => Array('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ), - 'show_hot' => Array('label' => 'la_Text_Hot', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ), - 'show_pop' => Array('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ), - 'show_pick' => Array('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '%1$s.`EditorsPick` != 1' ), - ) - ), - - 'TableName' => TABLE_PREFIX.'Link', - - 'CalculatedFields' => Array( - '' => Array ( - 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.CreatedById = -1, "root", IF (%1$s.CreatedById = -2, "Guest", "n/a")), u.Login)', - 'CategoryId' => TABLE_PREFIX.'%3$sCategoryItems.CategoryId', - 'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename', - 'CategoryFilename' => TABLE_PREFIX.'Category.NamedParentPath', - ), - ), - - 'CacheModRewrite' => true, - - 'AggregatedCalculatedFields' => Array( - - 'duplicates' => Array ( - 'DupeCount' => 'COUNT(*)', - ), - ), - - - 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId - LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'PermCache perm ON perm.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId - LEFT JOIN '.TABLE_PREFIX.'%3$sLinkCustomData cust ON %1$s.ResourceId = cust.ResourceId', - - ), // key - special, value - list select sql - - 'ListSortings' => Array( - '' => Array( - 'ForcedSorting' => Array('EditorsPick' => 'desc', 'Priority' => 'desc'), - 'Sorting' => Array('Name' => 'asc', 'Description' => 'desc'), - ) - ), - 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId - LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId - LEFT JOIN '.TABLE_PREFIX.'%3$sLinkCustomData cust ON %1$s.ResourceId = cust.ResourceId'), - - 'SubItems' => Array('l-rev', 'l-ci', 'l-rel', 'l-img', 'l-cdata'), - - 'Fields' => Array ( - 'LinkId' => Array(), - 'Name' => Array('type' => 'string', /*'formatter' => 'kMultiLanguage',*/ 'not_null' => 1, 'required' => 1, 'max_len' => 255), - 'AutomaticFilename' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1), - 'Description' => Array('type' => 'string', /*'formatter' => 'kMultiLanguage',*/ 'default' => ''), - 'Url' => Array('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''), - 'CreatedOn' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'default' => '#NOW#', 'not_null' => 1), - 'Modified' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'default' => '#NOW#', 'not_null' => 1), - 'Expire' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'not_null' => 1,'default' => ''), - 'Hits' => Array('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0), - 'CachedRating' => Array('type' => 'string', 'formatter' => 'kFormatter', 'default' => '0'), - 'CachedVotesQty' => Array('type' => 'int', 'formatter' => 'kFormatter', 'not_null' => 1, 'default' => 0), - 'CachedReviewsQty' => Array('type' => 'int', 'formatter' => 'kFormatter', 'default' => ''), - 'CreatedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => -1), - 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => -1), - 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => ''), - 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), - 'EditorsPick' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), - 'ResourceId' => Array('type' => 'int', 'default' => ''), - 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'OrgId' => Array('type' => 'int', 'default' => ''), - ), - - 'VirtualFields' => Array( - 'UserName' => Array('type' => 'string', 'default' => ''), - 'DupeCount' => Array('type' => 'string', 'default' => ''), - - // export related fields: begin - 'CategoryId' => Array('type' => 'int', 'default' => 0), - 'ExportFormat' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'CSV', /*2 => 'XML'*/), 'default' => 1), - 'ExportFilename' => Array('type' => 'string', 'default' => ''), - 'FieldsSeparatedBy' => Array('type' => 'string', 'default' => ','), - 'FieldsEnclosedBy' => Array('type' => 'string', 'default' => '"'), - 'LineEndings' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'Windows', 2 => 'UNIX'), 'default' => 1), - 'LineEndingsInside' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'CRLF', 2 => 'LF'), 'default' => 2), - 'IncludeFieldTitles' => Array('type' => 'int', 'default' => 1), - 'ExportColumns' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array()), - 'AvailableColumns' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array()), - 'CategoryFormat' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_MixedCategoryPath', 2 => 'la_SeparatedCategoryPath'), 'default' => 1), - 'CategorySeparator' => Array('type' => 'string', 'default' => ':'), - 'IsBaseCategory' => Array('type' => 'int', 'default' => 0), - // export related fields: end - - // import related fields: begin - 'FieldTitles' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Automatic', 2 => 'la_Manual'), 'default' => 1), - 'ImportSource' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Upload', 2 => 'la_Local'), 'default' => 2), - 'ImportFilename' => Array('type' => 'string', 'formatter' => 'kUploadFormatter', 'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => '/admin/export/'), - 'ImportLocalFilename' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'default' => ''), - 'CheckDuplicatesMethod' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_IDField', 2 => 'la_OtherFields'), 'default' => 1), - 'ReplaceDuplicates' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 0), - 'DuplicateCheckFields' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('Name' => 'NAME', 'Url' => 'URL'), 'default' => '|Name|Url|'), - 'SkipFirstRow' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'default' => 1), - // import related fields: end - - 'ThumbnailImage' => Array('type' => 'string', 'default' => ''), - 'FullImage' => Array('type' => 'string', 'default' => ''), - 'ImageAlt' => Array('type' => 'string', 'default' => ''), - - 'Filename' => Array('type' => 'string','not_null' => 1,'default' => ''), - 'CachedNavbar' => Array('type' => 'string', 'default' => ''), - ), - - 'Grids' => Array( - 'Default' => Array( - 'Icons' => Array(0 => 'icon16_link_disabled.gif', 1 => 'icon16_link.gif', 2 => 'icon16_link_pending.gif', -2 => 'icon16_link_pending.gif', 'HOT' => 'icon16_link_hot.gif', 'POP' => 'icon16_link_pop.gif', 'NEW' => 'icon16_link_new.gif', 'PICK' => 'icon16_link_pick.gif'), - 'Fields' => Array( - 'Name' => Array( 'title'=>'la_col_LinkName' , 'data_block' => 'grid_checkbox_td'), - 'Url' => Array( 'title'=>'la_col_LinkUrl' ), - 'Description' => Array( 'title'=>'la_col_Description' ), - 'Modified' => Array( 'title'=>'la_col_Modified' ), - ), - - ), - - - 'Duplicates' => Array( 'Icons' => Array('default' => 'icon16_link.gif'), - 'Fields' => Array( - 'Name' => Array( 'title'=>'la_col_LinkName' , 'data_block' => 'grid_checkbox_td'), - 'Url' => Array( 'title'=>'la_col_LinkUrl' ), - 'Description' => Array( 'title'=>'la_col_Description' ), - 'Modified' => Array( 'title'=>'la_col_Modified' ), - ), - - ), - ), - - - 'ConfigMapping' => Array( - 'PerPage' => 'Perpage_Links', - 'ShortListPerPage' => 'Perpage_Links_Short', - 'DefaultSorting1Field' => 'Link_SortField', - 'DefaultSorting2Field' => 'Link_SortField2', - 'DefaultSorting1Dir' => 'Link_SortOrder', - 'DefaultSorting2Dir' => 'Link_SortOrder2', - ), - ); -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.6.2/in-link/admin_templates/import.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.6.2/in-link/admin_templates/import.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.6.2/in-link/admin_templates/import.tpl (revision 0) @@ -1,226 +0,0 @@ - - - - - - - - - - - - - - - -
    - -
    - - - - - - - "> - - - - - - - - - - - - - "> - - - - - - - - - - - - - - - - "> - - - - - - - - - - - "> - - - - - -
    - - - - - - - - - - - - - -
    - " id="_1" checked value="1" /> - - - - " id="" onclick="check_radio('_1');"> -
    - " id="_2" checked value="2" /> - - - - -
    -
     
    - - - - - - - - - - - -
    - " id="btn_move_up" onclick="move_options_up('', 1)" class="button"> - " id="btn_move_down" onclick="move_options_down('', 1)" class="button">
    -
    -

    :
    - - " value="" /> - - ', '')" class="button">
    -
    - ', ''); select_sort('');" class="button"> -
    - -
    -
     
    - - " value="" /> - ', 'ImportCategory', null, 'OnSaveSettings');"> -  
    - - - - - - - - - - -
    - checked name="" id="_1" value="1" /> - - -
    - checked name="" id="_2" value="2" /> - - - - - -
    -
     
    - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.6.2/in-link/units/listing_types/listing_types_event_handler.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.6.2/in-link/units/listing_types/listing_types_event_handler.php (revision 12746) +++ branches/unlabeled/unlabeled-1.6.2/in-link/units/listing_types/listing_types_event_handler.php (revision 0) @@ -1,66 +0,0 @@ -getObject(); - - $items_info = $this->Application->GetVar('c'); - if (is_array($items_info)) { - $items_info = array_keys($items_info); - $cat_resource_id = array_shift($items_info); - $sql = 'SELECT CategoryId - FROM '.$this->Application->getUnitOption('c', 'TableName').' - WHERE ResourceId = '.$cat_resource_id; - $cat_id = $this->Conn->GetOne($sql); - } - else { - $cat_id = $this->Application->GetVar('m_cat_id'); - } - - $object->SetDBField($this->Application->RecallVar('dst_field'), $cat_id); - $this->RemoveRequiredFields($object); - $object->Update(); - - $this->finalizePopup($event); - } - - - function OnPreSaveListingType(&$event) - { - $event->redirect = false; - $object =& $event->getObject( Array('skip_autoload' => true) ); - $this->RemoveRequiredFields($object); - $event->CallSubEvent('OnPreSave'); - $this->Application->SetVar($event->getPrefixSpecial(true).'_id', $object->GetID()); - } - - function OnPreSave(&$event) - { - $object =& $event->getObject(); - $item_info = $this->Application->GetVar($event->Prefix); - if(is_array($item_info)) - { - $item_info = array_shift($item_info); - if( getArrayValue($item_info, 'EnableBuying') ) - { - $options = $object->GetFieldOptions('ShopCartName'); - $options['required'] = 1; - $object->SetFieldOptions('ShopCartName', $options); - } - } - parent::OnPreSave($event); - } - - function OnEdit(&$event) - { - if ($this->Application->prefixRegistred('p')) { - $this->Application->recallObject('p', null, Array('skip_autoload' => true)); - } - parent::OnEdit($event); - } -} - - -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.3.38/in-link/admin/include/toolbar/editlink_reviews.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.3.38/in-link/admin/include/toolbar/editlink_reviews.php (revision 12746) +++ branches/unlabeled/unlabeled-1.3.38/in-link/admin/include/toolbar/editlink_reviews.php (revision 0) @@ -1,224 +0,0 @@ -Get("LinkRev_View"); - -if(!is_numeric($RevView)) -{ - $RevView = $Rev_AllValue; -} -else -{ - $StatusList = array(); - - if($RevView & $Bit_Disabled) - $StatusList[] = 0; - - if($RevView & $Bit_Enabled) - $StatusList[] = 1; - - if($RevView & $Bit_Pending) - $StatusList[] = 2; - - if(count($StatusList)) - { - $status = " r.Status IN (".implode(",",$StatusList).") "; - } - else - $status = " r.Status = -1 "; - - $RevFilter = $status; -} - -$Perpage_Reviews = (int)$objConfig->Get("Perpage_Reviews"); -if(!$Perpage_Reviews) - $PerPage_Reviews = 20; - -$SortOrder = $objConfig->Get("LinkReview_LV_Sortorder"); -if(!strlen($SortOrder)) - $SortOrder = "desc"; - -$SortField = $objConfig->Get("LinkReview_LV_Sortfield"); -if(!strlen($SortField)) - $SortField = "DatePosted"; - -$lang_ReviewText = language("la_prompt_ReviewText"); -$lang_Reviewer = language("la_Prompt_ReviewedBy"); -$lang_Reviews = language("la_Text_Reviews"); - -print<< - - - -END; -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.16.2/in-link/admin/install/inportal_schema.sql =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.16.2/in-link/admin/install/inportal_schema.sql (revision 12746) +++ branches/unlabeled/unlabeled-1.16.2/in-link/admin/install/inportal_schema.sql (revision 0) @@ -1,100 +0,0 @@ -CREATE TABLE Link ( - LinkId int(11) NOT NULL auto_increment, - Name varchar(255) NOT NULL default '', - l1_Name varchar(255) NOT NULL default '', - l2_Name varchar(255) NOT NULL default '', - l3_Name varchar(255) NOT NULL default '', - l4_Name varchar(255) NOT NULL default '', - l5_Name varchar(255) NOT NULL default '', - Filename varchar(255) NOT NULL, - AutomaticFilename tinyint(3) unsigned NOT NULL default '0', - Description text, - Url varchar(255) NOT NULL default '', - CreatedOn double NOT NULL default '0', - Modified double NOT NULL default '0', - Expire double NOT NULL default '0', - Hits double(20, 6) NOT NULL default '0', - CachedRating varchar(10) default NULL, - CachedVotesQty int(11) NOT NULL default '0', - CachedReviewsQty int(11) default NULL, - CreatedById int(11) NOT NULL default '0', - ModifiedById int(11) NOT NULL default '0', - Priority int(11) NOT NULL default '0', - Status tinyint(4) default '0', - EditorsPick tinyint(4) default '0', - ResourceId int(11) default NULL, - HotItem tinyint(4) NOT NULL default '2', - PopItem tinyint(4) NOT NULL default '2', - NewItem tinyint(4) NOT NULL default '2', - OrgId int(11) default NULL, - PRIMARY KEY (LinkId), - UNIQUE KEY ResourceId (ResourceId), - KEY sorting (Priority,Name), - KEY Hits (Hits), - KEY Name (Name), - KEY EditorsPick (EditorsPick), - KEY CreatedOn (CreatedOn), - KEY Modified (Modified,CreatedOn), - KEY Status (Status), - KEY Filename (Filename(5)) -) -# -------------------------------------------------------- -CREATE TABLE LinkValidation ( - LinkValidationId int(11) NOT NULL auto_increment, - LinkId int(11) NOT NULL default '0', - ValidationTime double NOT NULL default '0', - ValidationCode varchar(50) default NULL, - ValidationStatus tinyint(4) NOT NULL default '0', - PRIMARY KEY (LinkValidationId), - UNIQUE KEY LinkId (LinkId) -) -# -------------------------------------------------------- -CREATE TABLE Listings ( - ListingId int(11) NOT NULL auto_increment, - ListingTypeId int(11) default '0', - ItemResourceId int(11) default NULL, - PurchasedOn int(11) default NULL, - ExpiresOn int(11) default NULL, - Status tinyint(4) default '0', - PendingRenewal tinyint(4) NOT NULL default '0', - RenewalReminderSent tinyint(4) NOT NULL default '0', - PRIMARY KEY (ListingId) -) -# -------------------------------------------------------- -CREATE TABLE ListingTypes ( - ListingTypeId int(11) NOT NULL auto_increment, - Name varchar(255) NOT NULL default '', - Description text NOT NULL, - Duration int(11) NOT NULL default '0', - DurationType int(11) NOT NULL default '0', - OnPurchaseEdPick tinyint(4) NOT NULL default '3', - OnPurchaseNew tinyint(4) NOT NULL default '3', - OnPurchasePop tinyint(4) NOT NULL default '3', - OnPurchaseHot tinyint(4) NOT NULL default '3', - OnPurchasePriorityAction tinyint(4) NOT NULL default '0', - OnPurchasePriorityValue tinyint(4) NOT NULL default '1', - OnPurchaseAddToCatEnabled tinyint(4) NOT NULL default '0', - OnPurchaseAddToCat int(11) NOT NULL default '0', - OnExpireEdPick tinyint(4) NOT NULL default '3', - OnExpireNew tinyint(4) NOT NULL default '3', - OnExpirePop tinyint(4) NOT NULL default '3', - OnExpireHot tinyint(4) NOT NULL default '3', - OnExpirePriorityAction tinyint(4) NOT NULL default '0', - OnExpirePriorityValue tinyint(4) NOT NULL default '1', - OnExpireRemoveFromCatEnabled tinyint(4) NOT NULL default '0', - OnExpireRemoveFromCat int(11) NOT NULL default '0', - RenewalReminder int(11) NOT NULL default '0', - EnableBuying tinyint(4) NOT NULL default '0', - ShopCartName varchar(255) default NULL, - Price double default NULL, - Recurring tinyint(4) NOT NULL default '0', - VirtualProductId int(11) NOT NULL default '0', - PRIMARY KEY (ListingTypeId) -) -# -------------------------------------------------------- -CREATE TABLE LinkCustomData ( - CustomDataId int(11) NOT NULL auto_increment, - ResourceId int(10) unsigned NOT NULL default '0', - PRIMARY KEY (CustomDataId) -) -# -------------------------------------------------------- \ No newline at end of file Index: branches/unlabeled/unlabeled-1.16.2/in-link/admin/include/toolbar/browse.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.16.2/in-link/admin/include/toolbar/browse.php (revision 12746) +++ branches/unlabeled/unlabeled-1.16.2/in-link/admin/include/toolbar/browse.php (revision 0) @@ -1,272 +0,0 @@ -recallObject('PermissionsHelper'); - - if ($perm_helper->TagPermissionCheck(Array('permissions' => 'LINK.VIEW'), 'in-link/admin/include/toolbar/browse.php')) { - $session =& $application->recallObject('Session'); - - $links_list =& $application->recallObject('l','l_List'); - $ItemTabs->AddTab(language("la_ItemTab_K4Links"), "k4links", $links_list->RecordsCount, 0, $links_list->NoFilterCount); - - $Links_Paste = $application->RecallVar('l_clipboard') ? 1 : 0; - // K4 VERSION: END - - print << - var Links_Paste = $Links_Paste; - - PasteButton = PasteButton || Links_Paste; - - AddButtonAction('new_link',"new_link('l')"); - - function new_link(prefix_special) - { - \$form_name = queryTabRegistry('prefix_special', prefix_special, 'tab_id') + '_form'; - set_hidden_field(prefix_special+'_mode', 't'); - opener_action('d'); - submit_event(prefix_special, 'OnPreCreate', queryTabRegistry('prefix_special', prefix_special, 'edit_template'), '../../admin/index.php') - } - -END1; - } - } - else - { - global $objConfig, $objSession, $objLinkList, $ItemTabs, $SearchType,$LinkSearch, $TotalItemCount; - global $Bit_All,$Bit_Pending,$Bit_Disabled,$Bit_New,$Bit_Pop,$Bit_Hot,$Bit_Ed,$DefaultTab, $debugger; - - $m_tab_Links_hide = 0; - if(strlen($DefaultTab)) - { - $m_tab_Links_hide = ($DefaultTab=="links") ? 0 : 1; - } - - - $LinkView = $objConfig->Get("Link_View"); - - $Links_AllValue = 127; - - if(!is_numeric($LinkView)) - { - $LinkView = 127; - } - - - // default 1st sorting - $Link_SortField = $objConfig->Get('Link_SortField'); // 'Priority'; - $Link_SortOrder = $objConfig->Get('Link_SortOrder'); // 'desc'; - - $Perpage_Links = (int)$objConfig->Get("Perpage_Links"); - if(!$Perpage_Links) - $Perpage_Links="'all'"; - - - if($LinkView == $Links_AllValue) - { - $Link_ShowAll = 1; - $LinkFilter = ""; - } - else - { - $Status = array(); - $Mod = array(); - if($LinkView & $Bit_Pending) - $Status[] = STATUS_PENDING; - - if($LinkView & $Bit_Active) - $Status[] = STATUS_ACTIVE; - - - if($LinkView & $Bit_Disabled) - $Status[] = STATUS_DISABLED; - - if(count($Status)) - { - $LinkFilter .= " AND (Status IN (".implode(",",$Status).") "; - } - else - $LinkFilter .= " AND ((Status=-1) "; - - if($LinkView & $Bit_Ed) - { - $LinkFilter .= " OR (EditorsPick=1) "; - } - - if($LinkView & $Bit_New) - { - $cutoff = adodb_date("U") - ($objConfig->Get("Link_NewDays") * 86400); - $LinkFilter .= " OR (CreatedOn > ".$cutoff.") "; - } - if($LinkView & $Bit_Pop) - { - $cutoff = $objLinkList->GetPopValue(); - if($cutoff>0) - $LinkFilter .= " OR (CachedRating >= ".$cutoff.") "; - } - - if($LinkView & $Bit_Hot) - { - $cutoff = $objLinkList->GetHotValue(); - if($cutoff>0) - $LinkFilter .= " OR (Hits >= ".$cutoff.") "; - } - - $LinkFilter .= ")"; - } - - $list = $objSession->GetVariable("SearchWord"); - $LinkSearch = (strlen($list)>0 && $SearchType =="Links" || $SearchType="all");// || (strlen($list)==0); - $objLinkList->Clear(); - $objLinkList->EnablePaging=TRUE; - - $LinkSearch = $LinkSearch && ($objSession->HasCatPermission("LINK.VIEW")); - $lt = $objLinkList->SourceTable; - $catjoin = GetTablePrefix()."CategoryItems"; - $cattable = $objCatList->SourceTable; - - $order = "EditorsPick DESC, Priority DESC"; - - $sql = "SELECT * FROM $lt "; - $sql .= "INNER JOIN $catjoin ON ($lt.ResourceId=$catjoin.ItemResourceId) "; - - if($LinkSearch) - { - $lado = &GetADODBConnection(); - $tsql = $sql." WHERE OrgId IS NOT NULL AND OrgId>0 AND CategoryId=".$objCatList->CurrentCategoryID(); - $rs = $lado->Execute($tsql); - $OrgIds = array(); - while($rs && !$rs->EOF) - { - $OrgIds[] = $rs->fields["OrgId"]; - $rs->MoveNext(); - } - if(count($OrgIds)>0) - { - $LinkFilter .= " AND (LinkId NOT IN (".implode(",",$OrgIds)."))"; - } - $order = $objLinkList->QueryOrderByClause(TRUE,TRUE,TRUE); - if(strlen($list)==0) - { - $where = "WHERE CategoryId=".$objCatList->CurrentCategoryID().$LinkFilter; - } - else - { - $SearchQuery = $objLinkList->AdminSearchWhereClause($list); - if(strlen($SearchQuery)) - { - $SearchQuery = " AND (".$SearchQuery.")"; - if(strlen($CatScopeClause)) - $SearchQuery .= " AND ".$CatScopeClause; - $where = $SearchQuery.$LinkFilter; - } - else - $where = "WHERE CategoryId=".$objCatList->CurrentCategoryID().$LinkFilter; - } - $sql .= $where." ".$order; - - $objLinkList->Query_Item($sql); - - $counting_clause = ' (CategoryId = '.$objCatList->CurrentCategoryID().') AND (OrgId IS NULL OR OrgId = 0) '; - - if (strlen($list) > 0) { - $objLinkList->QueryItemCount = TableCount($objLinkList->SourceTable, ' CategoryId = '.$objCatList->CurrentCategoryID().$where,TRUE); - } - else { - $objLinkList->QueryItemCount = TableCount($objLinkList->SourceTable,$counting_clause,TRUE); - } - $CatTotal = TableCount($objLinkList->SourceTable, $counting_clause, true); - - $ItemTabs->AddTab(language("la_ItemTab_Links"),"links",$objLinkList->QueryItemCount, $m_tab_Links_hide,$CatTotal); - } - - $caption = language("la_ItemTab_Links"); - - - $lang_URL = language("la_prompt_URL"); - $lang_Links = language("la_Text_Links"); - $lang_Reviews = language("la_Text_Reviews"); - - - $TotalItemCount += $objLinkList->QueryItemCount; - $Link_Paste = "false"; - if($objLinkList->ItemsOnClipboard()>0) - $Link_Paste = "true"; - -print << -var Link_SortField = '$Link_SortField'; -var Link_SortOrder = '$Link_SortOrder'; -var Links_Perpage = $Perpage_Links; -var LinkView = $LinkView; -var LinkTitle = '$caption'; -var lang_URL = "$lang_URL"; -var lang_Links = "$lang_Links"; -var lang_Reviews = "$lang_Reviews"; -var Links_Paste = $Link_Paste; - -PasteButton = PasteButton || Links_Paste; - -\$fw_menus['l_view_menu'] = function () -{ - // filtring menu - \$Menus['l_filtring_menu'] = new Menu('View'); - \$Menus['l_filtring_menu'].addMenuItem(lang_All,"config_val('Link_View', $Links_AllValue);",LinkView==$Links_AllValue); - \$Menus['l_filtring_menu'].addMenuItem(lang_None,"config_val('Link_View', 0);",LinkView==0); - \$Menus['l_filtring_menu'].addMenuSeparator(); - \$Menus['l_filtring_menu'].addMenuItem(lang_Active,"FlipBit('Link_View',LinkView,6);",BitStatus(LinkView,6)); - \$Menus['l_filtring_menu'].addMenuItem(lang_Pending,"FlipBit('Link_View',LinkView,5);", BitStatus(LinkView,5)); - \$Menus['l_filtring_menu'].addMenuItem(lang_Disabled,"FlipBit('Link_View',LinkView,4);",BitStatus(LinkView,4)); - \$Menus['l_filtring_menu'].addMenuSeparator(); - \$Menus['l_filtring_menu'].addMenuItem(lang_New,"FlipBit('Link_View',LinkView,3);",BitStatus(LinkView,3)); - \$Menus['l_filtring_menu'].addMenuItem(lang_Pop,"FlipBit('Link_View',LinkView,1);",BitStatus(LinkView,1)); - \$Menus['l_filtring_menu'].addMenuItem(lang_Hot,"FlipBit('Link_View',LinkView,2);",BitStatus(LinkView,2)); - \$Menus['l_filtring_menu'].addMenuItem(lang_EdPick,"FlipBit('Link_View',LinkView,0);",BitStatus(LinkView,0)); - - // sorting menu - \$Menus['l_sorting_menu'] = new Menu('Sort'); - \$Menus['l_sorting_menu'].addMenuItem(lang_Asc,"config_val('Link_SortOrder','asc');",RadioIsSelected(Link_SortOrder,'asc')); - \$Menus['l_sorting_menu'].addMenuItem(lang_Desc,"config_val('Link_SortOrder','desc');",RadioIsSelected(Link_SortOrder,'desc')); - \$Menus['l_sorting_menu'].addMenuSeparator(); - \$Menus['l_sorting_menu'].addMenuItem(lang_Default,"config_val('Link_SortField','Name');",""); - \$Menus['l_sorting_menu'].addMenuItem(lang_Name,"config_val('Link_SortField','Name');",RadioIsSelected(Link_SortField,'Name')); - \$Menus['l_sorting_menu'].addMenuItem(lang_URL,"config_val('Link_SortField','Url');",RadioIsSelected(Link_SortField,'Url')); - \$Menus['l_sorting_menu'].addMenuItem(lang_CreatedOn,"config_val('Link_SortField','CreatedOn');",RadioIsSelected(Link_SortField,'CreatedOn')); - \$Menus['l_sorting_menu'].addMenuItem(lang_Reviews,"config_val('Link_SortField','CachedReviewsQty');",RadioIsSelected(Link_SortField,'CachedReviewsQty')); - \$Menus['l_sorting_menu'].addMenuItem(lang_Rating,"config_val('Link_SortField','CachedRating');",RadioIsSelected(Link_SortField,'CachedRating')); - \$Menus['l_sorting_menu'].addMenuItem(lang_Votes,"config_val('Link_SortField','CachedVotesQty');",RadioIsSelected(Link_SortField,'CachedVotesQty')); - \$Menus['l_sorting_menu'].addMenuItem(lang_Hits,"config_val('Link_SortField','Hits');",RadioIsSelected(Link_SortField,'Hits')); - - // perpage menu - \$Menus['l_perpage_menu'] = new Menu(lang_PerPage); - \$Menus['l_perpage_menu'].addMenuItem("10","config_val('Perpage_Links', '10');",RadioIsSelected(Links_Perpage,10)); - \$Menus['l_perpage_menu'].addMenuItem("20","config_val('Perpage_Links', '20');",RadioIsSelected(Links_Perpage,20)); - \$Menus['l_perpage_menu'].addMenuItem("50","config_val('Perpage_Links', '50');",RadioIsSelected(Links_Perpage,50)); - \$Menus['l_perpage_menu'].addMenuItem("100","config_val('Perpage_Links', '100');",RadioIsSelected(Links_Perpage,100)); - \$Menus['l_perpage_menu'].addMenuItem("500","config_val('Perpage_Links', '500');",RadioIsSelected(Links_Perpage,500)); - - // select menu - \$Menus['l_select_menu'] = new Menu('Select'); - \$Menus['l_select_menu'].addMenuItem(lang_All,"javascript:selectAllC('"+activeTab.id+"');",""); - \$Menus['l_select_menu'].addMenuItem(lang_Unselect,"javascript:unselectAll('"+activeTab.id+"');",""); - \$Menus['l_select_menu'].addMenuItem(lang_Invert,"javascript:invert('"+activeTab.id+"');",""); - - // view menu - \$Menus['l_view_menu'] = new Menu(lang_Links); - \$Menus['l_view_menu'].addMenuItem( \$Menus['l_filtring_menu'] ); - \$Menus['l_view_menu'].addMenuItem( \$Menus['l_sorting_menu'] ); - \$Menus['l_view_menu'].addMenuItem( \$Menus['l_perpage_menu'] ); - \$Menus['l_view_menu'].addMenuItem( \$Menus['l_select_menu'] ); -} - - - -END; - - } - -?> Index: branches/unlabeled/unlabeled-1.16.2/in-link/units/links/link_tag_processor.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.16.2/in-link/units/links/link_tag_processor.php (revision 12746) +++ branches/unlabeled/unlabeled-1.16.2/in-link/units/links/link_tag_processor.php (revision 0) @@ -1,188 +0,0 @@ -Application->recallObject($this->Prefix, null, Array('skip_autoload' => true)); - $object->Load( $this->Application->GetVar($this->Prefix.'_id') ); - $sql = 'SELECT ListingTypeId FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$object->GetDBField('ResourceId'); - $listtype_id = $this->Conn->GetOne($sql); - $this->Application->SetVar('lst_id', $listtype_id); - return $listtype_id ? 1 : 0; - } - - function EnhancementIsPending($params) - { - $object =& $this->Application->recallObject($this->Prefix, null, Array('skip_autoload' => true)); - $object->Load( $this->Application->GetVar($this->Prefix.'_id') ); - $sql = 'SELECT Status FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$object->GetDBField('ResourceId'); - $status = $this->Conn->GetOne($sql); - return ($status == 2) ? 1 : 0; - } - - function ListingTypeField($params) - { - $object =& $this->Application->recallObject('l', null, Array('skip_autoload' => true)); - $object->Load( $this->Application->GetVar($this->getPrefixSpecial().'_id') ); - $sql = 'SELECT ListingTypeId FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$object->GetDBField('ResourceId'); - $lst_id = $this->Conn->GetOne($sql); - - $lst_object =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $lst_object->Load($lst_id); - return $lst_object->GetField($this->SelectParam($params, 'name,field')); - } - - function EnhancementField($params) - { - $object =& $this->Application->recallObject('l', null, Array('skip_autoload' => true)); - $object->Load( $this->Application->GetVar($this->getPrefixSpecial().'_id') ); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$object->GetDBField('ResourceId'); - $listing_id = $this->Conn->GetOne($sql); - - $listing_object =& $this->Application->recallObject('ls', null, Array('skip_autoload' => true)); - $listing_object->Load($listing_id); - return $listing_object->GetField($this->SelectParam($params, 'name,field')); - } - - function IsRenewalPeriod($params) - { - $object =& $this->Application->recallObject($this->getPrefixSpecial()); - $sql = 'SELECT ExpiresOn, ListingTypeId FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$object->GetDBField('ResourceId'); - $ls_info = $this->Conn->GetRow($sql); - $expiration = $ls_info['ExpiresOn']; - $lst_id = $ls_info['ListingTypeId']; - $sql = 'SELECT RenewalReminder FROM '.$this->Application->getUnitOption('lst', 'TableName').' - WHERE ListingTypeId = '.$lst_id; - $renewal_interval = $this->Conn->GetOne($sql) * 3600 * 24; - return ($expiration - adodb_mktime() < $renewal_interval) ? 1 : 0; - } - - function FirstListingType($params) - { - static $first = true; - if($first) - { - $first = false; - return true; - } - else - { - return false; - } - } - - function IsReocurringEnhancement($params) - { - $params['name'] = 'Recurring'; - return $this->ListingTypeField($params); - } - - function EnhanceUsingInCommerce($params) - { - if (!$this->Application->isModuleEnabled('In-Commerce')) { - return 0; - } - - $object =& $this->Application->recallObject($this->Prefix, null, Array('skip_autoload' => true)); - $object->Load( $this->Application->GetVar($this->Prefix.'_id') ); - $sql = 'SELECT ListingTypeId FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$object->GetDBField('ResourceId'); - $listtype_id = $this->Conn->GetOne($sql); - - $lst_object =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $lst_object->Load($listtype_id); - - return $lst_object->GetDBField('EnableBuying'); - } - - function ClickLink($params) - { - $object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params ); - return $this->Application->HREF( $params['t'], '', Array('l_id' => $object->GetID(), 'pass'=>'all,l' ) ); - } - - function ListRelatedLinks($params) - { - return $this->PrintList2($params); - } - - function LinkLink($params) - { - return $this->ItemLink($params, 'link'); - } - - function ListingDescription($params) - { - $listing =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing->Load( $this->Application->GetVar('listing_type') ); - - return $listing->GetDBField('Description'); - } - - function ListingTypeDetailsLink($params) - { - $listing =& $this->Application->recallObject('lst'); - $params['listing_type'] = $listing->GetID(); - - $main_processor =& $this->Application->recallObject('m_TagProcessor'); - return $main_processor->Link($params); - } - - function GroupTitle($params) - { - $object =& $this->getObject($params); - - $grouping = $this->Application->RecallVar($this->getPrefixSpecial().'_dupe_fields'); - $grouping = explode('|', substr($grouping, 1, -1)); - - $ret = ''; - foreach ($grouping as $group_field) { - $ret .= $object->GetField($group_field).', '; - } - return preg_replace('/(.*), $/', '\\1', $ret); - } - - /** - * Go to link url - * - * @param Array $params - */ - function FollowLocation($params) - { - $id = $this->Application->GetVar($this->getPrefixSpecial().'_id'); - - if (!$id) { - trigger_error('No Link ID for redirect', E_USER_ERROR); - } - - $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); - $table_name = $this->Application->getUnitOption($this->Prefix, 'TableName'); - - $sql = 'UPDATE '.$table_name.' - SET Hits = Hits + 1 - WHERE '.$id_field.' = '.$id; - $this->Conn->Query($sql); - - $sql = 'SELECT '.$params['field'].' - FROM '.$table_name.' - WHERE '.$id_field.' = '.$id; - $url = $this->Conn->GetOne($sql); - - if (preg_match('/^(http|ftp|mailto:)(.*)/U', $url)) { - header('Location: '.$url); - } - else { - header('Location: http://'.$url); - } - - exit; - } -} - -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/module_help/relations_edit.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/module_help/relations_edit.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/module_help/relations_edit.txt (revision 0) @@ -1,8 +0,0 @@ -This tab contains a list of all relations of this link. To create a new relation, click the �New' button (two opposite green arrows with a little sun). This will pop up an item picker, where you can choose one category or item of any module that supports relations. -
      -
    • Relation ID � this is a read-only field, the internal system ID of the relation, guaranteed to be unique throughout the system. It is blank when a new relation is created. -
    • Item � this is a read-only field, displaying the name of the item that you are creating a relation to, and its type. In the current version, links can be related to categories, articles (if In-newz is installed) and topics (if In-bulletin is installed). -
    • Type � this field designated the type of the relation. A �reciprocal' type denotes a two-way relation, and �one way' � a one directional relation, from the link to the item. -
    • Enabled � this field is the status flag of the relation. -
    • Priority � this field is the numerical priority of the relation. -
    \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/module_help/config_list_general.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/module_help/config_list_general.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/module_help/config_list_general.txt (revision 0) @@ -1,3 +0,0 @@ -This section contains general In-link settings, which are not related to links. In the current version, it has only one setting. �Select Module Root Category' allows the administrator to specify the module root category of In-link. Clicking on the folder shortcut button will pop up a category picker. -The module root category is used in several ways. On the front-end, in the Default theme, the top menu links each module to its module root category. Therefore, the �Directory' menu item will open this category and its contents. In the Administrative Console, this setting provides a faster way to navigate in the module, as it presets the category for module-specific actions. -Logically, the module root category defines the portion of the catalog tree that is designated only for the In-link categories. If you are using the categories to store items from multiple modules, this setting is not applicable to your situation. \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/module_help/images_edit.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/module_help/images_edit.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/module_help/images_edit.txt (revision 0) @@ -1,14 +0,0 @@ -This tab contains all images associated with the link. To create a new image, click on the �New' button (the icon like the Windows GIF icon with a little sun). This will open a new page where you specify the image details. -
      -
    • Image ID � a read-only field, the internal system ID of the image, guaranteed to be unique throughout the system. It is blank when a new image is created. -
    • Name � this field contains the image name, used on the front-end, in side the In-tags to refer to this image. -
    • Alt Value � this field contains the text value, which will be displayed in the �alt' tag of the image on the front end, in side the page HTML code, and when a mouse pointer hovers over the image (in Internet Explorer). -
    • Status � this field contains the status of the image, enabled or disabled. -
    • Primary � this flag designates the primary image. There can be only one primary image per list (for one link). When you check this box on an image, the previous primary image is unset (if there is more than one image in the list). -
    • Priority � this field contains the numerical priority of the image. -
    • Thumbnail location (upload from PC) � Using this control, you can upload an image from the workstation you are at to the In-portal server. The image will be stored in the �in-portal/kernel/images' directory. -
    • Thumbnail location (remote URL) � Here you can enter a remote URL address of an image. It will be linked from the remote server. -
    • Same As Thumbnail � This check box sets the full-size image to be the same as the thumbnail image. When this option is checked, you cannot upload a full-size image. -
    • Thumbnail location (upload from PC) - Using this control, you can upload an image from the workstation you are at to the In-portal server. The image will be stored in the �in-portal/kernel/images' directory. -
    • Thumbnail location (remote URL) - Here you can enter a remote URL address of an image. It will be linked to from the remote server. -
    \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/module_help/links_categories.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/module_help/links_categories.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/module_help/links_categories.txt (revision 0) @@ -1,2 +0,0 @@ -This tab manages the categories of the link. The list shows all categories to which this link belongs. The administrator can add and remove additional categories on this list. At least one category must be there, and exactly one category must be designated as the primary. The primary category determines the permissions for the link. To designate the primary category of the link, select the category and click on the Primary Category icon in the toolbar. The �primary' marker will move from the previous Primary Category to the one you have selected.

    -

    The link will appear in all of the categories it belongs to, in the Administrative Console as well as on the front-end. \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/module_help/links_edit.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/module_help/links_edit.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/module_help/links_edit.txt (revision 0) @@ -1,22 +0,0 @@ -This tab contains the main attributes of the link. -

      -
    • Enable HTML? - this check box enables or disables HTML code in the link name and description. When checked, it will render the HTML (for example, a <B> tag will actually make the text bold). When unchecked, it will display the HTML as regular text (the <B> tag will appear exactly as �<B>'). This is a very important setting, since some HTML tags can break the page layout, and in some instances can be a security concern (the Java Script, for example). -
    • Link Id � this read-only field displays the unique internal system ID of the link. -
    • Name * - this field contains the link name. -
    • Description � this field contains the link description. The shortcut to the HTML editor next to this field will open a pop-up with an online HTML editor -
    • URL * - this field contains the link URL. The URL can contain the protocol prefix (http://), but it does not have to. -
    • Link Owner * - this field contains the name of the user who is owns this link. A link owner, given proper permissions, may modify the link on the front-end. By default, the link owner is the link creator. The administrator may change the link owner, by entering a different user name in this field, or by selecting it through a user pop up (shortcut to a user icon). -
    • Automatic Filename � specifies whether the Filename used for mod_rewrite should be generated automatically from the link name, or entered manually. If checked, the Filename will be generated from the link name, replacing all special characters ( !@#$%^&*()+|\=-~`{}][:��;,./?>< ) by the underscore character (�_�), and all multiple underscores with a single underscore. If the resulting name ends with an underscore followed by number, an additional letter will be appended, since the names ending with a number are reserved for system use. The resulting name will also be checked for uniqueness, and if it�s not unique, additional letters will be appended to the end of the name -
    • Custom Filename � the filename used for the URL generation when using mod_rewrite. The field is disabled if Automatic Filename is On. If Automatic Filename is Off, the administrator may enter the filename manually, however it will still be checked for uniqueness, special characters and whether it ends with a number. In such cases the Filename will be automatically corrected before saving. -
    • Status � this field contains the link status. -
    • New � this field controls how the link �new' status is calculated by In-link. -
    • Hot � this field controls how the link �hot� status is calculated by In-link. In automatic mode, In-link will consider as �hot� the X number of links with the most hits. X is defined under the In-link Output options. -
    • Popularity � this field controls how the link �pop� status is calculated by In-link. In automatic mode, In-link will consider those links as �popular�, which have at least X number of votes and have a rating above the predefined threshold. The number of votes and rating threshold are defined in the Output options section. -
    • Editor's Pick � this flags sets the Editor's Pick attribute of the link. -
    • Priority - this field contains the numeric link priority. -
    • Created on * - this field contains the creation date of the link. It is automatically set by the system when the link is created, however it can be changed by the administrator. The date can be entered directly into the field, or by using the visual calendar tool. -
    • Expiration Date - this field contains the expiration date of the link. It is automatically set by the system when a link is created, using the creation date plus the predefined number of days, set in the In-link configuration. It can be changed by the administrator, by being entered directly into the field, or by using the visual calendar tool. -
    • Rating � this field contains the numeric rating of the link. The rating is calculated as the average value of all ratings selected by users for this link. The range of the value is predefined, and displayed to the right as a hint. The administrator can manually change the rating if necessary. -
    • Votes � this field contains the number of votes for the link. Each time a user votes (selects rating) for the link on the front-end, this value is incremented by one. This value is important for the rating calculating, it is used in the formula to calculate the average. The administrator can manually change the number of votes if necessary. -
    • Hits � this field contains the number of link's hits. This value is incremented each time a user clicks on the link to go to the link's URL. The administrator can manually change the hits if necessary. -
    \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/module_help/custom_fields_list.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/module_help/custom_fields_list.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/module_help/custom_fields_list.txt (revision 0) @@ -1,11 +0,0 @@ -This section allows the administrator to manage the link custom fields. The link custom fields are useful when you need to store additional information about the links. For example, the links may have such custom fields, as the language of the destination site, the safe audience rating, the load times, etc. All custom fields will be automatically used in the Administrative Console, in the Link Management section. You will need to edit the theme templates for them to appear on the front-end. -
      -
    • Field Id � this is a read-only field displaying the unique system ID of the custom field. -
    • Field Name � sets the internal name of the custom field. This is the name you would use to refer to the custom field in the In-tags when designing templates. -
    • Field Label � this is a read-only field, which displays the language variable name associated with the label of that field, and the value of the variable in the current language (after the colon). The label is used on the front end, and in the Administrative Console, to describe the field to the user who is entering information into it. -
    • Show on the general tab � this setting controls whether the custom field will be also displayed on the General tab in the Administrative Console, when editing the links. It is a short cut for frequently used custom fields. All settings below apply only when this is checked. -
    • Heading � this field contains the language variable of the section heading, under which the field appear on the general tab. -
    • Field Prompt � this field contains the language variable, which text will appear as the hint bind the field. -
    • Input Type � this drop down allows the administrator to designate the type of the information stored in the custom field, by specifying the HTML control to be used on the General form. -
    • List of Values � this field contains all choices for the above HTML controls of type �radio button' or �drop down'. The choices must be in the format: �value1 = language variabe1, value2=language variable2�. For example, to create a drop down with three choices (One, Two, Three) and their respective numerical values, this field would contain the following: �1=la_one,2=la_two,3=la_three). -
    \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/module_help/config_list_output.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/module_help/config_list_output.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/module_help/config_list_output.txt (revision 0) @@ -1,20 +0,0 @@ -This section allows the administrator to specify the default values for various link settings in In-link. -
      -
    • Order links by � this setting specifies the default primary sort order for the link listings. It applies both on the front-end, and in the Administrative Console � in the catalog. The first dropdown allows to select the field (an attribute of the link), and the second dropdown � the direction of the sort. -
    • And then by � this setting specifies the default secondary sort order. It is set in the same way as the primary, and used when the primary order values are ambiguous. For example, when the primary sort value is �Link Name', the secondary order will be used to sort among links with the same name. -
    • Number of links per page � specifies the default number of links shown per page. This value applies both to the front-end and to the Administrative Console. In the latter, this value can be changed for each session through the View menu. -
    • Number of links per page on a short listing � this setting is similar to the � Number of links per page', but it applies to the front-end short link lists only. It can be overridden by setting the tag attributes in the appropriate templates. -
    • Number of days for a link to be NEW � this setting specifies the number of days, from the date of creation, during which the link will be automatically marked �New' by the system. This setting will only apply to the links with the �New' flag set to �Automatic'. -
    • Minimum rating for a link to be POP � this setting specifies the minimum rating of the link for it to be automatically marked �Popular� by the system. This setting will only apply to the links with the �Popularity� flag set to �Automatic�. Note, that for a link to be �popular� it will need to meet the �minimum votes� requirement set below. -
    • Maximum number of HOT links � this setting specifies the maximum number �hot� links in the database. A �hot� link is the one that has more hits than the other links. For example, if this option is set to �2�, the In-portal system will pick the two links with the most hits and mark them as hot. (Of course, this will change real-time as links� hits are updated, or as this setting changes). Please note, if more than one link has the maximum number of hits, the system will still enforce the maximum number requirement; therefore, there may be situations when a link with the most hits is not marked as �hot�. -
    • Minimum number of votes to enable link rating � this setting specifies the minimum number of votes required for the link rating to be effective. Usually, when only a small number of users have voted on a link, its rating will not be statistically accurate - it is likely, that only biased users have voted. When a larger number of users vote, the rating becomes more accurate. This setting affects the �popularity� property of a link � links with less than required number of votes will not be considered �popular�, even if their rating is high enough. -
    • Enhanced Listings � this setting will enable the Enhanced listings functionality on the front end. Specifically, the �Enhance� option will appear on link listings under My Links section on the front end. To use the enhanced listing functionally, the site administrator needs to create at least one Listing Type under In-Link->Paid Listings section. -
    • Allow Free Listings � controls if free (regular) listings should be allowed; effective only when the enhanced (paid) listings are on.
    • -
    • Display editor PICKs above regular links � this setting will force all links, marked as �Editor's pick' to be displayed above the other links, regardless of their priority or sort order. Among themselves, �Editor's pick' links will be sorted according to the regular rules. -
    • Display link URL in status bar � this setting toggles the display of the URL in the browsers status bar (usually at the bottom of the window). It is impossible to view the URL of the link by examining the link itself, because In-link uses an intermediate script to redirect visitors to the link destinations. If it is desirable that the visitors can see the destination of the link, enable this setting. -
    • Allow Duplicate Reviews � this setting specifies the period during which the same user cannot submit another review on the same link. The time can be entered in seconds, minutes, hours, days, months or years. If it is set to zero, the users can submit reviews without this limitation. Please note, that regardless of this setting, the same user will be able to submit a review on another link immediately after the first review. -
    • Allow Duplicate Rating Votes - this setting specifies the period during which the same user cannot rate the same link again. The time can be entered in seconds, minutes, hours, days, months or years. If it is set to zero, the users can rate links without this limitation. Please note, that regardless of this setting, the same user will be able to rate another link immediately after the first rating. -
    • Reviews Per Page - specifies the default number of reviews shown per page. This value applies both to the front-end and to the Administrative Console. -
    • Sort reviews by - this setting specifies the default primary sort order for the review listings. It applies both on the front-end, and in the Administrative Console � in the link management section, Reviews tab. The first dropdown allows to select the field (an attribute of the review), and the second dropdown � the direction of the sort. -
    • and then by - this setting specifies the default secondary sort order. It is set in the same way as the primary, and used when the primary order values are ambiguous. For example, when the primary sort value is �Review Text', the secondary order will be used to sort among reviews with the same body. -
    \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/module_help/links_custom.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/module_help/links_custom.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/module_help/links_custom.txt (revision 0) @@ -1 +0,0 @@ -This tab displays all custom fields configured in In-link, and allows the administrator to edit their information for this link. \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/module_help/email_settings_list.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/module_help/email_settings_list.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/module_help/email_settings_list.txt (revision 0) @@ -1 +0,0 @@ -This section lists all possible In-link events. Each event has a description, a type � �User' or �Admin', a status � �Enabled', �Front-end Only', and a �From/To User'. The description hints about when the event occurs. The type indicates whether the email notification will be sent to the front-end user, or the administrator. The status �Enabled' signifies that the email notifications for this event are enabled for both the front-end and the Administrative Console. The Front-end Only' status means that the notifications will be sent only when the event occurs on the front end. The �Disabled' status means no notifications will be sent when this event occurs. The �From/To User' field specifies the �From' email for front-end user notifications, and the �To' email for the administrative notifications. The other, matching pair of addresses (�To' for the front, and �From' for the admin) is automatically determined by the system based on who initiated the event. The event notification status can be changed by clicking on the toolbar buttons � �Enable' to enable the notification, �Disable' to disable it, and �Front Only' (icon with a monitor) to set to �Front-end Only' status. Index: branches/unlabeled/unlabeled-1.1.2/in-link/module_help/reviews_edit.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/module_help/reviews_edit.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/module_help/reviews_edit.txt (revision 0) @@ -1,12 +0,0 @@ -This tab lists all reviews of the link, and allows the administrator to manage them. Reviews are little text articles that are attached to the link. They can be used to collect feedback from the front-end users, to provide details of the ratings, and for many other purposes. -Reviews have their own status, independent from the link. They can be active, pending or disabled. The idea is very similar to the link status � only active reviews are displayed on the link detail page, or wherever specified in the theme design. The category permissions specify the status of a new review created on the front-end. -
      -
    • Enable HTML? � this check box enables or disables HTML code in the review body. When checked, it will render the HTML (for example, a <B> tag will actually make the text bold). When unchecked, it will display the HTML as regular text (the <B> tag will appear exactly as �<B>'). This is a very important setting, since some HTML tags can break the page layout, and in some instances can be a security concern (the Java Script, for example). -
    • Review ID - this field is a read-only unique system ID of the review. -
    • Created by* - this field contains the name of the user who submitted the review. This information will be displayed, along with the text of the review and the date, on the front-end, unless specified otherwise in the active theme. The administrator may change the review author by entering a different user name in this field, or by selecting it through a user picker (shortcut to a user icon will pop up the picker in a new window). -
    • Review Text* - this field contains the main body of the review. To use the online HTML editor, click on the �Editor' button next to this field. -
    • Status - this is the status field of the review. -
    • Priority � this field contains the numerical priority of the review. -
    • Created on � this field contains the creation date of the review. It is automatically set by the system when the review is submitted, however it can be changed by the administrator. The date can be entered directly into the field, or by using the visual calendar tool. -
    • Created at - this field contains the creation time of the review. It is automatically set by the system when the review is submitted, however it can be changed by the administrator. The date can be entered directly into the field, or by using the visual calendar tool. -
    \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/module_help/links_images.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/module_help/links_images.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/module_help/links_images.txt (revision 0) @@ -1,14 +0,0 @@ -This tab contains all images associated with the link. To create a new image, click on the �New' button (the icon like the Windows GIF icon with a little sun). This will open a new page where you specify the image details. -
      -
    • Image ID � a read-only field, the internal system ID of the image, guaranteed to be unique throughout the system. It is blank when a new image is created. -
    • Name � this field contains the image name, used on the front-end, in side the In-tags to refer to this image. -
    • Alt Value � this field contains the text value, which will be displayed in the �alt' tag of the image on the front end, in side the page HTML code, and when a mouse pointer hovers over the image (in Internet Explorer). -
    • Status � this field contains the status of the image, enabled or disabled. -
    • Primary � this flag designates the primary image. There can be only one primary image per list (for one link). When you check this box on an image, the previous primary image is unset (if there is more than one image in the list). -
    • Priority � this field contains the numerical priority of the image. -
    • Thumbnail location (upload from PC) � Using this control, you can upload an image from the workstation you are at to the In-portal server. The image will be stored in the �in-portal/kernel/images' directory. -
    • Thumbnail location (remote URL) � Here you can enter a remote URL address of an image. It will be linked from the remote server. -
    • Same As Thumbnail � This check box sets the full-size image to be the same as the thumbnail image. When this option is checked, you cannot upload a full-size image. -
    • Thumbnail location (upload from PC) - Using this control, you can upload an image from the workstation you are at to the In-portal server. The image will be stored in the �in-portal/kernel/images' directory. -
    • Thumbnail location (remote URL) - Here you can enter a remote URL address of an image. It will be linked to from the remote server. -
    \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/module_help/links_relations.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/module_help/links_relations.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/module_help/links_relations.txt (revision 0) @@ -1,8 +0,0 @@ -This tab contains a list of all relations of this link. To create a new relation, click the �New' button (two opposite green arrows with a little sun). This will pop up an item picker, where you can choose one category or item of any module that supports relations. -
      -
    • Relation ID � this is a read-only field, the internal system ID of the relation, guaranteed to be unique throughout the system. It is blank when a new relation is created. -
    • Item � this is a read-only field, displaying the name of the item that you are creating a relation to, and its type. In the current version, links can be related to categories, articles (if In-newz is installed) and topics (if In-bulletin is installed). -
    • Type � this field designated the type of the relation. A �reciprocal' type denotes a two-way relation, and �one way' � a one directional relation, from the link to the item. -
    • Enabled � this field is the status flag of the relation. -
    • Priority � this field is the numerical priority of the relation. -
    \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/module_help/duplicate_links.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/module_help/duplicate_links.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/module_help/duplicate_links.txt (revision 0) @@ -1,16 +0,0 @@ -This section allows the administrator to identify and manage duplicate links in the directory. By default, the section lists all duplicate links found in the system, identifying the duplicates by matching the URL field of the links.
    -The field or fields used to locate the duplicates are controlled through View menu of the section, Group By sub-menu. Currently it provides the options to search for duplicates by link Name, URL or Name and URL pair.
    -If duplicate links are found, they are displayed in the grid below the toolbar grouped by the selected field(s). The duplicate grid has the following fields:
    -
      -
    • Link – displays the link Name field
    • -
    • Link URL – displays the link URL field
    • -
    • Description – displays the description associated with the link
    • -
    • Modified – displays link’s last modification date and time
    • -
    -The section toolbar has the following buttons:
    -
      -
    • Edit – opens link editing form for all of the selected links.
    • -
    • Delete – deletes selected links from the database
    • -
    • Merge – merges the group of duplicates. Only one target link in duplicates group should be selected for merging. All non-selected links will be merged into selected one. The merge functions adds the target link to the categories of all non-selected links in the group and deletes non-selected links, resulting a single link in all of the categories instead of the duplicates. Please note that you will not see the link in the duplicates listing after merging, since it will not have duplicates any more.
    • -
    • View – opens the view menu for the grid. Please see section 5.1.6 for more information on using the view menu.
    • -
    \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/module_help/links_reviews.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/module_help/links_reviews.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/module_help/links_reviews.txt (revision 0) @@ -1,12 +0,0 @@ -This tab lists all reviews of the link, and allows the administrator to manage them. Reviews are little text articles that are attached to the link. They can be used to collect feedback from the front-end users, to provide details of the ratings, and for many other purposes. -Reviews have their own status, independent from the link. They can be active, pending or disabled. The idea is very similar to the link status � only active reviews are displayed on the link detail page, or wherever specified in the theme design. The category permissions specify the status of a new review created on the front-end. -
      -
    • Enable HTML? � this check box enables or disables HTML code in the review body. When checked, it will render the HTML (for example, a <B> tag will actually make the text bold). When unchecked, it will display the HTML as regular text (the <B> tag will appear exactly as �<B>'). This is a very important setting, since some HTML tags can break the page layout, and in some instances can be a security concern (the Java Script, for example). -
    • Review ID - this field is a read-only unique system ID of the review. -
    • Created by* - this field contains the name of the user who submitted the review. This information will be displayed, along with the text of the review and the date, on the front-end, unless specified otherwise in the active theme. The administrator may change the review author by entering a different user name in this field, or by selecting it through a user picker (shortcut to a user icon will pop up the picker in a new window). -
    • Review Text* - this field contains the main body of the review. To use the online HTML editor, click on the �Editor' button next to this field. -
    • Status - this is the status field of the review. -
    • Priority � this field contains the numerical priority of the review. -
    • Created on � this field contains the creation date of the review. It is automatically set by the system when the review is submitted, however it can be changed by the administrator. The date can be entered directly into the field, or by using the visual calendar tool. -
    • Created at - this field contains the creation time of the review. It is automatically set by the system when the review is submitted, however it can be changed by the administrator. The date can be entered directly into the field, or by using the visual calendar tool. -
    \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/inportal_upgrade_v4.1.0.sql =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/inportal_upgrade_v4.1.0.sql (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/inportal_upgrade_v4.1.0.sql (revision 0) @@ -1,6 +0,0 @@ -ALTER TABLE Link CHANGE AutomaticFilename AutomaticFilename TINYINT(3) UNSIGNED NOT NULL DEFAULT '1', CHANGE CreatedById CreatedById INT(11) NOT NULL DEFAULT '-1', CHANGE ModifiedById ModifiedById INT(11) NOT NULL DEFAULT '-1', CHANGE CachedRating CachedRating VARCHAR(10) NOT NULL DEFAULT '0', CHANGE CreatedOn CreatedOn INT UNSIGNED NULL DEFAULT NULL, CHANGE Modified Modified INT UNSIGNED NULL DEFAULT NULL, CHANGE Expire Expire INT UNSIGNED NULL DEFAULT NULL; -ALTER TABLE Link DROP Filename; - -ALTER TABLE Listings CHANGE `Status` `Status` TINYINT(4) UNSIGNED NOT NULL DEFAULT '2'; - -UPDATE Modules SET Version = '4.1.0' WHERE Name = 'In-Link'; \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_4_1_0.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_4_1_0.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_4_1_0.txt (revision 0) @@ -1,21 +0,0 @@ -File in-link/in-link/link.php changed -File in-link/in-link/parser.php changed -File in-link/in-link/admin/import/status.php changed -File in-link/in-link/admin/install/inportal_data.sql changed -File in-link/in-link/admin/install/inportal_schema.sql changed -File in-link/in-link/admin/install/upgrades/changelog_4_0_1.txt changed -File in-link/in-link/admin/install/upgrades/changelog_4_1_0.txt is new; release_4_1_0 revision 1.1.2.6 -File in-link/in-link/admin/install/upgrades/inportal_upgrade_v4.1.0.sql is new; release_4_1_0 revision 1.1.2.1 -File in-link/in-link/admin/install/upgrades/readme_4_1_0.txt is new; release_4_1_0 revision 1.1.2.1 -File in-link/in-link/admin_templates/duplicate_checker.tpl changed -File in-link/in-link/admin_templates/export.tpl changed -File in-link/in-link/admin_templates/export_finish.tpl changed -File in-link/in-link/admin_templates/import.tpl changed -File in-link/in-link/admin_templates/links/links_edit.tpl changed -File in-link/in-link/admin_templates/paid_listings/paid_listing_edit.tpl changed -File in-link/in-link/admin_templates/paid_listings/paid_listing_type_edit.tpl changed -File in-link/in-link/units/links/links_config.php changed -File in-link/in-link/units/listing_types/listing_types_config.php changed -File in-link/in-link/units/listings/listings_config.php changed -File in-link/in-link/units/listings/listings_event_handler.php changed -File in-link/themes/default/inlink/suggest_link/suggest_link_form.tpl changed Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_2_2.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_2_2.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_2_2.txt (revision 0) @@ -1,4 +0,0 @@ -Readme notes for In-link 3.2.2 -Intechnic Corporation, Sep 26, 2006 - -This release is a maintenance release to support the newly released In-edit module. \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/inportal_upgrade_v3.3.0.sql =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/inportal_upgrade_v3.3.0.sql (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/inportal_upgrade_v3.3.0.sql (revision 0) @@ -1,3 +0,0 @@ -UPDATE ItemReview SET Module = 'In-Link' WHERE ItemId IN (SELECT ResourceId FROM Link) - -UPDATE Modules SET Version = '3.3.0' WHERE Name = 'In-Link'; \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_3_2_0.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_3_2_0.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_3_2_0.txt (revision 0) @@ -1,85 +0,0 @@ -File in-link/in-link/action.php changed -File in-link/in-link/frontaction.php changed -File in-link/in-link/link.php changed -File in-link/in-link/admin/addimage.php changed -File in-link/in-link/admin/addlink.php changed -File in-link/in-link/admin/addreview.php changed -File in-link/in-link/admin/advanced_view.php changed -File in-link/in-link/admin/browse.php changed -File in-link/in-link/admin/config_general.php is removed; release_3_1_7 revision 1.6 -File in-link/in-link/admin/install.php changed -File in-link/in-link/admin/validation.php changed -File in-link/in-link/admin/images/icon24_settings_in-link.gif is removed; release_3_1_7 revision 1.1 -File in-link/in-link/admin/images/icon46_list_settings_in-link.gif is removed; release_3_1_7 revision 1.1 -File in-link/in-link/admin/images/icon46_settings_in-link.gif is removed; release_3_1_7 revision 1.1 -File in-link/in-link/admin/import/inlink_import.php changed -File in-link/in-link/admin/include/navmenu.php changed -File in-link/in-link/admin/include/toolbar/advanced_view.php changed -File in-link/in-link/admin/include/toolbar/browse.php changed -File in-link/in-link/admin/install/inportal_data.sql changed -File in-link/in-link/admin/install/inportal_schema.sql changed -File in-link/in-link/admin/install/langpacks/english.lang changed -File in-link/in-link/admin/install/upgrades/changelog_3_2_0.txt is new; release_3_2_0 revision 1.1.2.9 -File in-link/in-link/admin/install/upgrades/inportal_upgrade_v3.2.0.sql is new; release_3_2_0 revision 1.2.2.1 -File in-link/in-link/admin/install/upgrades/readme_3_1_7.txt is removed; release_3_1_7 revision 1.1.2.2 -File in-link/in-link/admin/install/upgrades/readme_3_2_0.txt is new; release_3_2_0 revision 1.1.2.3 -File in-link/in-link/admin_templates/duplicate_checker.tpl is new; release_3_2_0 revision 1.9 -File in-link/in-link/admin_templates/export.tpl changed -File in-link/in-link/admin_templates/export_finish.tpl changed -File in-link/in-link/admin_templates/export_progress.tpl changed -File in-link/in-link/admin_templates/export_status_xml.tpl changed -File in-link/in-link/admin_templates/import.tpl changed -File in-link/in-link/admin_templates/import_progress.tpl changed -File in-link/in-link/admin_templates/import_status_xml.tpl changed -File in-link/in-link/admin_templates/link_selector.tpl changed -File in-link/in-link/admin_templates/img/icons/icon24_duplicate_checker.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon24_paid_listings.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon24_settings_custom.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon24_settings_email.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon24_settings_general.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon24_settings_in-link.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon24_settings_output.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon24_settings_search.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon24_validate.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon46_duplicate_checker.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon46_links.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon46_list_duplicate_checker.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon46_list_paid_listings.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon46_list_settings_custom.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon46_list_settings_email.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon46_list_settings_general.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon46_list_settings_in-link.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon46_list_settings_output.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon46_list_settings_search.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon46_list_validate.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon46_listing_types.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon46_paid_listings.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/img/icons/icon46_settings_in-link.gif is new; release_3_2_0 revision 1.1 -File in-link/in-link/admin_templates/links/images_edit.tpl is new; release_3_2_0 revision 1.2 -File in-link/in-link/admin_templates/links/links_catalog.tpl changed -File in-link/in-link/admin_templates/links/links_categories.tpl is new; release_3_2_0 revision 1.2 -File in-link/in-link/admin_templates/links/links_custom.tpl is new; release_3_2_0 revision 1.2 -File in-link/in-link/admin_templates/links/links_edit.tpl changed -File in-link/in-link/admin_templates/links/links_images.tpl is new; release_3_2_0 revision 1.2 -File in-link/in-link/admin_templates/links/links_relations.tpl is new; release_3_2_0 revision 1.2 -File in-link/in-link/admin_templates/links/links_reviews.tpl is new; release_3_2_0 revision 1.2 -File in-link/in-link/admin_templates/links/relations_edit.tpl is new; release_3_2_0 revision 1.2 -File in-link/in-link/admin_templates/links/review_edit.tpl is new; release_3_2_0 revision 1.2 -File in-link/in-link/admin_templates/paid_listings/paid_listing_edit.tpl changed -File in-link/in-link/admin_templates/paid_listings/paid_listing_type_edit.tpl changed -File in-link/in-link/admin_templates/paid_listings/paid_listing_types_list.tpl changed -File in-link/in-link/admin_templates/paid_listings/paid_listing_types_tabs.tpl changed -File in-link/in-link/admin_templates/paid_listings/paid_listings_list.tpl changed -File in-link/in-link/module_help/duplicate_links.txt is new; release_3_2_0 revision 1.1.2.1 -File in-link/in-link/module_help/links_custom.txt is new; release_3_2_0 revision 1.1 -File in-link/in-link/units/links/link_tag_processor.php changed -File in-link/in-link/units/links/links_config.php changed -File in-link/in-link/units/links/links_event_handler.php changed -File in-link/in-link/units/listing_types/listing_types_config.php changed -File in-link/in-link/units/listing_types/listing_types_event_handler.php changed -File in-link/in-link/units/listings/listings_config.php changed -File in-link/in-link/units/listings/listings_event_handler.php changed -File in-link/in-link/units/listings/listings_tag_processor.php changed -File in-link/themes/default/inlink/detail/link.tpl changed -File in-link/themes/default/inlink/edit_link/edit_link_form.tpl changed -File in-link/themes/default/inlink/suggest_link/suggest_link_form.tpl changed Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/inportal_upgrade_v3.2.2.sql =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/inportal_upgrade_v3.2.2.sql (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/inportal_upgrade_v3.2.2.sql (revision 0) @@ -1 +0,0 @@ -UPDATE Modules SET Version = '3.2.2' WHERE Name = 'In-Link'; \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_3_1_7.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_3_1_7.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_3_1_7.txt (revision 0) @@ -1,52 +0,0 @@ -File in-link/in-link/action.php changed -File in-link/in-link/frontaction.php changed -File in-link/in-link/link.php changed -File in-link/in-link/parser.php changed -File in-link/in-link/admin/addlink.php changed -File in-link/in-link/admin/addlink_custom.php changed -File in-link/in-link/admin/install.php changed -File in-link/in-link/admin/import/inlink_import.php changed -File in-link/in-link/admin/include/navmenu.php changed -File in-link/in-link/admin/include/help/configuration_output.txt is removed; release_3_1_6 revision 1.3.36.1 -File in-link/in-link/admin/include/help/configuration_search.txt is removed; release_3_1_6 revision 1.1 -File in-link/in-link/admin/install/inportal_data.sql changed -File in-link/in-link/admin/install/inportal_schema.sql changed -File in-link/in-link/admin/install/upgrades/changelog_3_1_7.txt is new; release_3_1_7 revision 1.1.2.8 -File in-link/in-link/admin/install/upgrades/inportal_upgrade_v3.1.7.php is new; release_3_1_7 revision 1.2 -File in-link/in-link/admin/install/upgrades/inportal_upgrade_v3.1.7.sql is new; release_3_1_7 revision 1.2.2.2 -File in-link/in-link/admin/install/upgrades/readme_3_1_7.txt is new; release_3_1_7 revision 1.1.2.2 -File in-link/in-link/admin_templates/img/logo_bg.gif is new; release_3_1_7 revision 1.1.2.1 -File in-link/in-link/module_help/config_list_output.txt is new; release_3_1_7 revision 1.1.2.1 -File in-link/in-link/module_help/config_list_search.txt is new; release_3_1_7 revision 1.1 -File in-link/in-link/units/links/links_config.php changed -File in-link/themes/default/inlink/addreview.tpl changed -File in-link/themes/default/inlink/catindex.tpl changed -File in-link/themes/default/inlink/detail.tpl changed -File in-link/themes/default/inlink/detail_zoom.tpl changed -File in-link/themes/default/inlink/get_rated.tpl changed -File in-link/themes/default/inlink/link_element.tpl changed -File in-link/themes/default/inlink/main.tpl changed -File in-link/themes/default/inlink/popitems_element.tpl changed -File in-link/themes/default/inlink/rate.tpl changed -File in-link/themes/default/inlink/related_element.tpl changed -File in-link/themes/default/inlink/reviews.tpl changed -File in-link/themes/default/inlink/suggest_link.tpl changed -File in-link/themes/default/inlink/catindex/catindex.tpl changed -File in-link/themes/default/inlink/catindex/catindex_element.tpl changed -File in-link/themes/default/inlink/detail_zoom/link.tpl changed -File in-link/themes/default/inlink/index/link_element.tpl changed -File in-link/themes/default/inlink/index/sitemap_cat_element.tpl changed -File in-link/themes/default/inlink/index/sitemap_subcat_element.tpl changed -File in-link/themes/default/inlink/main/favorites_element.tpl changed -File in-link/themes/default/inlink/main/main_element.tpl changed -File in-link/themes/default/inlink/main/edpick/links_element.tpl changed -File in-link/themes/default/inlink/my_items/myitem_element.tpl changed -File in-link/themes/default/inlink/my_items/right/edpick/links_element.tpl changed -File in-link/themes/default/inlink/pick/link_element.tpl changed -File in-link/themes/default/inlink/quicklinks/edpick/links_element.tpl changed -File in-link/themes/default/inlink/quicklinks/new/links_element.tpl changed -File in-link/themes/default/inlink/rate/getting_rated.tpl changed -File in-link/themes/default/inlink/rate/rate_form.tpl changed -File in-link/themes/default/inlink/search_results/search_results_element.tpl changed -File in-link/themes/default/inlink/suggest_link/suggest_link_form.tpl changed -File in-link/themes/default/inlink/trash/popitems_element.tpl changed Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/inportal_upgrade_v3.2.3.sql =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/inportal_upgrade_v3.2.3.sql (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/inportal_upgrade_v3.2.3.sql (revision 0) @@ -1,4 +0,0 @@ -ALTER TABLE ListingTypes ADD OnPurchaseStatus TINYINT DEFAULT '3' NOT NULL AFTER OnPurchaseAddToCat; -ALTER TABLE ListingTypes ADD OnExpireStatus TINYINT DEFAULT '3' NOT NULL AFTER OnExpireRemoveFromCat; - -UPDATE Modules SET Version = '3.2.3' WHERE Name = 'In-Link'; \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/inportal_upgrade_v4.0.1.sql =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/inportal_upgrade_v4.0.1.sql (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/inportal_upgrade_v4.0.1.sql (revision 0) @@ -1 +0,0 @@ -UPDATE Modules SET Version = '4.0.1' WHERE Name = 'In-Link'; \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_2_3.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_2_3.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_2_3.txt (revision 0) @@ -1,14 +0,0 @@ -Readme notes for In-link 3.2.3 -Intechnic Corporation, Nov 10, 2006 - - -New Features: - -- An option to define the status of Paid Listing upon purchase and expiration - -Bug fixes: - -- Language encodings in Ajax Admin Catalog were fixed -- Shortcuts on Summary page to Advanced View section fixed - -Mainly a maintenance release. \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_1_6.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_1_6.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_1_6.txt (revision 0) @@ -1,8 +0,0 @@ -Readme notes for In-link 3.1.6 -Intechnic Corporation, April 4, 2006 - -New features: - - Display of current link status under My Links section of My Account (default theme) - -Bug fixes: - - Multiple editing of pending link on the front-end resulted in multiple pending copies of the link in administrative console Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_3_1_6.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_3_1_6.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_3_1_6.txt (revision 0) @@ -1,24 +0,0 @@ -File in-link/in-link/action.php changed -File in-link/in-link/frontaction.php changed -File in-link/in-link/link.php changed -File in-link/in-link/module_init.php changed -File in-link/in-link/admin/addlink_reviews.php changed -File in-link/in-link/admin/addreview.php changed -File in-link/in-link/admin/include/help/configuration_output.txt changed -File in-link/in-link/admin/include/toolbar/browse.php changed -File in-link/in-link/admin/include/toolbar/editlink_review.php changed -File in-link/in-link/admin/include/toolbar/editlink_reviews.php changed -File in-link/in-link/admin/install/inportal_data.sql changed -File in-link/in-link/admin/install/langpacks/english.lang changed -File in-link/in-link/admin/install/upgrades/changelog_3_1_6.txt is new; release_3_1_6 revision 1.1.2.9 -File in-link/in-link/admin/install/upgrades/inportal_upgrade_v3.1.6.sql is new; release_3_1_6 revision 1.1 -File in-link/in-link/admin/install/upgrades/readme_3_1_6.txt is new; release_3_1_6 revision 1.1.2.1 -File in-link/in-link/admin_templates/export_progress.tpl changed -File in-link/in-link/admin_templates/export_status_xml.tpl is new; release_3_1_6 revision 1.1.2.1 -File in-link/in-link/admin_templates/import.tpl changed -File in-link/in-link/admin_templates/import_progress.tpl changed -File in-link/in-link/admin_templates/import_status_xml.tpl is new; release_3_1_6 revision 1.1.2.1 -File in-link/in-link/admin_templates/paid_listings/paid_listing_type_edit.tpl changed -File in-link/in-link/units/listings/listings_config.php changed -File in-link/in-link/units/listings/listings_event_handler.php changed -File in-link/themes/default/inlink/my_items/myitem_element.tpl changed Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_4_1_0.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_4_1_0.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_4_1_0.txt (revision 0) @@ -1,6 +0,0 @@ -Readme notes for In-link 4.1.0 -Intechnic Corporation, May 23, 2007 - -****** MySQL 5 database server is fully supported starting with this release ****** - -Please refer to the release notes for In-portal Platform 4.1.0 for more information. \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_2_1.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_2_1.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_2_1.txt (revision 0) @@ -1,5 +0,0 @@ -Readme notes for In-link 3.2.1 -Intechnic Corporation, July 25, 2006 - -This release is necessary to support the new features introduced in In-portal Platform 1.2.1 (such as Section Permissions in the Administrative Console). -Please refer to the release notes for In-portal Platform 1.2.1 for more information. Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_4_0_1.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_4_0_1.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_4_0_1.txt (revision 0) @@ -1,6 +0,0 @@ -Readme notes for In-link 4.0.1 -Intechnic Corporation, Apr 5, 2007 - - -This is a maintenance release of In-link. -Please refer to the release notes for In-portal Platform 4.0.1 for more information. \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_4_0_1.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_4_0_1.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_4_0_1.txt (revision 0) @@ -1,12 +0,0 @@ -File in-link/in-link/inlink_redirect.php changed -File in-link/in-link/admin/install/inportal_data.sql changed -File in-link/in-link/admin/install/langpacks/english.lang changed -File in-link/in-link/admin/install/upgrades/changelog_4_0_1.txt is new; release_4_0_1 revision 1.1.2.11 -File in-link/in-link/admin/install/upgrades/inportal_upgrade_v4.0.1.sql is new; release_4_0_1 revision 1.1.2.1 -File in-link/in-link/admin/install/upgrades/readme_4_0_1.txt is new; release_4_0_1 revision 1.1.2.1 -File in-link/in-link/admin_templates/export.tpl changed -File in-link/in-link/admin_templates/export_progress.tpl changed -File in-link/in-link/admin_templates/export_status_xml.tpl is removed; release_3_3_0 revision 1.6 -File in-link/in-link/admin_templates/import.tpl changed -File in-link/in-link/admin_templates/import_progress.tpl changed -File in-link/in-link/admin_templates/import_status_xml.tpl is removed; release_3_3_0 revision 1.6 Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_3_2_3.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_3_2_3.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_3_2_3.txt (revision 0) @@ -1,15 +0,0 @@ -File in-link/in-link/parser.php changed -File in-link/in-link/admin/install/inportal_data.sql changed -File in-link/in-link/admin/install/inportal_schema.sql changed -File in-link/in-link/admin/install/langpacks/english.lang changed -File in-link/in-link/admin/install/upgrades/changelog_3_2_3.txt is new; release_3_2_3 revision 1.1.2.4 -File in-link/in-link/admin/install/upgrades/inportal_upgrade_v3.2.3.sql is new; release_3_2_3 revision 1.1.2.3 -File in-link/in-link/admin/install/upgrades/readme_3_2_3.txt is new; release_3_2_3 revision 1.1.2.1 -File in-link/in-link/admin_templates/catalog_tab.tpl changed -File in-link/in-link/admin_templates/export.tpl changed -File in-link/in-link/admin_templates/paid_listings/paid_listing_edit.tpl changed -File in-link/in-link/admin_templates/paid_listings/paid_listing_type_edit.tpl changed -File in-link/in-link/units/links/links_config.php changed -File in-link/in-link/units/listing_types/listing_types_config.php changed -File in-link/in-link/units/listings/listings_config.php changed -File in-link/in-link/units/listings/listings_event_handler.php changed Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_3_2_2.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_3_2_2.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_3_2_2.txt (revision 0) @@ -1,10 +0,0 @@ -File in-link/in-link/inlink_redirect.php changed -File in-link/in-link/searchaction.php changed -File in-link/in-link/admin/import/inlink_import.php changed -File in-link/in-link/admin/install/inportal_data.sql changed -File in-link/in-link/admin/install/upgrades/changelog_3_2_2.txt is new; release_3_2_2 revision 1.1.2.8 -File in-link/in-link/admin/install/upgrades/inportal_upgrade_v3.2.2.sql is new; release_3_2_2 revision 1.1.2.1 -File in-link/in-link/admin/install/upgrades/readme_3_2_2.txt is new; release_3_2_2 revision 1.1.2.1 -File in-link/in-link/units/links/link_tag_processor.php changed -File in-link/in-link/units/links/links_config.php changed -File in-link/in-link/units/listings/listings_event_handler.php changed Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_1_7.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_1_7.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_1_7.txt (revision 0) @@ -1,9 +0,0 @@ -Readme notes for In-link 3.1.7 -Intechnic Corporation, May 4, 2006 - -New features - This is a maintenance release to support new features introduced in In-portal Platform 1.1.8 such as Category and Item Templates and custom field mechanism refactoring. - Please refer to the release notes for In-portal Platform 1.1.8 - -Bug fixes - - In-link2 import utility may have created categories and links with automatic filename disabled, resulting an incorrect behavior when imported data was used in conjunction with mod_rewrite Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_3_0.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_3_0.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_3_0.txt (revision 0) @@ -1,5 +0,0 @@ -Readme notes for In-link 3.3.0 -Intechnic Corporation, Feb 23, 2007 - - -This release is a maintenance release. Please refer to the release notes for In-portal Platform 1.4.0 for more information. Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/inportal_upgrade_v3.2.1.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/inportal_upgrade_v3.2.1.php (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/inportal_upgrade_v3.2.1.php (revision 0) @@ -1,24 +0,0 @@ -Conn->Query($query); - - moveItemTemplatesToCustom('In-Link', 'l'); - -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_2_0.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_2_0.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/readme_3_2_0.txt (revision 0) @@ -1,8 +0,0 @@ -Readme notes for In-link 3.2.0 -Intechnic Corporation, July 4, 2006 - -This release is necessary to support the new features introduced in In-portal Platform 1.2.0 (such as Section Permissions in the Administrative Console). -Please refer to the release notes for In-portal Platform 1.2.0 for more information. - -New In-link features: - - Duplicate Links checker - allows locating duplicate links by their Name and/or URL field and editing, deleting and merging duplicates Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_3_2_1.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_3_2_1.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin/install/upgrades/changelog_3_2_1.txt (revision 0) @@ -1,85 +0,0 @@ -File in-link/in-link/inlink_redirect.php changed -File in-link/in-link/link.php changed -File in-link/in-link/parser.php changed -File in-link/in-link/admin/addlink_category.php changed -File in-link/in-link/admin/install.php changed -File in-link/in-link/admin/import/inlink_import.php changed -File in-link/in-link/admin/include/help/configuration_custom.txt is removed; release_3_2_0 revision 1.1 -File in-link/in-link/admin/include/help/configuration_email.txt is removed; release_3_2_0 revision 1.1 -File in-link/in-link/admin/include/help/editlink_category.txt is removed; release_3_2_0 revision 1.2 -File in-link/in-link/admin/include/help/editlink_custom.txt is removed; release_3_2_0 revision 1.1 -File in-link/in-link/admin/include/help/editlink_general.txt is removed; release_3_2_0 revision 1.4 -File in-link/in-link/admin/include/help/editlink_image.txt is removed; release_3_2_0 revision 1.1 -File in-link/in-link/admin/include/help/editlink_images.txt is removed; release_3_2_0 revision 1.1 -File in-link/in-link/admin/include/help/editlink_relation.txt is removed; release_3_2_0 revision 1.1 -File in-link/in-link/admin/include/help/editlink_relations.txt is removed; release_3_2_0 revision 1.1 -File in-link/in-link/admin/include/help/editlink_review.txt is removed; release_3_2_0 revision 1.1 -File in-link/in-link/admin/include/help/editlink_reviews.txt is removed; release_3_2_0 revision 1.1 -File in-link/in-link/admin/include/help/inlink_general.txt is removed; release_3_2_0 revision 1.1 -File in-link/in-link/admin/include/toolbar/advanced_view.php changed -File in-link/in-link/admin/include/toolbar/browse.php changed -File in-link/in-link/admin/install/inportal_data.sql changed -File in-link/in-link/admin/install/inportal_schema.sql changed -File in-link/in-link/admin/install/langpacks/english.lang changed -File in-link/in-link/admin/install/upgrades/changelog_3_2_1.txt is new; release_3_2_1 revision 1.1.2.6 -File in-link/in-link/admin/install/upgrades/inportal_upgrade_v3.2.1.php is new; release_3_2_1 revision 1.1.2.3 -File in-link/in-link/admin/install/upgrades/inportal_upgrade_v3.2.1.sql is new; release_3_2_1 revision 1.2.2.1 -File in-link/in-link/admin/install/upgrades/readme_3_2_1.txt is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/admin_templates/catalog_tab.tpl is new; release_3_2_1 revision 1.14.2.8 -File in-link/in-link/admin_templates/category_properties.tpl is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/admin_templates/duplicate_checker.tpl changed -File in-link/in-link/admin_templates/export_progress.tpl changed -File in-link/in-link/admin_templates/export_status_xml.tpl changed -File in-link/in-link/admin_templates/import.tpl changed -File in-link/in-link/admin_templates/import_progress.tpl changed -File in-link/in-link/admin_templates/import_status_xml.tpl changed -File in-link/in-link/admin_templates/link_selector.tpl is removed; release_3_2_0 revision 1.11 -File in-link/in-link/admin_templates/img/icons/icon46_paid_listings.gif changed -File in-link/in-link/admin_templates/img/toolbar/tool_new_link.gif is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/admin_templates/img/toolbar/tool_new_link_f2.gif is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/admin_templates/img/toolbar/tool_new_link_f3.gif is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/admin_templates/img/toolbar/tool_new_listing.gif is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/admin_templates/img/toolbar/tool_new_listing_f2.gif is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/admin_templates/img/toolbar/tool_new_listing_type.gif is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/admin_templates/img/toolbar/tool_new_listing_type_f2.gif is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/admin_templates/links/images_edit.tpl changed -File in-link/in-link/admin_templates/links/inlink_redirect.tpl is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/admin_templates/links/links_catalog.tpl changed -File in-link/in-link/admin_templates/links/links_categories.tpl changed -File in-link/in-link/admin_templates/links/links_custom.tpl changed -File in-link/in-link/admin_templates/links/links_edit.tpl changed -File in-link/in-link/admin_templates/links/links_images.tpl changed -File in-link/in-link/admin_templates/links/links_relations.tpl changed -File in-link/in-link/admin_templates/links/links_reviews.tpl changed -File in-link/in-link/admin_templates/links/relations_edit.tpl changed -File in-link/in-link/admin_templates/links/review_edit.tpl changed -File in-link/in-link/admin_templates/paid_listings/paid_listing_edit.tpl changed -File in-link/in-link/admin_templates/paid_listings/paid_listing_type_edit.tpl changed -File in-link/in-link/admin_templates/paid_listings/paid_listing_types_list.tpl changed -File in-link/in-link/admin_templates/paid_listings/paid_listing_types_tabs.tpl changed -File in-link/in-link/admin_templates/paid_listings/paid_listings_list.tpl changed -File in-link/in-link/module_help/config_list_general.txt is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/module_help/custom_fields_list.txt is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/module_help/email_settings_list.txt is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/module_help/images_edit.txt is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/module_help/links_categories.txt is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/module_help/links_custom.txt changed -File in-link/in-link/module_help/links_edit.txt is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/module_help/links_images.txt is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/module_help/links_relations.txt is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/module_help/links_reviews.txt is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/module_help/relations_edit.txt is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/module_help/reviews_edit.txt is new; release_3_2_1 revision 1.1.2.1 -File in-link/in-link/units/links/link_tag_processor.php changed -File in-link/in-link/units/links/links_config.php changed -File in-link/in-link/units/listing_types/listing_types_config.php changed -File in-link/in-link/units/listing_types/listing_types_event_handler.php changed -File in-link/in-link/units/listing_types/listing_types_tag_processor.php changed -File in-link/in-link/units/listings/listings_config.php changed -File in-link/in-link/units/listings/listings_event_handler.php changed -File in-link/in-link/units/listings/listings_tag_processor.php changed -File in-link/themes/default/inlink/blocks/links/link_cancel_confirmation.tpl changed -File in-link/themes/default/inlink/blocks/links/link_extend_confirm.tpl changed -File in-link/themes/default/inlink/detail/link.tpl changed -File in-link/themes/default/inlink/edit_link/edit_link_form.tpl changed -File in-link/themes/default/inlink/search_results/search_results_element.tpl changed Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/import_status_xml.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/import_status_xml.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/import_status_xml.tpl (revision 0) @@ -1 +0,0 @@ - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/category_properties.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/category_properties.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/category_properties.tpl (revision 0) @@ -1,2 +0,0 @@ - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/export_status_xml.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/export_status_xml.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/export_status_xml.tpl (revision 0) @@ -1 +0,0 @@ - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/links/inlink_redirect.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/links/inlink_redirect.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/links/inlink_redirect.tpl (revision 0) @@ -1 +0,0 @@ - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/img/logo_bg.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/img/icons/icon46_paid_listings.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/img/toolbar/tool_new_link_f3.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/img/toolbar/tool_new_listing_type.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/img/toolbar/tool_new_link.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/img/toolbar/tool_new_listing_f2.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/img/toolbar/tool_new_listing_type_f2.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/img/toolbar/tool_new_link_f2.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/unlabeled/unlabeled-1.1.2/in-link/admin_templates/img/toolbar/tool_new_listing.gif =================================================================== diff -u -N -r12746 -r12830 Binary files differ Index: branches/unlabeled/unlabeled-1.3.36/in-link/admin/include/help/configuration_output.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.3.36/in-link/admin/include/help/configuration_output.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.3.36/in-link/admin/include/help/configuration_output.txt (revision 0) @@ -1,20 +0,0 @@ -This section allows the administrator to specify the default values for various link settings in In-link. -
      -
    • Order links by � this setting specifies the default primary sort order for the link listings. It applies both on the front-end, and in the Administrative Console � in the catalog. The first dropdown allows to select the field (an attribute of the link), and the second dropdown � the direction of the sort. -
    • And then by � this setting specifies the default secondary sort order. It is set in the same way as the primary, and used when the primary order values are ambiguous. For example, when the primary sort value is �Link Name', the secondary order will be used to sort among links with the same name. -
    • Number of links per page � specifies the default number of links shown per page. This value applies both to the front-end and to the Administrative Console. In the latter, this value can be changed for each session through the View menu. -
    • Number of links per page on a short listing � this setting is similar to the � Number of links per page', but it applies to the front-end short link lists only. It can be overridden by setting the tag attributes in the appropriate templates. -
    • Number of days for a link to be NEW � this setting specifies the number of days, from the date of creation, during which the link will be automatically marked �New' by the system. This setting will only apply to the links with the �New' flag set to �Automatic'. -
    • Minimum rating for a link to be POP � this setting specifies the minimum rating of the link for it to be automatically marked �Popular� by the system. This setting will only apply to the links with the �Popularity� flag set to �Automatic�. Note, that for a link to be �popular� it will need to meet the �minimum votes� requirement set below. -
    • Maximum number of HOT links � this setting specifies the maximum number �hot� links in the database. A �hot� link is the one that has more hits than the other links. For example, if this option is set to �2�, the In-portal system will pick the two links with the most hits and mark them as hot. (Of course, this will change real-time as links� hits are updated, or as this setting changes). Please note, if more than one link has the maximum number of hits, the system will still enforce the maximum number requirement; therefore, there may be situations when a link with the most hits is not marked as �hot�. -
    • Minimum number of votes to enable link rating � this setting specifies the minimum number of votes required for the link rating to be effective. Usually, when only a small number of users have voted on a link, its rating will not be statistically accurate - it is likely, that only biased users have voted. When a larger number of users vote, the rating becomes more accurate. This setting affects the �popularity� property of a link � links with less than required number of votes will not be considered �popular�, even if their rating is high enough. -
    • Enhanced Listings � this setting will enable the Enhanced listings functionality on the front end. Specifically, the �Enhance� option will appear on link listings under My Links section on the front end. To use the enhanced listing functionally, the site administrator needs to create at least one Listing Type under In-Link->Paid Listings section. -
    • Allow Free Listings � controls if free (regular) listings should be allowed; effective only when the enhanced (paid) listings are on.
    • -
    • Display editor PICKs above regular links � this setting will force all links, marked as �Editor's pick' to be displayed above the other links, regardless of their priority or sort order. Among themselves, �Editor's pick' links will be sorted according to the regular rules. -
    • Display link URL in status bar � this setting toggles the display of the URL in the browsers status bar (usually at the bottom of the window). It is impossible to view the URL of the link by examining the link itself, because In-link uses an intermediate script to redirect visitors to the link destinations. If it is desirable that the visitors can see the destination of the link, enable this setting. -
    • Allow Duplicate Reviews � this setting specifies the period during which the same user cannot submit another review on the same link. The time can be entered in seconds, minutes, hours, days, months or years. If it is set to zero, the users can submit reviews without this limitation. Please note, that regardless of this setting, the same user will be able to submit a review on another link immediately after the first review. -
    • Allow Duplicate Rating Votes - this setting specifies the period during which the same user cannot rate the same link again. The time can be entered in seconds, minutes, hours, days, months or years. If it is set to zero, the users can rate links without this limitation. Please note, that regardless of this setting, the same user will be able to rate another link immediately after the first rating. -
    • Reviews Per Page - specifies the default number of reviews shown per page. This value applies both to the front-end and to the Administrative Console. -
    • Sort reviews by - this setting specifies the default primary sort order for the review listings. It applies both on the front-end, and in the Administrative Console � in the link management section, Reviews tab. The first dropdown allows to select the field (an attribute of the review), and the second dropdown � the direction of the sort. -
    • and then by - this setting specifies the default secondary sort order. It is set in the same way as the primary, and used when the primary order values are ambiguous. For example, when the primary sort value is �Review Text', the secondary order will be used to sort among reviews with the same body. -
    \ No newline at end of file Index: branches/unlabeled/unlabeled-1.9.2/in-link/admin_templates/paid_listings/paid_listings_list.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.9.2/in-link/admin_templates/paid_listings/paid_listings_list.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.9.2/in-link/admin_templates/paid_listings/paid_listings_list.tpl (revision 0) @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - -
    - -
    - - - -   - - - - - - "> - - - - - - "> - - - - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.9.2/in-link/admin_templates/links/links_edit.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.9.2/in-link/admin_templates/links/links_edit.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.9.2/in-link/admin_templates/links/links_edit.tpl (revision 0) @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - - - - - - - "> - - - - - - - - - - - - - - - - - - - - " /> - - - - - -
    - -
    - - - Index: branches/unlabeled/unlabeled-1.10.2/in-link/admin_templates/paid_listings/paid_listing_edit.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.10.2/in-link/admin_templates/paid_listings/paid_listing_edit.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.10.2/in-link/admin_templates/paid_listings/paid_listing_edit.tpl (revision 0) @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - "> - - - - - - - - - -
    Link Name: - - -  
    - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.10.2/in-link/units/listing_types/listing_types_config.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.10.2/in-link/units/listing_types/listing_types_config.php (revision 12746) +++ branches/unlabeled/unlabeled-1.10.2/in-link/units/listing_types/listing_types_config.php (revision 0) @@ -1,126 +0,0 @@ - 'lst', - 'ItemClass' => Array('class'=>'kDBItem','file'=>'','build_event'=>'OnItemBuild'), - 'ListClass' => Array('class'=>'kDBList','file'=>'','build_event'=>'OnListBuild'), - 'EventHandlerClass' => Array('class'=>'ListingTypesEventHandler','file'=>'listing_types_event_handler.php','build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'ListingTypesTagProcessor','file'=>'listing_types_tag_processor.php','build_event'=>'OnBuild'), - 'AutoLoad' => true, - 'AggregateTags' => Array( - Array( - 'AggregateTo' => 'l', - 'AggregatedTagName' => 'ListListingTypes', - 'LocalTagName' => 'PrintList', - ), - Array( - 'AggregateTo' => 'l', - 'AggregatedTagName' => 'ListingTypeField', - 'LocalTagName' => 'Field', - ), - ), - 'Hooks' => Array(), - 'QueryString' => Array( - 1 => 'id', - 2 => 'page', - 3 => 'event', - 4 => 'mode', - ), - 'IDField' => 'ListingTypeId', - 'TitleField' => 'Name', - 'TitlePresets' => Array( - 'default' => Array( 'new_status_labels' => Array('lst'=>'!la_title_AddingPaidListingType!'), - 'edit_status_labels' => Array('lst'=>'!la_title_EditingPaidListingType!'), - 'new_titlefield' => Array('lst'=>'!la_title_NewPaidListingType!'), - ), - 'listing_type_list'=>Array( 'prefixes' => Array('lst_List'), - 'format' => "!la_title_PaidListingTypes! (#lst_recordcount#)", - ), - 'listing_type_edit'=>Array( 'prefixes' => Array('lst'), - 'new_titlefield' => Array('lst'=>'!la_title_NewPaidListingType!'), - 'format' => "#lst_status# '#lst_titlefield#' - !la_title_General!", - ), - 'listing_type_shop_cart'=>Array( 'prefixes' => Array('lst'), - 'new_titlefield' => Array('lst'=>'!la_title_NewPaidListingType!'), - 'format' => "#lst_status# '#lst_titlefield#' - !la_title_ShopCartEntry!", - ), - - - ), - - 'PermSection' => Array('main' => 'in-link:listing_types'), - - 'Sections' => Array( - 'in-link:listing_types' => Array( - 'parent' => 'in-link:paid_listings_folder', - 'icon' => 'paid_listings', - 'label' => 'la_tab_ListingTypes', - 'url' => Array('t' => 'in-link/paid_listings/paid_listing_types_list', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit', 'delete'), - 'priority' => 8.2, - 'type' => stTAB, - ), - ), - - 'TableName' => TABLE_PREFIX.'ListingTypes', - - 'ListSQLs' => Array( ''=>'SELECT * FROM %s',), // key - special, value - list select sql - - 'ItemSQLs' => Array( ''=>'SELECT * FROM %s',), - - 'ListSortings' => Array( - '' => Array( - 'Sorting' => Array('ListingTypeId' => 'asc'), - ) - ), - - 'Fields' => Array - ( - 'ListingTypeId' => Array('type' => 'int','not_null' => '1','default' => ''), - 'Name' => Array('type' => 'string','not_null' => '1','default' => '','required' => '1'), - 'Description' => Array('type' => 'string', 'not_null' => 1, 'default' => ''), - 'Duration' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'DurationType' => Array('type' => 'int','not_null' => '1','default' => '0','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(1 => 'la_opt_sec', 2 => 'la_opt_min', 3 => 'la_opt_hour', 4 => 'la_opt_day', 5 => 'la_opt_week', 6 => 'la_opt_month', 7 => 'la_opt_year')), - 'OnPurchaseEdPick' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off'),'default' => '3'), - - 'OnPurchaseStatus' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_Enabled', 0 => 'la_Disabled', 2 => 'la_Pending'),'default' => '3'), - - 'OnPurchaseNew' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off', 2 => 'la_Auto'),'default' => '3'), - 'OnPurchasePop' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off', 2 => 'la_Auto'),'default' => '3'), - 'OnPurchaseHot' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off', 2 => 'la_Auto'),'default' => '3'), - 'OnPurchasePriorityAction' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(0 => 'la_DontChange', 1 => 'la_SetEqualTo', 2 => 'la_IncreaseBy', 3 => 'la_DecreaseBy'),'default' => '0'), - 'OnPurchasePriorityValue' => Array('type' => 'int','not_null' => '1','default' => '1'), - 'OnPurchaseAddToCatEnabled' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'OnPurchaseAddToCat' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'OnExpireEdPick' => Array('type' => 'int','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off'),'not_null' => '1','default' => '3'), - 'OnExpireNew' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off', 2 => 'la_Auto'),'default' => '3'), - 'OnExpirePop' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off', 2 => 'la_Auto'),'default' => '3'), - 'OnExpireHot' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_On', 0 => 'la_Off', 2 => 'la_Auto'),'default' => '3'), - 'OnExpirePriorityAction' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(0 => 'la_DontChange', 1 => 'la_SetEqualTo', 2 => 'la_IncreaseBy', 3 => 'la_DecreaseBy'),'default' => '0'), - 'OnExpirePriorityValue' => Array('type' => 'int','not_null' => '1','default' => '1'), - 'OnExpireRemoveFromCatEnabled' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'OnExpireRemoveFromCat' => Array('type' => 'int','not_null' => '1','default' => '0'), - - 'OnExpireStatus' => Array('type' => 'int','not_null' => '1','formatter'=>'kOptionsFormatter','use_phrases' => 1,'options' => Array(3 => 'la_Unchanged', 1 => 'la_Enabled', 0 => 'la_Disabled', 2 => 'la_Pending'),'default' => '3'), - 'RenewalReminder' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'EnableBuying' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'ShopCartName' => Array('type' => 'string','default' => ''), - 'Price' => Array('type' => 'double','default' => ''), - 'Recurring' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'VirtualProductId' => Array('type' => 'int','not_null' => '1','default' => '0'), - ), - - 'Grids' => Array( - 'Default' => Array( - 'Icons' => Array('default'=>'icon16_listing_type.gif'), - 'Fields' => Array( - 'ListingTypeId' => Array( 'title'=>'la_col_Id' , 'data_block' => 'grid_checkbox_td'), - 'Name' => Array( 'title'=>'la_col_Name' ), - 'Duration' => Array( 'title'=>'la_col_Duration' , 'data_block' => 'duration_td'), - ), - - ), - ), - ); - -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.46.2/in-link/link.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.46.2/in-link/link.php (revision 12746) +++ branches/unlabeled/unlabeled-1.46.2/in-link/link.php (revision 0) @@ -1,1215 +0,0 @@ -clsCatItem(TRUE); //call parent constructor - - $this->tablename=GetTablePrefix()."Link"; - $this->type=TYPE_LINK; - $this->BasePermission ="LINK"; - $this->id_field = "LinkId"; - $this->TagPrefix = "link"; - $this->TitleField = 'Name'; - $this->ReviewSortOrder = trim($objConfig->Get("Link_ReviewsSort")." ".$objConfig->Get("Link_ReviewsOrder")); - $this->ReviewSortOrder .= trim(",".$objConfig->Get("Link_ReviewsSort2")." ".$objConfig->Get("Link_ReviewsOrder2")); - $this->Reviews->PerPage = $objConfig->Get("Perpage_LinkReviews"); - - /* keyword highlighting */ - $this->OpenTagVar = "Link_Highlight_OpenTag"; - $this->CloseTagVar = "Link_Highlight_CloseTag"; - - if(isset($LinkId)) - $this->LoadFromDatabase($LinkId); - if($objSession->HasSystemPermission("DEBUG.ITEM")) - { - $this->SetDebugLevel(1); - } - } - - function DetectChanges($name, $value) - { - global $objSession; - - if (!isset($this->Data[$name]) ) return false; - - //echo "class: ".get_class($this)."
    "; - if ($this->Data[$name] != $value && $value != '') { - //echo "$name Modified tt ".$this->Data[$name]." : $value
    "; - if ($objSession->GetVariable("HasChanges") != 1) { - $objSession->SetVariable("HasChanges", 2); - } - } - } - - - function ClearCacheData() - { - DeleteModuleTagCache('inlink'); - /*$cats = explode(",",$this->CategoryMemberList()); - if(is_array($cats)) - { - foreach($cats as $c) - { - if(is_numeric($c)) - { - $evar = "'%:m".$c."%'"; - DeleteTagCache("l_list_links","",$evar); - DeleteTagCache("l_link_more","",$evar); - } - } - } - DeleteTagCache("l_link_modified%",""); - DeleteTagCache("LinkPopValue","",""); - DeleteTagCache("LinkHotValue","",""); - DeleteTagCache("LinkNewValue","","");*/ - } - - - function Delete() - { - parent::Delete(); - if($this->tablename==GetTablePrefix()."Link") - { - $this->ClearCacheData(); - // DeleteTagCache("m_itemcount","Link%"); - } - } - - function Update($UpdatedBy = null) - { - parent::Update($UpdatedBy); - if($this->tablename == GetTablePrefix().'Link') $this->ClearCacheData(); - } - - function Create() - { - parent::Create(); - if($this->tablename == GetTablePrefix().'Link') $this->ClearCacheData(); - } - - function SetNewItem() - { - global $objConfig; - - $value = $this->Get("CreatedOn"); - - $cutoff = adodb_date("U") - ($objConfig->Get("Link_NewDays") * 86400); - $this->IsNew = FALSE; - if($value>$cutoff) - $this->IsNew = TRUE; - return $this->IsNew; - } - - function SetPopItem() - { - global $objConfig, $objLinkList; - - $cutoff = $objLinkList->GetPopValue(); - $this->IsPop = FALSE; - if($cutoff>0) - { - if($this->Get('CachedRating') >= $cutoff - && $this->Get('CachedVotesQty') >= $objConfig->Get('Link_MinVotes')) - { - $this->IsPop = TRUE; - } - } - return $this->IsPop; - } - - function SetHotItem() - { - global $objConfig, $objLinkList, $objSession; - - $this->IsHot = FALSE; - $cutoff = $objLinkList->GetHotValue(); - if($cutoff>0) - { - if($this->Get("Hits")>=$cutoff) { - $this->IsHot = TRUE; - } - } - return $this->IsHot; - } - - function Approve() - { - if($this->Get("Status")==-2) - { - $this->SendUserEventMail("LINK.MODIFY.APPROVE",$this->Get("CreatedById")); - $this->SendAdminEventMail("LINK.MODIFY.APPROVE"); - } - else - { - $this->SendUserEventMail("LINK.APPROVE",$this->Get("CreatedById")); - $this->SendAdminEventMail("LINK.APPROVE"); - } - $this->Set("Status", 1); - $this->Update(); - } - - function Deny() - { - if($this->Get("Status")==-2) - { - $this->SendUserEventMail("LINK.DENY.PENDING",$this->Get("CreatedById")); - $this->SendAdminEventMail("LINK.DENY.PENDING"); - $this->Delete(); - } - else - { - $this->SendUserEventMail("LINK.DENY",$this->Get("CreatedById")); - $this->SendAdminEventMail("LINK.DENY"); - $this->Set("Status", 0); - $this->Update(); - } - } - - function Validate() - { - global $objSession, $Errors; - - $dataValid = true; - if(!strlen($this->Get("Name"))) - { - $Errors->AddError("error.fieldIsRequired",'Name',"","",get_class($this),"Validate"); - $dataValid = false; - } - -// if(!isset($this->m_Url)) -// { -// $Errors->AddError("error.fieldIsRequired",'Url',"","",get_class($this),"Validate"); -// $dataValid = false; -// } - - if(!(int)$this->Get("CreatedOn")) - { - $Errors->AddError("error.fieldIsRequired",'CreatedOn',"","",get_class($this),"Validate"); - $dataValid = false; - } - - if(!(int)$this->Get("CreatedById")) - { - $Errors->AddError("error.fieldIsRequired",'CreatedBy',"","",get_class($this),"Validate"); - $dataValid = false; - } - return $dataValid; - } - - - function LoadFromDatabase($Id) - { - global $objSession,$Errors; - - if(!isset($Id)) - { - $Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromDatabase"); - return false; - } - - $sql = sprintf("SELECT * FROM ".$this->tablename." WHERE LinkId = '%s'",$Id); - $result = $this->adodbConnection->Execute($sql); - if ($result === false) - { - $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromDatabase"); - return false; - } - $data = $result->fields; - if(is_array($data)) - $this->SetFromArray($data); - $this->Clean(); - return TRUE; - } - - function LoadFromResourceId($Id) - { - global $objSession, $Errors; - if(!isset($Id)) - { - $Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromResourceId"); - return false; - } - $sql = sprintf("SELECT * FROM ".$this->tablename." WHERE ResourceId = '%s'",$Id); - $result = $this->adodbConnection->Execute($sql); - if ($result === false) - { - $Errors->AddError("error.DatabaseError",NULL,$adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromResourceId"); - return false; - } - $data = $result->fields; - if(is_array($data)) - { - $this->SetFromArray($data); - $this->Clean(); - } - return TRUE; - } - - function ReviewCount($TodayOnly = FALSE) - { - -// if($TodayOnly==FALSE && is_numeric($this->Get("CachedReviewsQty"))) -// return (int)$this->Get("CachedReviewsQty"); //this is a performance boost - - if(!is_object($this->Reviews)) - { - $this->Reviews= new clsItemReviewList($this->Get("ResourceId")); - } - else - { - $this->Reviews->itemID=$this->Get("ResourceId"); - } - return $this->Reviews->GetItemReviewCount($TodayOnly); - } - - function StatusIcon() - { - global $rootURL; - - $ret = $rootURL."/in-link/admin/images/"; - - switch(abs($this->Get("Status"))) - { - case STATUS_DISABLED: - $ret .= "icon16_link_disabled.gif"; - break; - case STATUS_PENDING: - $ret .= "icon16_link_pending.gif"; - break; - case STATUS_ACTIVE: - $img = "icon16_link.gif"; - if($this->IsPopItem()) - $img = "icon16_link_pop.gif"; - if($this->IsHotItem()) - $img = "icon16_link_hot.gif"; - if($this->IsNewItem()) - $img = "icon16_link_new.gif"; - if($this->Is("EditorsPick")) - $img = "icon16_link_pick.gif"; - $ret .= $img; - break; - } - return $ret; - } - - function ItemURL($Template=NULL,$SetCat=FALSE,$Action=NULL) - { - global $var_list_update,$var_list,$l_var_list_update,$m_var_list_update; - - $url_params = Array(); - $var_list_update['t'] = $Template ? $Template : $var_list['t']; - - //if($SetCat) - //{ - $cat = $this->Get("CategoryId"); - if( !is_numeric($cat) ) $cat = $this->GetPrimaryCategory(); - $m_var_list_update["cat"] = $cat; - //} - - $l_var_list_update["id"] = $this->Get("LinkId"); - - if( isset($Action) && $Action ) $url_params['Action'] = $Action; - $ret = HREF_Wrapper('', $url_params); - - unset($l_var_list_update["id"], $var_list_update["t"],$m_var_list_update["cat"]); - return $ret; - } - - function ParseObject($element) - { - /* when updating this function, update the comments at the top of the file */ - global $objConfig, $objCatList, $rootURL, $var_list, $var_list_update, - $l_var_list_update, $m_var_list_update, $objSession, $objUsers; - - $extra_attribs = ExtraAttributes($element->attributes); - if(strtolower($element->name)==$this->TagPrefix) - { - $field = strtolower($element->attributes["_field"]); - switch($field) - { - case 'pending_approval': - $ret = $this->isPending() ? true : ''; - if ($element->GetAttributeByName('_Not')) { - $ret = $ret ? '' : true; - } - break; - - /* - @field:link.url - @description:Returns link URL or default value if URL is empty - */ - case 'url': - $ret = $this->Get('Url'); - $default = $element->GetAttributeByName('_default'); - if( empty($ret) && !empty($default) ) - { - $ret = language($default); - } - break; - - case 'additional_params': - $ret = ''; - if( $objConfig->Get('Link_UrlStatus') ) - { - $link_url = addslashes( htmlspecialchars( $this->Get('Url') ) ); - $ret = ' onmouseover="window.status = \''.$link_url.'\'; return true;" onmouseout="window.status = \'\';"'; - } - break; - - case "name": - /* - @field:link.name - @description:Returns the link name - */ - //echo "test"; - $ret= $this->HighlightField("Name"); - break; - case "description": - /* - @field:link.description - @description:Link Description - @attrib:_maxlength:int:Maximum number of characters to return - @attrib:_wordchop:bool:If truncating the description, setting wordchop causes the result to be truncated at the last space before the split - */ - $ret = inp_unescape(($this->Get("Description"))); - $len = (int)$element->GetAttributeByName('_maxlength'); - if($len>0 && strlen($ret)>$len) - { - $ret = substr($ret,0,$len); - $wordchop = $element->GetAttributeByName('_wordchop'); - if(strlen($wordchop)==0 || $wordchop = "1") - { - if(substr($wordchop,-1)!=" ") - { - $pos = strrpos($ret," "); - $ret = substr($ret,0,$pos); - } - } - $ret .= " .."; - } - $ret = $this->HighlightText($ret); - break; - case "createdby": - /* - @field:link.createdby - @description:parse a user field of the user that created the link - @attrib:_usertag::User field to return (defaults to login ID) - */ - $field = $element->attributes["_usertag"]; - if(!strlen($field)) - { - $field = "user_login"; - } - - $userId = $this->Get("CreatedById"); - - if (!empty($userId) && ($userId > 0)) - { - $u =& $objUsers->GetItem($userId); - if (is_object($u)) - { - $ret = $u->parsetag($field); - } - } - else - $ret = " "; - - break; - case "date": - /* - @field:link.date - @description:Returns the date/time the link was created - @attrib:_tz:bool:Convert the date to the user's local time - @attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr - */ - $d = $this->Get("CreatedOn"); - $ret = $this->ParseTimeStamp($d,$element->attributes); - break; - case "modified": - /* - @field:link.modified - @description:Returns the date/time the link was last modified - @attrib:_tz:bool:Convert the date to the user's local time - @attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr - */ - $d = $this->Get("Modified"); - if($d<=0) - $d = $this->Get("CreatedOn"); - $ret = $this->ParseTimeStamp($d,$element->attributes); - break; - - case "expire": - /* - @field:link.expire - @description:Returns the date/time the link suppose to expire. - @attrib:_tz:bool:Convert the date to the user's local time - @attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr - @attrib:_dataexists:bool: Used with opeing/closing tags to exclude the whole block when expiration date is not set. - @attrib:_noexpirelabel:lang:Returns language tag when link is immortal (expire set to 0). - */ - $d = $this->Get("Expire"); - if($d == 0) - { - if($element->attributes['_datenotset'] == 1) - { - $ret = 1; - break; - } - - if(strlen($element->attributes['_noexpirelabel'])) - $ret = language($element->attributes['_noexpirelabel']); - else - $ret = ""; - } - elseif ($d > 0) - { - $ret = $this->ParseTimeStamp($d, $element->attributes); - } - else - $ret = ""; - - break; - - case "delete_link": - /* - @field:link.delete_link - @description:Returns a URL to delete the link - @attrib:_template:tpl:Template URL should point to - */ - $catid = $this->GetPrimaryCategory(); - if($objSession->HasCatPermission("LINK.DELETE",$catid) || - ($objSession->Get("PortalUserId")==$this->Get("CreatedById") && $objSession->HasCatPermission("LINK.OWNER.DELETE",$catid))) - { - $t = $element->attributes["_template"]; - if(!strlen($t)) - $t = $var_list["t"]; - $ret = $this->ItemURL($t); - } - - break; - - case "edit_link": - /* - @field:link.edit_link - @description:Returns a URL to edit the link - @attrib:_template:tpl:Template URL should point to - */ - - $catid = $this->GetPrimaryCategory(); - if(($objSession->HasCatPermission("LINK.MODIFY",$catid) || $objSession->HasCatPermission("LINK.MODIFY.PENDING",$catid)) || - (($objSession->Get("PortalUserId")==$this->Get("CreatedById") && $objSession->HasCatPermission("LINK.OWNER.MODIFY",$catid)) || ($objSession->Get("PortalUserId")==$this->Get("CreatedById") && $objSession->HasCatPermission("LINK.OWNER.MODIFY.PENDING",$catid)))) - { - $t = $element->attributes["_template"]; - if(!strlen($t)) - $t = $var_list["t"]; - $ret = $this->ItemURL($t); - } - - break; - - case 'is_enhanced': - - if (!class_exists('kApplication') || $this->isPending() ) { - return ''; - } - - $application =& kApplication::Instance(); - $l_tag_processor =& $application->recallObject('l_TagProcessor'); - $application->SetVar('l_id', $this->Get('LinkId')); - $res = $l_tag_processor->LinkIsEnhanced( Array() ); - - $ret = getArrayValue($element->attributes, '_not') ? !$res : $res; - return $ret ? 1 : ''; - break; - - case "redirect": - /* - @field:link.redirect - @description:Returns a URL to redirect the browser to the link's URL - */ - $ret = $rootURL."in-link/inlink_redirect.php?env=". BuildEnv()."&linkid=".$this->Get("LinkId"); - break; - case "add_favorite_link": - /* - @field:link.add_favorite_link - @description:Returns a URL to add this link to the user's favorites - @attrib:_template:tpl:Template URL should point to - */ - $t = $element->attributes["_template"]; - if(!strlen($t)) - $t = $var_list["t"]; - $ret = $this->ItemURL($t,FALSE,"l_add_favorite"); - break; - case "del_favorite_link": - /* - @field:link.del_favorite_link - @description:Returns a URL to remove this link from the user's favorites - @attrib:_template:tpl:Template URL should point to - */ - $t = $element->attributes["_template"]; - if(!strlen($t)) - $t = $var_list["t"]; - $ret = $this->ItemURL($t,FALSE,"l_del_favorite"); - break; - /* - @field:link.favorite_toggle - @description: Returns a link to set or reset the favorite flag for the current user - @attrib: _template:tpl:Template to link to if user has the FAVORITES permission (defaults to current template) - @attrib: _denytemplate:tpl: Template to link to if user does not have favorites permission (ie Guest) Defaults to current template - @attrib: _addlabel:lang:Language tag to display if link is to add favorite - @attrib: _addimage::Image url to include in link if adding favorite - @attrib: _dellabel:lang:Language tag to display if link is already a favorite - @attrib: _delimage::Image url to include in link if removing the favorite - */ - case "favorite_toggle": - - $catid = $this->GetPrimaryCategory(); - $unregister=false; - if($objSession->HasCatPermission("FAVORITES", $catid)) - { - $t = $element->GetAttributeByName('_template'); - } - else - { - $t = $element->GetAttributeByName('_denytemplate'); - RegisterEnv("dest", $element->GetAttributeByName('_denytemplate')); - $unregister = true; - } - -// echo "RES: ".$unregister; - - if(!strlen($t)) - $t = $var_list["t"]; - - if(!$this->IsFavorite($objSession->Get("PortalUserId"), $this->GetPrimaryCategory())) - { - $action = "l_add_favorite"; - if( $element->GetAttributeByName('_addlabel') ) - { - $label = language($element->attributes["_addlabel"]); - } - else - { - if(strlen($element->attributes["_addimage"])) - { - $result = MakeHTMLTag($element,'_img'); - $label = ''; - } - } - } - else - { - $action = "l_del_favorite"; - if(strlen($element->attributes["_dellabel"])) - { - $label = language($element->attributes["_dellabel"]); - } - else - { - if(strlen($element->attributes["_delimage"])) - { - $result = MakeHTMLTag($element,'_img'); - $label = ''; - } - } - } - - $action = $unregister? NULL : $action; - $ret = "ItemURL($t,FALSE,$action)."\">$label"; - - if ($unregister) - UnregisterEnv("dest"); - break; -/* - @field:link.hits - @description:Returns number of hits for item -*/ - case "hits": - $ret= round($this->Get("Hits")); - break; -/* - @field:link.votes - @description:Returns number of votes for item rating -*/ -/* - @field:link.cat_link - @description:Returns a URL setting the link to the current link and the link's category to the current category - @attrib:_template:tpl:Template URL should point to -*/ -/* - @field:link.link - @description:Returns a URL setting the link to the current link - @attrib:_template:tpl:Template URL should point to -*/ -/* - @field:link.rating - @description:Displays the links rating - @attrib:_displaymode:: How the rating should be displayed
    -
      -
    • "Numerical": Show the decimal value -
    • "Text": Show the text version -
    • "Graphical":Show images representing the rating -
    - @attrib:_onimage::on image tick shown in graphical display mode - @attrib:_offimage::off image tick shown in graphical display mode - @attrib:_separator::In graphical display mode, this html is placed between each tick image -*/ -/* - @field:link.reviews - @description:Return the number of reviews for think link - @attrib:_today:bool:Count reviews added today only -*/ -/* - @field:link.new - @description:returns text if link's status is "new" - @attrib:_label:lang: Text to return if status is new -*/ -/* - @field:link.pop - @description:returns text if link's status is "popular" - @attrib:_label:lang: Text to return if status is popular -*/ -/* - @field:link.hot - @description:returns text if link's status is "hot" - @attrib:_label:lang: Text to return if status is "hot" -*/ -/* - @field:link.pick - @description:returns text if link's status is "hot" - @attrib:_label:lang: Text to return if status is "hot" -*/ -/* - @field:link.custom - @description:Returns a custom field - @attrib:_customfield::field name to return - @attrib:_default::default value - @attrib:_listvalue::default value -*/ -/* - @field:link.category - @description:Return a category field from the link's category - @attrib:_cattag::Category field to parse -*/ -/* - @field:link.fullpath - @description:The full category path of the item -*/ -/* - @field:link.relevance - @description:Displays the link relevance in search results - @attrib:_displaymode:: How the relevance should be displayed
    -
      -
    • "Numerical": Show the decimal value -
    • "Bar": Show the HTML representing the relevance. Returns two HTML cells ≶td< with specified background colors -
    • "Graphical":Show image representing the relevance -
    - @attrib:_onimage::Zero relevance image shown in graphical display mode. Also used as prefix to build other images (i.e. prefix+"_"+percentage+".file_extension" - @attrib:_OffBackGroundColor::Off background color of HTML cell in bar display mode - @attrib:_OnBackGroundColor::On background color of HTML cell in bar display mode - -*/ - break; - - default: - unset($ret); - break; - } - - if(!isset($ret) || !strlen($ret) ) - { - $ret = parent::ParseObject($element); - } - } - else - $ret= "Undefined"; - return $ret; - } - - function parsetag($tag) - { - global $objConfig,$mytempdata, $rootURL, $var_list, $var_list_update, $l_var_list_update; - $ret=""; - //echo "test"; - switch($tag) - { - case "link_": - case "link_name": - $ret= $this->Get("Name"); - break; - case "link_desc": - $ret= $this->Get("Description"); - break; - case "link_url": - $ret = $this->Get("Url"); - break; - case "link_link": - $ret = $rootURL."in-link/inlink_redirect.php?env=". BuildEnv()."&linkid=".$this->Get("LinkId"); - break; - case "link_id": - $ret= $this->Get("LinkId"); - break; - case "link_date": - if($this->Get("CreatedOn")<=0) - return ""; - $ret = LangDate($this->Get('CreatedOn'), 0, true); - break; - - case "link_expire": - if($this->Get("Expire")<=0) - return ''; - $ret = LangDate($this->Get('Expire'), 0, true); - break; - - case "link_hits": - $ret=$this->Get("Hits"); - break; - case "link_hot": - if($this->IsHotItem()) - { - $ret="hot"; - } - else - $ret = ""; - break; - case "link_new": - if($this->IsNewItem()) - { - $ret="New"; - } - else - $ret = ""; - break; - case "link_pop": - if($this->IsPopItem()) - { - $ret = "pop"; - } - else - $ret = ""; - break; - case "link_pick": - if ($this->Get("EditorsPick")) - $ret="pick"; - break; - case "link_priority": - if($this->Get("Priority")!=0) - { - $ret = (int)$this->Get("Priority"); - } - else - $ret = ""; - break; - case "link_add_fav": - $var_list_update["t"] = "inlink/add_fav"; - $ret = HREF_Wrapper( Array('id' => $this->Get('LinkId') ) ); - unset($var_list_update["t"]); - break; - case "link_suggest_friend": - $var_list_update["t"] = "inlink/link_suggest"; - $ret= HREF_Wrapper( Array('id' => $this->Get('LinkId') ) ); - unset($var_list_update["t"]); - break; - - case "link_edit_link": - $l_var_list_update["id"]=$this->Get("LinkId"); - $var_list_update["t"] = "inlink/modify_link"; - $ret= HREF_Wrapper(); - unset($l_var_list_update["id"]); - unset($var_list_update["t"]); - break; - - case "link_rating_img": - $ret= "inlink/rating/".RatingImage($this->Get("CachedRating")).".gif"; - break; - case "link_votes": - $ret=$this->Get("CachedVotesQty"); - break; - case "link_reviews": - $ret= $this->Get("CachedReviewsQty"); - break; - case "link_rating": - $ret = round($this->Get("CachedRating"),1); - break; - case "link_resourceid": - $ret= $this->Get("ResourceId"); - break; - case "link_num_reviews": - $ret = $this->ReviewCount(); - break; - case "link_rating_txt": - return RatingText($this->Get("CachedRating")); - break; - default: - $ret= "Undefined:$tag"; - break; - } - return $ret; - } - - function isPending() - { - return $this->Get('Status') == -2 || $this->Get('Status') == 2; - } - -} /*clsLink*/ - -class _clsLinkList extends clsCatItemList -{ - function _clsLinkList() - { - global $l_var_list,$objSession; - - $this->clsCatItemList(); -// $this->clsItemCollection(); //call the parent constructor - $this->classname = "clsLink"; //class type for items - $this->SourceTable = GetTablePrefix()."Link"; - - $this->PageEnvarIndex = 'p'; - $this->PerPageVar = "Perpage_Links"; - $this->PageEnvar = "l_var_list_update"; - $this->Page = (int)$l_var_list["p"]; - - $this->AdminSearchFields = array("Name","Description","Url"); - $this->BasePermission = "LINK"; - - $this->PerPageVarLong = "Perpage_Links"; - $this->PerPageShortVar = "Perpage_Links_Short"; - $this->AddSortField("Link_SortField","Link_SortOrder"); - $this->AddSortField("Link_SortField2","Link_SortOrder2"); - - $this->ItemType = TYPE_LINK; - if( $objSession->HasSystemPermission("DEBUG.ITEM") ) $this->debuglevel = 1; - } - - function SqlMyItems($attribs= array()) - { - global $objSession; - - // pending modified links - $sql = 'SELECT OrgId, LinkId - FROM '.$this->SourceTable.' - WHERE (CreatedById = '.$objSession->Get('PortalUserId').') AND (OrgId > 0)'; - - $pending_modified = Array(); - $original_links = Array(); - $db =& GetADODBConnection(); - $rs = $db->Execute($sql); - while (!$rs->EOF) { - $pending_modified[] = $rs->fields['LinkId']; - $original_links[] = $rs->fields['OrgId']; - $rs->MoveNext(); - } - - $TableName = $this->SourceTable; - if ($pending_modified && $original_links) { - $where = " (".$TableName.".Status > -1 OR LinkId IN (".implode(',', $pending_modified).") ) AND (LinkId NOT IN (".implode(',', $original_links).")) AND ".$TableName.".CreatedById=".$objSession->Get("PortalUserId"); - } - else { - $where = " (".$TableName.".Status > -1) AND ".$TableName.".CreatedById=".$objSession->Get("PortalUserId"); - } - if(getArrayValue($attribs,'_today')) - { - $today = mktime(0,0,0,date("m"),date("d"),date("Y")); - $where .= " AND ($TableName.CreatedOn>=$today)"; - } - $CategoryTable = GetTablePrefix()."Category"; - $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $TableName "; - $p = $this->BasePermission.".VIEW"; - $sql .= $this->GetJoinedSQL($p,null,$where); // maybe null should be replaced by some CategoryId - - $OrderBy = $this->QueryOrderByClause(TRUE,TRUE,TRUE); - $sql .= " ".$OrderBy; - - return $sql; - } - - function &SetCurrentItem() - { - global $l_var_list; - - $this->CurrentItem = $l_var_list["id"]; - } - - - function LoadLinks($where="",$orderClause=NULL,$JoinCats=TRUE,$SkipCount=FALSE) - { - global $objConfig; - - $this->Clear(); - - if(!$SkipCount) - $this->QueryItemCount=TableCount($this->SourceTable,$where,$JoinCats); - - return $this->Query_Link($where,$orderClause,$JoinCats); - } - - function CountPending() - { - return TableCount($this->SourceTable,"Status=".STATUS_PENDING,0); - } - - function Query_Link($whereClause,$orderByClause=NULL,$JoinCats=TRUE) - { - global $objSession, $Errors; - - if($JoinCats) - { - $cattable = GetTablePrefix()."CategoryItems"; - $t = $this->SourceTable; - $CategoryTable = GetTablePrefix()."Category"; - $sql = "SELECT ".$this->SourceTable.".*,$CategoryTable.CategoryId as CategoryId,CachedNavBar FROM $t INNER JOIN $cattable ON $cattable.ItemResourceId=$t.ResourceId "; - $sql .= "INNER JOIN $CategoryTable ON ($CategoryTable.CategoryId=$cattable.CategoryId)"; - } - else - $sql = "SELECT * FROM ". $this->SourceTable; - if(trim($whereClause)!="") - { - if(isset($whereClause)) - $sql = sprintf('%s WHERE %s',$sql,$whereClause); - } - if (trim($orderByClause)!="") - { - if(isset($orderByClause)) - $sql = sprintf('%s ORDER BY %s',$sql,$orderByClause); - } - - if($objSession->HasSystemPermission("DEBUG.LIST")) - echo $sql."
    \n"; - return $this->Query_Item($sql,null); - } - - function SaveNewPage() - { - global $l_var_list; - $l_var_list["p"] = $this->Page; - } - - function ExpireItems() - { - $now = adodb_date("U"); - $sql = "UPDATE ".$this->SourceTable." SET Status=0 WHERE Expire<$now AND Expire != 0 AND Status=1"; - $this->adodbConnection->Execute($sql); - DeleteModuleTagCache('inlink'); - } - - function Delete_Item($Id, $DetectCategories = false) - { - $l = $this->GetItem($Id); - $link_id = $l->Get('LinkId'); - - $sql = "DELETE FROM ".GetTablePrefix()."LinkValidation WHERE LinkId = $link_id"; - $this->adodbConnection->Execute($sql); - - DeleteModuleTagCache('inlink'); - - return parent::Delete_Item($Id, $DetectCategories); - } - - function &Add_Link($CategoryId, $Name, $Description, $Url, $CreatedOn, $Expire, $Status, $EditorsPick, $NewItem, - $PopItem, $HotItem, $CreatedById, $Rating=0, $Votes=0, $Hits=0, $Priority=0, $auto_filename = 1, $filename = '') - { - global $objSession, $objConfig; - - $l = new clsLink(NULL); - $filename = $l->StripDisallowed($filename); - $l->BasePermission=$this->BasePermission; - $l->tablename = $this->SourceTable; - $l->Set(Array( 'Name', 'Description', 'Url', 'CreatedOn', 'Expire', 'Status', 'EditorsPick', 'NewItem', - 'PopItem', 'HotItem', 'CreatedById', 'CachedRating', 'CachedVotesQty', 'Hits', 'Priority', - 'AutomaticFilename', 'Filename'), - - Array( $Name, $Description, $Url, $CreatedOn, $Expire, $Status, $EditorsPick, $NewItem, - $PopItem, $HotItem, $CreatedById, $Rating, $Votes, $Hits, $Priority, $auto_filename, - $filename) ); - - $l->Create($Pending); - $ci_table = $objSession->GetEditTable( GetTablePrefix().'CategoryItems' ); - if ($l->TableExists($ci_table)) $l->AddToCategory($CategoryId, $ci_table, 1); - - $l->SendUserEventMail("LINK.ADD", $CreatedById); - $l->SendAdminEventMail("LINK.ADD"); - return $l; - } - - - function &Edit_Link($LinkId, $Name, $Description, $Url, $CreatedOn, $Expire, $Status, $EditorsPick, - $NewItem, $PopItem, $HotItem, $Rating, $Votes, $Hits, $Priority=0, $auto_filename = 1, $filename = '') - { - $l = $this->GetItem($LinkId); - $filename = $l->StripDisallowed($filename); - $l->BasePermission = $this->BasePermission; - if ( !$CreatedOn ) $CreatedOn = $l->Get('CreatedOn'); - if ( !is_numeric($Status) ) $Status = $l->Get('Status'); - - if( !is_numeric($EditorsPick) ) $EditorsPick = $l->Get('EditorsPick'); - - $l->Set(Array( 'Name', 'Description', 'Url', 'CreatedOn', 'Expire', 'Status', 'EditorsPick', 'NewItem', 'PopItem', - 'HotItem', 'CachedRating', 'CachedVotesQty', 'Hits', 'Priority', 'AutomaticFilename', 'Filename'), - Array( $Name, $Description, $Url, $CreatedOn, $Expire, $Status, $EditorsPick, $NewItem, $PopItem, - $HotItem, $Rating, $Votes, $Hits, $Priority, $auto_filename, $filename) ); - - $l->Update(); - $l->SendUserEventMail("LINK.MODIFY", $l->Get("ModifiedById")); - $l->SendAdminEventMail("LINK.MODIFY"); - return $l; - } - - function LoadListCategory($attribs=array()) - { - global $objCatList, $objSession, $objConfig, $content_set; - - $this->Clear(); - - $catid = (int)getArrayValue($attribs,'_catid'); - if(!$catid) - $catid = $objCatList->CurrentCategoryID(); - - if(!$catid && (int)$attribs["_useroot"]) - $catid = (int)$objConfig->Get("Link_Root"); - - if(!$objSession->HasCatPermission("LINK.VIEW", $catid)) - { - $content_set = 0; - $this->QueryItemCount = 0; - return 0; - } - - if($attribs["_shortlist"]) { - if ($objConfig->Get("Perpage_Links_Short") > 0) { - $this->PerPageVar = "Perpage_Links_Short"; - } - else { - $this->PerPageVar = "Perpage_Links"; - } - } - - $CatTable = GetTablePrefix()."CategoryItems"; - $t = $this->SourceTable; - $sql = "SELECT *,CategoryId FROM $t INNER JOIN $CatTable ON $CatTable.ItemResourceId=$t.ResourceId "; - - $where = "CategoryId=".$catid." AND Status=1"; - $sql .= "WHERE $where"; - - $OrderBy = $this->QueryOrderByClause($objConfig->Get("Link_ShowPick"), TRUE, TRUE); - $sql .= " ".$OrderBy; - - $this->QueryItemCount = TableCount($this->SourceTable,$where,TRUE); - - if($this->QueryItemCount>0) - { - return $this->Query_Item($sql); - } - else - return FALSE; - } - - function GetNewValue($CatId=NULL) - { - global $NewValues,$objConfig, $objSystemCache; - - if(is_numeric($NewValues["link"])) - { - return $NewValues["link"]; - } - else - { - $CachedValue = $objSystemCache->GetValue("LinkNewValue","inlink",""); - if(strlen($CachedValue)) - { - $NewValues["link"] = $CachedValue; - return $CachedValue; - } - - $ado = &GetADODBConnection(); - if ($CategoryId) - { - $days = (int)$objConfig->Get("Link_NewDays"); - $cutoffdate = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d")-$days,adodb_date("Y")); - $sql = "SELECT CreatedOn FROM ".GetTablePrefix()."Link INNER JOIN ".GetTablePrefix()."CategoryItems AS cat ON (".GetTablePrefix()."Link.ResourceId = cat.ItemResourceId) WHERE cat.CategoryId=$CategoryId AND CreatedOn>=$cutoffdate ORDER BY CreatedOn DESC "; - } - else - { - $days = (int)$objConfig->Get("Link_NewDays"); - $cutoffdate = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d")-$days,adodb_date("Y")); - $sql = "SELECT CreatedOn FROM ".GetTablePrefix()."Link WHERE CreatedOn>=$cutoffdate ORDER BY CreatedOn DESC "; - } - $rs = $ado->Execute($sql); - - $NewValues["link"] = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d")-$days,adodb_date("Y")); - - while($rs && !$rs->EOF) - { - $NewValues["link"] = $rs->fields["CreatedOn"]; - $rs->MoveNext(); - } - return $NewValues["link"]; - } - } - - function GetHotValue() - { - global $objConfig; - - $ado = &GetADODBConnection(); - $sql = "SELECT Hits FROM ".GetTablePrefix()."Link ORDER BY Hits DESC LIMIT 0,".$objConfig->Get("Link_VotesToHot"); - $rs = $ado->Execute($sql); - - $hot_val = 0; - while ($rs && !$rs->EOF) { - if ($rs->fields['Hits'] > 0) { - $hot_val = $rs->fields['Hits']; - } - $rs->MoveNext(); - } - - return $hot_val; - } - - function GetPopValue() - { - global $PopValues,$objConfig, $objSystemCache; - - if(is_numeric($PopValues["link"]) && $PopValues["link"] > 0) - { - return $PopValues["link"]; - } - else - { - $CachedValue = $objSystemCache->GetValue('LinkPopValue','inlink',''); - if(strlen($CachedValue) && $CachedValue > 0) - { - $PopValues['link'] = $CachedValue; - return $CachedValue; - } - else - { - $PopValues['link'] = $objConfig->Get('Link_TopCount'); - } - /*$ado = &GetADODBConnection(); - $sql = "SELECT CachedRating FROM ".GetTablePrefix()."Link WHERE CachedRating >= ".(int)$objConfig->Get("Link_TopCount")." ORDER BY Hits DESC"; - - $rs = $ado->Execute($sql); - $PopValues["link"] = 0; - while($rs && !$rs->EOF) - { - //echo $rs->fields["CachedRating"]."
    "; - $PopValues["link"] = $rs->fields["CachedRating"]; // this works fine? next value overwrites previous - $rs->MoveNext(); - }*/ - $objSystemCache->EditCacheItem('LinkPopValue',$PopValues['link'],'inlink',adodb_mktime()+3600,''); - //echo "PopValues: ".$PopValues["link"]."
    "; - return $PopValues['link']; - } - } -} /*clsLinkList*/ - -?> Index: branches/unlabeled/unlabeled-1.46.2/in-link/units/links/links_config.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.46.2/in-link/units/links/links_config.php (revision 12746) +++ branches/unlabeled/unlabeled-1.46.2/in-link/units/links/links_config.php (revision 0) @@ -1,350 +0,0 @@ - 'l', - 'ItemClass' => Array('class'=>'kCatDBItem','file'=>'','build_event'=>'OnItemBuild'), - 'ListClass' => Array('class'=>'kCatDBList','file'=>'','build_event'=>'OnListBuild'), - 'EventHandlerClass' => Array('class' => 'LinksEventHandler', 'file' => 'links_event_handler.php', 'require_classes' => Array('kCatDBEventHandler'), 'build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'LinkTagProcessor','file'=>'link_tag_processor.php', 'require_classes' => Array('kCatDBTagProcessor'), 'build_event'=>'OnBuild'), - 'AutoLoad' => true, - 'Hooks' => Array(), - 'QueryString' => Array( - 1 => 'id', - 2 => 'Page', - 3 => 'Reviews_Page', // depricated (for old in-link) - 4 => 'event', - ), - - 'IDField' => 'LinkId', - 'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events - - 'ItemType' => 4, - - 'StatisticsInfo' => Array( - 'pending' => Array( - 'icon' => 'icon16_link_pending.gif', - 'label' => 'la_Text_Links', - 'js_url' => "set_persistant_var('Link_View', 47, 'advanced_view', '#url#')", - 'url' => Array('t' => 'advanced_view', 'index_file' => 'advanced_view.php', 'SetTab' => 'links', 'pass' => 'm'), - 'status' => STATUS_PENDING, - ), - ), - - 'TitlePhrase' => 'la_Text_Link', // phrase used to specify item type in relationship list - - 'ViewMenuPhrase' => 'la_text_K4Links', - - 'CatalogSelectorName' => 'linklist', - - 'ItemPropertyMappings' => Array( - 'NewDays' => 'Link_NewDays', // number of days item to be NEW - 'VotesToPop' => 'Link_MinVotes', // minimum number of votes for an item to be POP - 'RatingToPop' => 'Link_RatingToPop', // minimum rating for an item to be POP - 'HotCount' => 'Link_TopCount', // number of top sellers (HOT) items - 'HotLimit' => 'Link_HotLimit', // variable name in inp_Cache table - - ), - - 'TitleField' => 'Name', - - 'TitlePresets' => Array( - 'default' => Array( 'new_status_labels' => Array('l'=>'!la_title_AddingLink!'), - 'edit_status_labels' => Array('l'=>'!la_title_EditingLink!'), - 'new_titlefield' => Array('l'=>'!la_title_NewLink!'), - ), - - 'links_edit' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_General!"), - - 'link_list'=>Array( 'prefixes' => Array('c_List', 'l_List'), - 'format' => "!la_title_Categories! (#c_recordcount#) - !la_title_Links! (#l_recordcount#)", - ), - 'link_edit'=>Array( 'prefixes' => Array('l'), - 'new_titlefield' => Array('l'=>'!la_title_NewLink!'), - 'format' => "#l_status# '#l_titlefield#' - !la_title_General!", - ), - - 'links_categories'=>Array('prefixes' => Array('l','l-ci_List'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Link_Categories!"), - 'links_relations'=> Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Link_Relations!"), - 'links_images' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Link_Images!"), - 'links_reviews' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Link_Reviews!"), - 'links_custom' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Link_Custom!"), - - 'images_edit' => Array( 'prefixes' => Array('l', 'l-img'), - 'new_status_labels' => Array('l-img'=>'!la_title_Adding_Image!'), - 'edit_status_labels' => Array('l-img'=>'!la_title_Editing_Image!'), - 'new_titlefield' => Array('l-img'=>'!la_title_New_Image!'), - 'format' => "#l_status# '#l_titlefield#' - #l-img_status# '#l-img_titlefield#'", - ), - - 'reviews_edit' => Array( 'prefixes' => Array('l', 'l-rev'), - 'new_status_labels' => Array('l-rev'=>"!la_title_Adding_Review! '!la_title_New_Review!'"), - 'edit_status_labels' => Array('l-rev'=>'!la_title_Editing_Review!'), - 'format' => "#l_status# '#l_titlefield#' - #l-rev_status#", - ), - - 'relations_edit' => Array( 'prefixes' => Array('l', 'l-rel'), - 'new_status_labels' => Array('l-rel'=>"!la_title_Adding_Relationship! '!la_title_New_Relationship!'"), - 'edit_status_labels' => Array('l-rel'=>'!la_title_Editing_Relationship!'), - 'format' => "#l_status# '#l_titlefield#' - #l-rel_status#", - ), - - 'links_export' => Array('format' => '!la_title_LinksExport!'), - - 'links_import' => Array('format' => '!la_title_ImportLinks!'), - - 'duplicate_links' => Array('prefixes' => Array('l.duplicates_List'), 'format' => "!la_title_DuplicateLinks! (#l.duplicates_recordcount#)"), - - 'tree_in-link' => Array('format' => '!la_Text_Version! '.$this->Application->findModule('Name', 'In-Link', 'Version')), - ), - - 'PermItemPrefix' => 'LINK', - - 'PermSection' => Array('main' => 'CATEGORY:in-link:links_list', 'search' => 'in-link:configuration_search', 'email' => 'in-link:configuration_email', 'custom' => 'in-link:configuration_custom'), - - 'Sections' => Array( - 'in-link' => Array( - 'parent' => 'in-portal:root', - 'icon' => 'settings_in-link', - 'label' => 'la_title_In-Link', - 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view'), - 'priority' => 3.1, - 'type' => stTREE, - ), - - 'in-link:inlink_general' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_general', - 'label' => 'la_tab_GeneralSettings', - 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 1, - 'type' => stTREE, - ), - - 'in-link:configuration_output' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_output', - 'label' => 'la_tab_ConfigOutput', - 'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 2, - 'type' => stTREE, - ), - - 'in-link:configuration_search' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_search', - 'label' => 'la_tab_ConfigSearch', - 'url' => Array('t' => 'config/config_search', 'module_key' => 'links', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 3, - 'type' => stTREE, - ), - - 'in-link:configuration_email' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_email', - 'label' => 'la_tab_ConfigE-mail', - 'url' => Array('t' => 'config/config_email', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 4, - 'type' => stTREE, - ), - - 'in-link:configuration_custom' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_custom', - 'label' => 'la_tab_ConfigCustom', - 'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 4, 'pass_section' => true, 'pass' => 'm,cf'), - 'permissions' => Array('view', 'add', 'edit', 'delete'), - 'priority' => 5, - 'type' => stTREE, - ), - - 'in-link:duplicate_checker' => Array( - 'parent' => 'in-link', - 'icon' => 'duplicate_checker', - 'label' => 'la_tab_DuplicateChecker', - 'url' => Array('t' => 'in-link/duplicate_checker', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit', 'delete'), - 'priority' => 6, - 'type' => stTREE, - ), - - 'in-link:validation_list' => Array( - 'parent' => 'in-link', - 'icon' => 'validate', - 'label' => 'la_tab_LinkValidation', - 'url' => Array('index_file' => '../in-link/admin/validation.php', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit'), - 'priority' => 7, - 'type' => stTREE, - ), - ), - - 'FilterMenu' => Array( - 'Groups' => Array( - Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_new'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_hot'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_pop'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_pick'), 'type' => WHERE_FILTER), - ), - 'Filters' => Array( - 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => 'Status != 1' ), - 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => 'Status != 2' ), - 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Status != 0' ), - 's1' => Array(), - 'show_new' => Array('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ), - 'show_hot' => Array('label' => 'la_Text_TopSellers', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ), - 'show_pop' => Array('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ), - 'show_pick' => Array('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '`EditorsPick` != 1' ), - ) - ), - - 'TableName' => TABLE_PREFIX.'Link', - - 'CalculatedFields' => Array( - '' => Array ( - 'UserName' => 'IF( LENGTH(u.Login), u.Login, "")', - 'CategoryId' => TABLE_PREFIX.'CategoryItems.CategoryId', - ), - ), - - 'AggregatedCalculatedFields' => Array( - - 'duplicates' => Array ( - 'DupeCount' => 'COUNT(*)', - ), - ), - - - 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'CategoryItems ON '.TABLE_PREFIX.'CategoryItems.ItemResourceId = %1$s.ResourceId - LEFT JOIN '.TABLE_PREFIX.'PermCache perm ON perm.CategoryId = '.TABLE_PREFIX.'CategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId - LEFT JOIN '.TABLE_PREFIX.'%3$sLinkCustomData cust ON %1$s.ResourceId = cust.ResourceId', - - ), // key - special, value - list select sql - - 'ListSortings' => Array( - '' => Array( - 'ForcedSorting' => Array('EditorsPick' => 'desc', 'Priority' => 'desc'), - 'Sorting' => Array('Name' => 'asc', 'Description' => 'desc'), - ) - ), - 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'CategoryItems ON '.TABLE_PREFIX.'CategoryItems.ItemResourceId = %1$s.ResourceId - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId - LEFT JOIN '.TABLE_PREFIX.'%3$sLinkCustomData cust ON %1$s.ResourceId = cust.ResourceId'), - - 'SubItems' => Array('l-rev', 'l-ci', 'l-rel', 'l-img', 'l-cdata'), - - 'Fields' => Array - ( - 'LinkId' => Array('type' => 'int','not_null' => '1','default' => ''), - 'Name' => Array('required'=>true, 'max_len'=>255), - 'Filename' => Array('type' => 'string','not_null' => '1','default' => ''), - 'AutomaticFilename' => Array('type' => 'int', 'not_null' => '1', 'default' => '1'), - 'Description' => Array('type' => 'string','default' => ''), - 'Url' => Array('type' => 'string','not_null' => '1', 'required' => 1, 'default' => ''), - 'CreatedOn' => Array('type' => 'double','formatter' => 'kDateFormatter', 'default'=>'#NOW#','not_null' => '1'), - 'Modified' => Array('type' => 'double','formatter' => 'kDateFormatter', 'default'=>'#NOW#','not_null' => '1'), - 'Expire' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'not_null' => '1','default' => ''), - 'Hits' => Array('type' => 'double', 'formatter'=>'kFormatter', 'format' => '%d', 'not_null' => true, 'default' => 0), - 'CachedRating' => Array('type' => 'string','default' => ''), - 'CachedVotesQty' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'CachedReviewsQty' => Array('type' => 'int','default' => ''), - 'CreatedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => '1','default' => '0'), - 'ModifiedById' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'Priority' => Array('type' => 'int','not_null' => '1','default' => '0'), - 'Status' => Array('type' => 'int', 'options' => Array ( 1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled' ), 'not_null' => 1, 'default' => 2 ), - 'EditorsPick' => Array('type' => 'int','default' => '0'), - 'ResourceId' => Array('type' => 'int', 'default' => '0'), - 'HotItem' => Array('options' => Array ( 2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never' ), 'not_null' => true, 'default' => 2 ), - 'PopItem' => Array('options' => Array ( 2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never' ), 'not_null' => true, 'default' => 2 ), - 'NewItem' => Array('options' => Array ( 2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never' ), 'not_null' => true, 'default' => 2 ), - 'OrgId' => Array('type' => 'int','default' => ''), - ), - - 'VirtualFields' => Array( - 'UserName' => Array('type' => 'string', 'default' => ''), - 'DupeCount' => Array('type' => 'string', 'default' => ''), - - // export related fields: begin - 'CategoryId' => Array('type' => 'int', 'default' => 0), - 'ExportFormat' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'CSV', /*2 => 'XML'*/), 'default' => 1), - 'ExportFilename' => Array('type' => 'string', 'default' => ''), - 'FieldsSeparatedBy' => Array('type' => 'string', 'default' => ','), - 'FieldsEnclosedBy' => Array('type' => 'string', 'default' => '"'), - 'LineEndings' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'Windows', 2 => 'UNIX'), 'default' => 1), - 'LineEndingsInside' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'CRLF', 2 => 'LF'), 'default' => 2), - 'IncludeFieldTitles' => Array('type' => 'int', 'default' => 1), - 'ExportColumns' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array()), - 'AvailableColumns' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array()), - 'CategoryFormat' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_MixedCategoryPath', 2 => 'la_SeparatedCategoryPath'), 'default' => 1), - 'CategorySeparator' => Array('type' => 'string', 'default' => ':'), - 'IsBaseCategory' => Array('type' => 'int', 'default' => 0), - // export related fields: end - - // import related fields: begin - 'FieldTitles' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Automatic', 2 => 'la_Manual'), 'default' => 1), - 'ImportSource' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Upload', 2 => 'la_Local'), 'default' => 2), - 'ImportFilename' => Array('type' => 'string', 'formatter' => 'kUploadFormatter', 'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => '/admin/export/'), - 'ImportLocalFilename' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'default' => ''), - 'CheckDuplicatesMethod' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_IDField', 2 => 'la_OtherFields'), 'default' => 1), - 'ReplaceDuplicates' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 0), - 'DuplicateCheckFields' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('Name' => 'NAME', 'Url' => 'URL'), 'default' => '|Name|Url|'), - 'SkipFirstRow' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'default' => 1), - // import related fields: end - - 'ThumbnailImage' => Array('type' => 'string', 'default' => ''), - 'FullImage' => Array('type' => 'string', 'default' => ''), - 'ImageAlt' => Array('type' => 'string', 'default' => ''), - ), - - 'Grids' => Array( - 'Default' => Array( - 'Icons' => Array(0 => 'icon16_link_disabled.gif', 1 => 'icon16_link.gif', 2 => 'icon16_link_pending.gif', 'HOT' => 'icon16_link_hot.gif', 'POP' => 'icon16_link_pop.gif', 'NEW' => 'icon16_link_new.gif', 'PICK' => 'icon16_link_pick.gif'), - 'Fields' => Array( - 'Name' => Array( 'title'=>'la_col_LinkName' , 'data_block' => 'grid_checkbox_td'), - 'Url' => Array( 'title'=>'la_col_LinkUrl' ), - 'Description' => Array( 'title'=>'la_col_Description' ), - 'Modified' => Array( 'title'=>'la_col_Modified' ), - ), - - ), - - - 'Duplicates' => Array( 'Icons' => Array('default' => 'icon16_link.gif'), - 'Fields' => Array( - 'Name' => Array( 'title'=>'la_col_LinkName' , 'data_block' => 'grid_checkbox_td'), - 'Url' => Array( 'title'=>'la_col_LinkUrl' ), - 'Description' => Array( 'title'=>'la_col_Description' ), - 'Modified' => Array( 'title'=>'la_col_Modified' ), - ), - - ), - ), - - - 'ConfigMapping' => Array( - 'PerPage' => 'Perpage_Links', - 'ShortListPerPage' => 'Perpage_Links_Short', - 'DefaultSorting1Field' => 'Link_SortField', - 'DefaultSorting2Field' => 'Link_SortField2', - 'DefaultSorting1Dir' => 'Link_SortOrder', - 'DefaultSorting2Dir' => 'Link_SortOrder2', - - ), - ); - - if (constOn('K4_LINKS')) { - $config['QueryString'][5] = 'mode'; - $config['Fields']['Name']['formatter'] = 'kMultiLanguage'; - $config['Fields']['Description']['formatter'] = 'kMultiLanguage'; - } -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.12/in-link/admin_templates/export_progress.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.12/in-link/admin_templates/export_progress.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.1.12/in-link/admin_templates/export_progress.tpl (revision 0) @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
    - - 0% -
    -
    - - - - - -
     
    -
    - " name="events[l.export][OnExportCancel]" /> -
    - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.12/in-link/admin_templates/import_progress.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.12/in-link/admin_templates/import_progress.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.1.12/in-link/admin_templates/import_progress.tpl (revision 0) @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
    - - 0% -
    -
    - - - - - -
     
    -
    - " name="events[l.import][OnExportCancel]" /> -
    - - - - Index: branches/unlabeled/unlabeled-1.61.2/in-link/units/links/links_config.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.61.2/in-link/units/links/links_config.php (revision 12746) +++ branches/unlabeled/unlabeled-1.61.2/in-link/units/links/links_config.php (revision 0) @@ -1,356 +0,0 @@ - 'l', - 'ItemClass' => Array('class'=>'kCatDBItem','file'=>'','build_event'=>'OnItemBuild'), - 'ListClass' => Array('class'=>'kCatDBList','file'=>'','build_event'=>'OnListBuild'), - 'EventHandlerClass' => Array('class' => 'LinksEventHandler', 'file' => 'links_event_handler.php', 'require_classes' => Array('kCatDBEventHandler'), 'build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'LinkTagProcessor','file'=>'link_tag_processor.php', 'require_classes' => Array('kCatDBTagProcessor'), 'build_event'=>'OnBuild'), - 'AutoLoad' => true, - 'Hooks' => Array(), - 'QueryString' => Array( - 1 => 'id', - 2 => 'Page', - 3 => 'Reviews_Page', // depricated (for old in-link) - 4 => 'event', - 5 => 'mode', - ), - 'CatalogItem' => true, - 'AdminTemplatePath' => 'links', - 'AdminTemplatePrefix' => 'links_', - 'IDField' => 'LinkId', - 'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events - - 'ItemType' => 4, - - 'StatisticsInfo' => Array( - 'pending' => Array( - 'icon' => 'icon16_link_pending.gif', - 'label' => 'la_Text_Links', - 'js_url' => '#url#', - 'url' => Array('t' => 'advanced_view', 'SetTab' => 'l', 'pass' => 'm,l.showall', 'l.showall_event' => 'OnSetFilterPattern', 'l.showall_filters' => 'show_active=0,show_pending=1,show_disabled=0,show_new=1,show_hot=1,show_pop=1,show_pick=1'), - 'status' => STATUS_PENDING, - ), - ), - - 'TitlePhrase' => 'la_Text_Link', // phrase used to specify item type in relationship list - - 'ViewMenuPhrase' => 'la_title_Links', - 'UsePendingEditing' => true, // item editing is controlled by LINK.ADD/EDIT, LINK.ADD/EDIT.PENDING permissions - - 'CatalogSelectorName' => 'linklist', // used in old catalog section - - 'ItemPropertyMappings' => Array( - 'NewDays' => 'Link_NewDays', // number of days item to be NEW - 'MinPopVotes' => 'Link_MinPopVotes', // minimum number of votes for an item to be POP - 'MinPopRating' => 'Link_MinPopRating', // minimum rating for an item to be POP - 'MaxHotNumber' => 'Link_MaxHotNumber', // maximum number of HOT items - - 'HotLimit' => 'Link_HotLimit', // variable name in inp_Cache table - 'ClickField' => 'Hits', // item click count is stored here (in item table) - ), - - 'TitleField' => 'Name', - - 'TitlePresets' => Array( - 'default' => Array( 'new_status_labels' => Array('l'=>'!la_title_AddingLink!'), - 'edit_status_labels' => Array('l'=>'!la_title_EditingLink!'), - 'new_titlefield' => Array('l'=>'!la_title_NewLink!'), - ), - - 'links_edit' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_General!"), - - 'link_list'=>Array( 'prefixes' => Array('c_List', 'l_List'), - 'format' => "!la_title_Categories! (#c_recordcount#) - !la_title_Links! (#l_recordcount#)", - ), - 'link_edit'=>Array( 'prefixes' => Array('l'), - 'new_titlefield' => Array('l'=>'!la_title_NewLink!'), - 'format' => "#l_status# '#l_titlefield#' - !la_title_General!", - ), - - 'links_categories'=>Array('prefixes' => Array('l','l-ci_List'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Categories!"), - 'links_relations'=> Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Relations!"), - 'links_images' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Images!"), - 'links_reviews' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Reviews!"), - 'links_custom' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Custom!"), - - 'images_edit' => Array( 'prefixes' => Array('l', 'l-img'), - 'new_status_labels' => Array('l-img'=>'!la_title_Adding_Image!'), - 'edit_status_labels' => Array('l-img'=>'!la_title_Editing_Image!'), - 'new_titlefield' => Array('l-img'=>'!la_title_New_Image!'), - 'format' => "#l_status# '#l_titlefield#' - #l-img_status# '#l-img_titlefield#'", - ), - - 'reviews_edit' => Array( 'prefixes' => Array('l', 'l-rev'), - 'new_status_labels' => Array('l-rev'=>"!la_title_Adding_Review! '!la_title_New_Review!'"), - 'edit_status_labels' => Array('l-rev'=>'!la_title_Editing_Review!'), - 'format' => "#l_status# '#l_titlefield#' - #l-rev_status#", - ), - - 'relations_edit' => Array( 'prefixes' => Array('l', 'l-rel'), - 'new_status_labels' => Array('l-rel'=>"!la_title_Adding_Relationship! '!la_title_New_Relationship!'"), - 'edit_status_labels' => Array('l-rel'=>'!la_title_Editing_Relationship!'), - 'format' => "#l_status# '#l_titlefield#' - #l-rel_status#", - ), - - 'links_export' => Array('format' => '!la_title_LinksExport!'), - - 'links_import' => Array('format' => '!la_title_ImportLinks!'), - - 'duplicate_links' => Array('prefixes' => Array('l.duplicates_List'), 'format' => "!la_title_DuplicateLinks! (#l.duplicates_recordcount#)"), - - 'tree_in-link' => Array('format' => '!la_Text_Version! '.$this->Application->findModule('Name', 'In-Link', 'Version')), - ), - - 'PermItemPrefix' => 'LINK', - - 'PermTabText' => 'In-Link', - 'PermSection' => Array('main' => 'CATEGORY:in-link:links_list', 'search' => 'in-link:configuration_search', 'email' => 'in-link:configuration_email', 'custom' => 'in-link:configuration_custom'), - - 'Sections' => Array( - 'in-link' => Array( - 'parent' => 'in-portal:root', - 'icon' => 'settings_in-link', - 'label' => 'la_title_In-Link', - 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view'), - 'priority' => 3.1, - 'type' => stTREE, - ), - - 'in-link:inlink_general' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_general', - 'label' => 'la_tab_GeneralSettings', - 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 1, - 'type' => stTREE, - ), - - 'in-link:configuration_output' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_output', - 'label' => 'la_tab_ConfigOutput', - 'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 2, - 'type' => stTREE, - ), - - 'in-link:configuration_search' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_search', - 'label' => 'la_tab_ConfigSearch', - 'url' => Array('t' => 'config/config_search', 'module_key' => 'links', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 3, - 'type' => stTREE, - ), - - 'in-link:configuration_email' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_email', - 'label' => 'la_tab_ConfigE-mail', - 'url' => Array('t' => 'config/config_email', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 4, - 'type' => stTREE, - ), - - 'in-link:configuration_custom' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_custom', - 'label' => 'la_tab_ConfigCustom', - 'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 4, 'pass_section' => true, 'pass' => 'm,cf'), - 'permissions' => Array('view', 'add', 'edit', 'delete'), - 'priority' => 5, - 'type' => stTREE, - ), - - 'in-link:duplicate_checker' => Array( - 'parent' => 'in-link', - 'icon' => 'duplicate_checker', - 'label' => 'la_tab_DuplicateChecker', - 'url' => Array('t' => 'in-link/duplicate_checker', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit', 'delete'), - 'priority' => 6, - 'type' => stTREE, - ), - - 'in-link:validation_list' => Array( - 'parent' => 'in-link', - 'icon' => 'validate', - 'label' => 'la_tab_LinkValidation', - 'url' => Array('index_file' => '../in-link/admin/validation.php', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit'), - 'priority' => 7, - 'type' => stTREE, - ), - ), - - 'FilterMenu' => Array( - 'Groups' => Array( - Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_new'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_hot'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_pop'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_pick'), 'type' => WHERE_FILTER), - ), - 'Filters' => Array( - 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), - 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ), - 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), - 's1' => Array(), - 'show_new' => Array('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ), - 'show_hot' => Array('label' => 'la_Text_Hot', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ), - 'show_pop' => Array('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ), - 'show_pick' => Array('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '%1$s.`EditorsPick` != 1' ), - ) - ), - - 'TableName' => TABLE_PREFIX.'Link', - - 'CalculatedFields' => Array( - '' => Array ( - 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.CreatedById = -1, "root", IF (%1$s.CreatedById = -2, "Guest", "n/a")), u.Login)', - 'CategoryId' => TABLE_PREFIX.'%3$sCategoryItems.CategoryId', - 'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename', - 'CategoryFilename' => TABLE_PREFIX.'Category.NamedParentPath', - ), - ), - - 'CacheModRewrite' => true, - - 'AggregatedCalculatedFields' => Array( - - 'duplicates' => Array ( - 'DupeCount' => 'COUNT(*)', - ), - ), - - - 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId - LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'PermCache perm ON perm.CategoryId = '.TABLE_PREFIX.'CategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId - LEFT JOIN '.TABLE_PREFIX.'%3$sLinkCustomData cust ON %1$s.ResourceId = cust.ResourceId', - - ), // key - special, value - list select sql - - 'ListSortings' => Array( - '' => Array( - 'ForcedSorting' => Array('EditorsPick' => 'desc', 'Priority' => 'desc'), - 'Sorting' => Array('Name' => 'asc', 'Description' => 'desc'), - ) - ), - 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId - LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId - LEFT JOIN '.TABLE_PREFIX.'%3$sLinkCustomData cust ON %1$s.ResourceId = cust.ResourceId'), - - 'SubItems' => Array('l-rev', 'l-ci', 'l-rel', 'l-img', 'l-cdata'), - - 'Fields' => Array ( - 'LinkId' => Array(), - 'Name' => Array('type' => 'string', /*'formatter' => 'kMultiLanguage',*/ 'not_null' => 1, 'required' => 1, 'max_len' => 255), - 'AutomaticFilename' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1), - 'Description' => Array('type' => 'string', /*'formatter' => 'kMultiLanguage',*/ 'default' => ''), - 'Url' => Array('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''), - 'CreatedOn' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'default' => '#NOW#', 'not_null' => 1), - 'Modified' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'default' => '#NOW#', 'not_null' => 1), - 'Expire' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'not_null' => 1,'default' => ''), - 'Hits' => Array('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0), - 'CachedRating' => Array('type' => 'string', 'default' => '0'), - 'CachedVotesQty' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), - 'CachedReviewsQty' => Array('type' => 'int', 'default' => ''), - 'CreatedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => -1), - 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => -1), - 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => ''), - 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), - 'EditorsPick' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), - 'ResourceId' => Array('type' => 'int', 'default' => ''), - 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'OrgId' => Array('type' => 'int', 'default' => ''), - ), - - 'VirtualFields' => Array( - 'UserName' => Array('type' => 'string', 'default' => ''), - 'DupeCount' => Array('type' => 'string', 'default' => ''), - - // export related fields: begin - 'CategoryId' => Array('type' => 'int', 'default' => 0), - 'ExportFormat' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'CSV', /*2 => 'XML'*/), 'default' => 1), - 'ExportFilename' => Array('type' => 'string', 'default' => ''), - 'FieldsSeparatedBy' => Array('type' => 'string', 'default' => ','), - 'FieldsEnclosedBy' => Array('type' => 'string', 'default' => '"'), - 'LineEndings' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'Windows', 2 => 'UNIX'), 'default' => 1), - 'LineEndingsInside' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'CRLF', 2 => 'LF'), 'default' => 2), - 'IncludeFieldTitles' => Array('type' => 'int', 'default' => 1), - 'ExportColumns' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array()), - 'AvailableColumns' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array()), - 'CategoryFormat' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_MixedCategoryPath', 2 => 'la_SeparatedCategoryPath'), 'default' => 1), - 'CategorySeparator' => Array('type' => 'string', 'default' => ':'), - 'IsBaseCategory' => Array('type' => 'int', 'default' => 0), - // export related fields: end - - // import related fields: begin - 'FieldTitles' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Automatic', 2 => 'la_Manual'), 'default' => 1), - 'ImportSource' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Upload', 2 => 'la_Local'), 'default' => 2), - 'ImportFilename' => Array('type' => 'string', 'formatter' => 'kUploadFormatter', 'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => '/admin/export/'), - 'ImportLocalFilename' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'default' => ''), - 'CheckDuplicatesMethod' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_IDField', 2 => 'la_OtherFields'), 'default' => 1), - 'ReplaceDuplicates' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 0), - 'DuplicateCheckFields' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('Name' => 'NAME', 'Url' => 'URL'), 'default' => '|Name|Url|'), - 'SkipFirstRow' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'default' => 1), - // import related fields: end - - 'ThumbnailImage' => Array('type' => 'string', 'default' => ''), - 'FullImage' => Array('type' => 'string', 'default' => ''), - 'ImageAlt' => Array('type' => 'string', 'default' => ''), - - 'Filename' => Array('type' => 'string','not_null' => 1,'default' => ''), - 'CachedNavbar' => Array('type' => 'string', 'default' => ''), - ), - - 'Grids' => Array( - 'Default' => Array( - 'Icons' => Array(0 => 'icon16_link_disabled.gif', 1 => 'icon16_link.gif', 2 => 'icon16_link_pending.gif', -2 => 'icon16_link_pending.gif', 'HOT' => 'icon16_link_hot.gif', 'POP' => 'icon16_link_pop.gif', 'NEW' => 'icon16_link_new.gif', 'PICK' => 'icon16_link_pick.gif'), - 'Fields' => Array( - 'Name' => Array( 'title'=>'la_col_LinkName' , 'data_block' => 'grid_checkbox_td'), - 'Url' => Array( 'title'=>'la_col_LinkUrl' ), - 'Description' => Array( 'title'=>'la_col_Description' ), - 'Modified' => Array( 'title'=>'la_col_Modified' ), - ), - - ), - - - 'Duplicates' => Array( 'Icons' => Array('default' => 'icon16_link.gif'), - 'Fields' => Array( - 'Name' => Array( 'title'=>'la_col_LinkName' , 'data_block' => 'grid_checkbox_td'), - 'Url' => Array( 'title'=>'la_col_LinkUrl' ), - 'Description' => Array( 'title'=>'la_col_Description' ), - 'Modified' => Array( 'title'=>'la_col_Modified' ), - ), - - ), - ), - - - 'ConfigMapping' => Array( - 'PerPage' => 'Perpage_Links', - 'ShortListPerPage' => 'Perpage_Links_Short', - 'DefaultSorting1Field' => 'Link_SortField', - 'DefaultSorting2Field' => 'Link_SortField2', - 'DefaultSorting1Dir' => 'Link_SortOrder', - 'DefaultSorting2Dir' => 'Link_SortOrder2', - ), - ); -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.1.82/in-link/admin/include/toolbar/editlink_review.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.82/in-link/admin/include/toolbar/editlink_review.php (revision 12746) +++ branches/unlabeled/unlabeled-1.1.82/in-link/admin/include/toolbar/editlink_review.php (revision 0) @@ -1,59 +0,0 @@ - - - - -END; -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.32.2/in-link/admin/import/inlink_import.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.32.2/in-link/admin/import/inlink_import.php (revision 12746) +++ branches/unlabeled/unlabeled-1.32.2/in-link/admin/import/inlink_import.php (revision 0) @@ -1,919 +0,0 @@ -GetVariable('import_category_id'); - -if ( isset($_POST['Action']) && $_POST['Action'] == 'Import') -{ - $objSession->SetVariable('import_user_admin',$_POST['user_admin']); - $objSession->SetVariable('import_user_regular',$_POST['user_regular']); - $objSession->SetVariable('image_name',$_POST['link_image']); - - $objSession->SetVariable('importtodo','initialize'); - $objSession->SetVariable('importstart',0); - $objSession->SetVariable('importtotal',0); - - if((int)$_POST['init_cat'] > 0) - { - $c = $objCatList->GetItemByField('CategoryId', $root_cat_id); - $c->UpdateACL(); - $c->UpdateCachedPath(); - } - - -} -$allgroups = $objGroups->GetAllGroupList(); - -// connection related -$inlink_sql_type = $objSession->GetVariable('import_sql_type'); -$inlink_server = $objSession->GetVariable('import_server'); -$inlink_db = $objSession->GetVariable('import_db'); -$inlink_user = $objSession->GetVariable('import_user'); -$inlink_pass = $objSession->GetVariable('import_pass'); - -// import related -$user_admin = $objSession->GetVariable('user_admin_values'); -$user_regular = $objSession->GetVariable('user_regular_values'); - -if( !isset($c) || !is_object($c) && $root_cat_id ) -$c = $objCatList->GetItemByField('CategoryId', $root_cat_id); - -$image_name=$objSession->GetVariable('image_name'); -$start = $objSession->GetVariable('importstart'); - -$init_cat = $root_cat_id ? $c->Get('CategoryId') : 0; - -//In-Portal -$portalconn = &GetADODBConnection(); - -if( $init_cat == 0) -{ - /*$prefix = GetTablePrefix(); - $sql = 'SELECT ACL - FROM '.$prefix.'PermCache pc, '.$prefix.'Permissions p - WHERE p.PermissionId = pc.PermId AND p.CategoryId = 0 AND p.Permission = \'CATEGORY.VIEW\''; - $acl = $portalconn->GetCol($sql);*/ - $acl = Array(0 => 0); -} -else -{ - $acl = explode(',',$c->GetACL('CATEGORY.VIEW')); -} - -//IN-LINK connection -$linkconn = &ADONewConnection($inlink_sql_type); -$linkconn->NConnect($inlink_server, $inlink_user, $inlink_pass, $inlink_db); - -if(!$linkconn) -{ - $ret = "Database connection failed. DB Type: $sql_type, DB Server: $inlink_server, DB User: $inlink_user, DB Name: $inlink_db"; - $ret .= $linkconn->ErrorMsg(); - $application =& kApplication::Instance(); - $application->ApplicationDie($ret); -} - -//admin only util -$pathtolocal = $pathtoroot.'kernel/'; -require_once ($pathtoroot.'admin/include/elements.php'); -require_once ($pathtoroot.'kernel/admin/include/navmenu.php'); -require_once ($pathtolocal.'admin/include/navmenu.php'); -require_once($pathtoroot.'admin/toolbar.php'); -//Set Section -$section = 'in-portal:inlink_inport'; -//Set Environment Variable -$envar = 'env=' . BuildEnv(); - -$sec = $objSections->GetSection($section); -$objCatToolBar = new clsToolBar(); - -$title = admin_language('la_performing_import').' - '.admin_language('la_Step').' 4'; - - - -$TablePrefix = 'ses_'.$objSession->GetSessionKey().'_'.GetTablePrefix(); - -$olddbname=$inlink_db; -//$newdbname='inportal'; -$newdbname=$g_DBName; -##############creating a temproary table have to be here - -if( GetVar('Action', true) == 'Import' ) -{ - $portalconn->Execute('DROP TABLE IF EXISTS '.$TablePrefix.'import'); - $portalconn->Execute('DROP TABLE IF EXISTS '.$TablePrefix.'importcat'); - $temptable = 'CREATE TABLE '.$TablePrefix.'import (otname varchar(40), oid int(11), ocustomid int(11), oparentid int(11), ntname varchar(40), nid int(11), nrid int(11), npid int(11)) '; - - $portalconn->Execute($temptable); - $cattable ='CREATE TABLE '.$TablePrefix.'importcat (op int(11), np int(11), flag int(11)) '; - $portalconn->Execute($cattable); - $newcat = 1; -} - -global $admin, $pathtoroot; - -require_once ($pathtoroot.'in-link/'.$admin.'/import/status.php'); #for status bar and all visual effects - -$todo= $objSession->GetVariable('importtodo'); - -$total = $objSession->GetVariable('importtotal'); -switch ($todo) -{ - case 'users': - status($start, $total, 'users'); - usersimport(); - //setstart(0,'cats'); #for debugging - break; - case 'cats': - status($start, $total, 'cats'); - catmanager(); - //setstart(0,'links'); #for debugging - break; - case 'links': - status($start, $total, 'links'); - linksimport(); - //setstart(0,'custom');#For debugging only - break; - case 'custom': - status($start, $total, 'custom'); - - customimport(); - //setstart(0,'relcat');#for debuggin only - break; - - case 'relcat': - status($start, $total, 'relcat'); - relcatimport(); - //setstart(0,'terminate'); #for debuggin only - break; - case 'terminate': - terminator(); - status(1,1,'terminate'); - break; - default: - status(0,0,'initializing'); - setstart(0,'users'); #to start importing from users first - break; -} - -function terminator() -{ - global $portalconn, $TablePrefix, $adminURL, $objSession; - $query='DROP TABLE IF EXISTS '.$TablePrefix.'import, '.$TablePrefix.'importcat'; - $portalconn->Execute($query); - - $objSession->SetVariable('PermCache_UpdateRequired', 1); - $objSession->SetVariable('ReturnScript', 'index.php'); // redirect to catalog when finished - m_ParseEnv(); // sets default values to "m" prefix, because it is not passed through import anymore - - $application =& kApplication::Instance(); - $finish_url = $application->HREF('categories/cache_updater', '', Array('continue' => 1, 'no_amp' => 1), 'index.php'); - echo ''; -} - -function reload() -{ - //global $newurl; - print ''; -} -function setstart($mystart, $part) -{ - global $objSession; - - $objSession->SetVariable('importstart',$mystart); - $objSession->SetVariable('importtodo',$part); - reload(); -} -function settotal($total) -{ - global $objSession; - $objSession->SetVariable('importtotal',$total); -} - -//users import from inlink to inportal -function usersimport() -{ - global $objUsers, $objSession, $linkconn, $portalconn, $olddbname, - $user_admin,$objGroups, $user_regular, $start, $TablePrefix; - - $counter = 0; - $limit = 350; - $oldtablename = 'inl_users'; - $newtablename = $objUsers->SourceTable; - if ($start == 0) - { - $query='select count(*) as NumUsers from inl_users'; - $row =$linkconn->Execute($query); - if ($row && !$row->EOF) - { - settotal($row->fields['NumUsers']); - - } - } - $query="select * from inl_users LIMIT $start, $limit"; - $row =$linkconn->Execute($query); - while($row && !$row->EOF) - { - $counter++; #needed to know when close to time out - - if ($row->fields['user_name'] != 'root') { - $olduserid=$row->fields['user_id']; - //$Login, $Password, $Email, $CreatedOn, $FirstName='', $LastName='', $Status=2, - // $Phone='', $Street='', $City='', $State='', $Zip='', $Country='' - - if($row->fields['user_status']==1) - { - $Status=1; - } - else - { - if($row->fields['user_pend']==0) - { - $Status=2; - } - else - $Status=0; - } - $u = $objUsers->Add_User( $row->fields['user_name'], $row->fields['user_pass'], $row->fields['email'], - $row->fields['user_date'], $row->fields['first'], $row->fields['last'], - $Status); - $oldid=$row->fields['user_id']; - $oldcustom = $row->fields['user_cust']; - $newid = $u->Get('PortalUserId'); - $resid = $u->Get('ResourceId'); - #adding user to usergroup - - $userpermission = $row->fields['user_perm']; - if ($userpermission==2 || $userpermission==1) - { - $glist = explode(',',$user_admin); - $Primary=1; - for($i=0;$iGetItem($glist[$i]); - $group->AddUser($newid,$Primary,false); - $Primary = 0; - } - } - else - { - $glist = explode(',',$user_regular); - $Primary=1; - for($i=0;$iGetItem($glist[$i]); - $group->AddUser($newid,$Primary,false); - $Primary = 0; - } - } - //$group=$objGroups->GetItem($g); - //$group->AddUser($newid,1); - - #inserting values to the temproary table - $totemp = 'INSERT INTO '.$TablePrefix.'import (otname,oid,ocustomid,oparentid,ntname,nid,nrid,npid) '; - $tovalues= " VALUES ('$oldtablename',$olduserid,$oldcustom,0,'$newtablename', $newid, $resid, 0 )"; - $totemp=$totemp.$tovalues; - $portalconn->Execute($totemp); - } - $row->moveNext(); - } - if ($counter == $limit) - { - setstart($start+$limit, 'users'); - } - else - setstart(0,'cats'); - -} -//END OF USERS IMPORT ^^^^^^^^^^^^^^^^^^^^^ - -//Categories Import -function catmanager() -{ - global $portalconn, $init_cat,$start,$TablePrefix; - if ($start == 0) - { - $counter = catimport(0,$init_cat); - setstart($counter,'cats'); - $portalconn->Execute('UPDATE '.$TablePrefix.'importcat SET flag = 1 WHERE np = '.$init_cat); - } - else - { - - $query='select * from '.$TablePrefix.'importcat WHERE flag=0 LIMIT 0,1'; - $row =$portalconn->Execute($query); - if($row && !$row->EOF) - { - $oldid= $row->fields['op']; - $newid = $row->fields['np']; - $counter= catimport($oldid,$newid); - $query2='UPDATE '.$TablePrefix.'importcat SET flag = 1 WHERE op = '.$oldid.' AND np = '.$newid; - $portalconn->Execute($query2); - setstart($counter+$start-1,'cats'); - //$x=5; - } - else - { - setstart(0,'links'); - } - } -} -#pushes into the quque -function pushid($op,$np) -{ - global $linkconn, $portalconn, $TablePrefix; - $addnew = 'INSERT INTO '.$TablePrefix.'importcat (op,np,flag) VALUES ('.$op.','.$np.',0)'; - $portalconn->Execute($addnew); - -} -function checkifexist($id) -{ - global $linkconn; - $addnew = 'select * from inl_cats where cat_sub = '.$id; - $row =$linkconn->Execute($addnew); - if ($row && !$row->EOF) - { - - if ($row->fields['cat_id'] !=0) - { - return true; - } - else - { - return false; - } - } - else - { - return false; - } -} -#import itself -function catimport($oldparentid, $parentid) -{ - global $objCatList, $linkconn, $objUsers, $linkconn, $portalconn, - $olddbname, $user_admin,$objGroups, $user_regular, $acl,$allgroups, - $c, $start, $TablePrefix, $init_cat; - $counter=0; - - $objCacheCount = new clsCacheCountList(); - if ($start == 0) - { - $query='select count(*) as CatCount from inl_cats'; - $row =$linkconn->Execute($query); - if ($row && !$row->EOF) - { - settotal($row->fields['CatCount']); - $catcount = $row->fields['CatCount']; - - if( is_object($c) ) - { - $catcount += (int)$c->Get('CachedDescendantCatsQty'); - $c->Set('CachedDescendantCatsQty',$catcount); - $c->Update(); - } - - - } - } - - $query='select * from inl_cats WHERE cat_sub = '.$oldparentid; - $oldtablename = 'inl_cats'; - $newtablename = 'Category'; - $row =$linkconn->Execute($query); - if($row && !$row->EOF) - { - $RowCount = $row->NumRows(); - $ResInc = $RowCount; - $ResourceId = GetNextResourceId($ResInc); - } - if($parentid>0) - { - $ParentCat = new clsCategory($parentid); - $Path = $ParentCat->Get('ParentPath'); - } - else - { - global $objConfig; - $Path = prompt_language( $objConfig->Get('Root_Name') ); - } - while($row && !$row->EOF) - { - $counter++; - - if($row->fields['cat_pend'] == 1) - { - $Status = 2; - } - else - { - $Status = ($row->fields['cat_vis'] == 1) ? 1 : 0; - } - - $CreatedById = GetNewID( 'users', $row->fields['cat_id'] ); - - - $fields_hash = Array( 'ParentId' => $parentid, - $objCatList->TitleField => $row->fields['cat_name'], - $objCatList->DescriptionField => $row->fields['cat_desc'], - 'CreatedOn' => $row->fields['cat_date'], - 'EditorsPick' => (int)$row->fields['cat_pick'], - 'Status' => $Status, - 'HotItem' => 2, - 'NewItem' => 2, - 'PopItem' => 2, - 'Priority' => 0, - 'MetaKeywords' => $row->fields['meta_keywords'], - 'MetaDescription' => $row->fields['meta_desc'], - 'AutomaticFilename' => 1, - 'Filename' => '', - 'CategoryTemplate' => '', - 'CreatedById' => (int)$CreatedById, - 'CachedDescendantCatsQty' => (int)$row->fields['cat_cats'], - 'ResourceId' => $ResourceId, - ); - - $cat =& $objCatList->Add_NEW($fields_hash, true); - $ResourceId++; - - $FullPath = $Path.$cat->Get('CategoryId').'|'; - $cat->Set('ParentPath',$FullPath); - $cat->SetViewPerms('CATEGORY.VIEW',$acl,$allgroups); - $cat->SetViewPerms('LINK.VIEW',$acl,$allgroups); - $cat->Update(); - $cat->UpdateCachedPath(); - - $objCacheCount->CategoryId= $cat->Get('CategoryId'); - $objCacheCount->SetValue(0,0,0,0,0); - - $newid = $cat->Get('CategoryId'); - $resid = $cat->Get('ResourceId'); - $oldid = $row->fields['cat_id']; - $oldcustom = $row->fields['cat_cust']; - $oldpid = $row->fields['cat_sub']; - - #inserting values to the temproary table - $totemp = 'INSERT INTO '.$TablePrefix.'import (otname,oid,ocustomid,oparentid,ntname,nid,nrid,npid) '; - $tovalues= " VALUES ('$oldtablename',$oldid,$oldcustom,$oldpid,'$newtablename', $newid, $resid, $parentid )"; - $totemp=$totemp.$tovalues; - $portalconn->Execute($totemp); - - #pushes into the queue - if(checkifexist($oldid)) - { - pushid($oldid,$newid); - } - $row->moveNext(); - } - // disable lost+found category (if found one) - $tmp_cat = $objCatList->GetItemByField('Name','Lost+Found'); - if( is_object($tmp_cat) ) - { - $tmp_cat->Set('Status',0); - $tmp_cat->Update(); - } - return $counter; -} - -//Links Import -function linksimport() -{ - global $objLinkList, $init_cat, $linkconn, $portalconn, $olddbname, - $user_admin,$objGroups, $user_regular, $start, $TablePrefix; - $limit = 200; #need to change to a higher number like 100, forty is only for debugging - $counter = 0; - set_time_limit(0); - if ($start == 0) - { - $query = 'select count(*) as LinkCount from inl_lc'; - $row =$linkconn->Execute($query); - if ($row && !$row->EOF) - { - settotal($row->fields['LinkCount']); - - } - } - - // create index - what links are in what categories - $LimitClause = ' LIMIT '.$start.','.$limit; - $sql = 'SELECT link_id FROM inl_links ORDER BY link_id'.$LimitClause; - $LinkIDs = $linkconn->GetCol($sql); - - if( count($LinkIDs) > 0 ) - { - $LinkCatIndex = Array(); - $PendingLinks = Array(); - $sql = "SELECT * FROM inl_lc WHERE link_id IN (%s)"; - - $rs = $linkconn->Execute( sprintf($sql, implode(',', $LinkIDs) ) ); - while(!$rs->EOF) - { - $rec =& $rs->fields; - if( !isset($PendingLinks[ $rec['link_id'] ]) && $rec['link_pend'] == 1 ) - $PendingLinks[ $rec['link_id'] ] = 1; - - $LinkCatIndex[ $rec['link_id'] ][] = $rec['cat_id']; - $rs->MoveNext(); - } - } - - // get links - $query = 'SELECT * FROM inl_links ORDER BY link_id'.$LimitClause; // get links info - $row = $linkconn->Execute($query); // row is recordset here, not easy to figure out by variable name :( - if($row && !$row->EOF) - { - $RowCount = $row->NumRows(); - $ResInc = $RowCount; - $ResourceId = GetNextResourceId($ResInc); - } - - $get_cat_sql = "SELECT nid FROM %simport WHERE ntname = 'Category' AND oid = %s"; - - while($row && !$row->EOF) - { - $counter++; - $oldid = $row->fields['link_id']; - $flag = 1; - - $Pending = isset($PendingLinks[$oldid]); - - // create new link - - #gets the new user id of the user who created a link - if( !$row->fields['link_user'] ) - $newuserid = -1; - else - $newuserid = GetNewID('users', $row->fields['link_user'] ); - - #adds link to the IN-PORTAL - $link = new clsLink(); - $Status = ($Pending == 0) ? 1 : 2; - - $link->Set( array( 'Name', 'Description', 'Url', 'CreatedOn', 'Status', 'EditorsPick', - 'NewItem','PopItem','HotItem', 'CreatedById', 'CachedRating', - 'CachedVotesQty','Hits', 'Priority','Expire'), - array( $row->fields['link_name'], $row->fields['link_desc'], $row->fields['link_url'], $row->fields['link_date'], $Status, - $row->fields['link_pick'], 2, 2, 2, $newuserid, (int)$row->fields['link_rating'], - (int)$row->fields['link_votes'],(int)$row->fields['link_hits'], 0,$row->fields['link_expires'])); - - $link->Set('ResourceId',$ResourceId); - $ResourceId++; - $link->Create(); - - // add link to desired categories (add 1st category found as primary) - $cats = $LinkCatIndex[$oldid]; - $PrimaryCat = 1; - foreach($cats as $OldCatID) - { - $categoryid = $portalconn->GetOne( sprintf($get_cat_sql, $TablePrefix, $OldCatID) ); - $link->AddToCategory($categoryid, '', $PrimaryCat); - if($PrimaryCat) - { - $PrimaryCat = 0; - $oldcatid = $OldCatID; - } - } - - $newid = $link->Get('LinkId'); - $resid = $link->Get('ResourceId'); - $oldcustom = $row->fields['link_cust']; - $linkimage = $row->fields['link_image']; - - if($linkimage) addimage($resid,$linkimage); - - #calls to import reviews - reviewimport($link,$oldid,$resid); - - $totemp = 'INSERT INTO '.$TablePrefix.'import (otname,oid,ocustomid,oparentid,ntname,nid,nrid,npid) '; - $tovalues= " VALUES ('inl_links',$oldid,$oldcustom,$oldcatid,'link', $newid, $resid, 0 )"; - $totemp = $totemp.$tovalues; - $portalconn->Execute($totemp); - - #prelast while - $row->moveNext(); - } - - if ($counter == $limit) - { - setstart($start + $limit, 'links'); - } - else - { - $sql = 'UPDATE '.GetTablePrefix().'CategoryItems SET CategoryId = '.$init_cat.' WHERE CategoryId = 0 AND PrimaryCat = 1'; - $portalconn->Execute($sql); - setstart(0,'custom'); - } - -} - -#importing image from the in-link -function addimage($resourceid, $imageurl) -{ - global $objImageList, $image_name; - #echo "
    IMAGE RESOURCEID: $resourceid IMAGE URL: $imageurl
    "; - if(!is_object($objImageList)) - $objImageList = new clsImageList(); - - $LocalImage = 0; - $LocalThumb = 0; - if(!strlen($image_name)) - $image_name='inlink_image'; - - $img = $objImageList->Add($image_name,'',$resourceid, 0, 0,'', $imageurl, 1,0, 1, 0,1); -} -#Reviews Import for links -function reviewimport($myclass,$oldid,$rid) -{ - global $objCustomFieldList, $linkconn, $portalconn; - #ITEM AddReview($createdBy,$reviewText,0) - - $query='select * from inl_reviews where rev_link = '.$oldid; - $row =$linkconn->Execute($query); - while($row && !$row->EOF) - { - $oldreviewuser= $row->fields['rev_user']; - if($oldreviewuser !=0) #meaning was not created by guest - { - $newrid = GetNewID('users', $oldreviewuser); - if ($newrid) - { - $temp=$myclass->AddReview($newrid, $row->fields['rev_text'], $row->fields['rev_pend'], '127.0.0.1', 1, 'In-Link', $row->fields['rev_date']); - } - else - { - $temp=$myclass->AddReview(0, $row->fields['rev_text'], $row->fields['rev_pend'], '127.0.0.1', 1, 'In-Link', $row->fields['rev_date']); - } - } - else #meaning was created by guest - { - $temp=$myclass->AddReview(0, $row->fields['rev_text'], $row->fields['rev_pend'], '127.0.0.1', 1, 'In-Link', $row->fields['rev_date']); - } - $row->moveNext(); - } -} -#HELPER FUNCTION THAT GETS THE NEW ID of the USER - -/** -* @return int -* @param string $IDType -* @param int $OldID -* @desc Returns new id for specified record type ($IDType) with id ($OldID) -*/ -function GetNewID($IDType, $OldID) -{ - global $TablePrefix; - $get_id_sql = "SELECT nid FROM %simport WHERE otname = 'inl_%s' AND oid = %s"; - $db =&GetADODBConnection(); - $id = $db->GetOne( sprintf($get_id_sql, $TablePrefix, $IDType, $OldID) ); - return $id; -} - -//^^^^^^^^^^^^^^^^^^^^^^ABOVE IS LINKS IMPORT - - -#########################################Custom Fields Import -#create a new CustomField first and then -#by selecting all and receiving from one record of inl_config the values of cc1,cc2,cc3,cc4,cc5,cc6,uc1,uc2,uc3,uc4,uc5,uc6,lc1,lc2,lc3,lc4,lc5,lc6 -#go through all import table and if ocustomid occures get the row from inl_custom and -#create CustomMetaData field -#--------------------- -#Regarding CustomField: -#FieldName= cc1,cc2 .... from inl_config -#FieldLabel= value of cc1, cc2 .... -#Type=4 for links 6 for users 0 category -#------------ -#Regarding CustomMetaData -#ResourceId <= link id -#CustomFieldId <= id from the top -#Value = Value from the table custom - -//VVVVV BELOW ARE CUSTOM FIELD IMPORT REQUIRES TO HAVE A TEMPROARY TABLE IMPORT -function customimport() -{ - global $linkconn, $portalconn, $start, $TablePrefix; - $limit = 40; #just for debugging purposes, in real life set it to higher number - - if ($start == 0) { - $r = buildfields(); - $query = 'SELECT count(*) as cc from '.$TablePrefix.'import WHERE NOT ocustomid=0'; - $row = $portalconn->Execute($query); - if ($row && !$row->EOF) settotal($row->fields['cc']); - } - else { - $r = getfields(); - } - - $query = 'SELECT * from '.$TablePrefix.'import WHERE ocustomid != 0 limit '.$start.','.$limit; - $row = $portalconn->Execute($query); - $counter = 0; - - while ($row && !$row->EOF) { - $counter++; - loadcustom($row->fields['ocustomid'],$row->fields['nrid'],$row->fields['otname'],$r); - $row->moveNext(); - } - - if ($counter == $limit) { - setstart($start + $limit, 'custom'); - } - else { - // goto next step - setstart(0, 'relcat'); - } -} - -function loadcustom($customid,$rid,$tablename,$r) -{ - global $linkconn, $objCustomDataList, $objSession; - - $objCustomDataList->Clear(); - switch ($tablename) { - case 'inl_cats': - $SessionVar = 'custom_category'; - $prefix = 'c'; - break; - - case 'inl_users': - $SessionVar = 'custom_user'; - $prefix = 'u'; - break; - - case 'inl_links': - $SessionVar = 'custom_links'; - $prefix = 'l'; - break; - } - $fields = explode(',', $objSession->GetVariable($SessionVar) ); - - $query = 'select * from inl_custom Where cust_id = '.$customid; - $row = $linkconn->Execute($query); - if($row && $row->RecordCount() ) - { - for($x = 0; $x < count($fields); $x++) - { - $cust = $row->fields[ 'cust'.($x + 1) ]; - $fieldid = $r[ $fields[$x] ]; - $objCustomDataList->SetFieldValue($fieldid, $rid, $cust); - } - $objCustomDataList->SaveData($prefix, $rid); - } -} - -function buildfields() #building and populating an array -{ - global $objCustomFieldList, $objSession, $linkconn; - - $application =& kApplication::Instance(); - $ml_helper =& $application->recallObject('kMultiLanguageHelper'); - - // User Custom Fields: - $query = "SELECT * FROM inl_config WHERE name LIKE 'uc%'"; - $row = $linkconn->Execute($query); - $names = Array(); - while($row && !$row->EOF) - { - $data = $row->fields; - $fieldlabel = $data['name']; - if( strlen($data['value']) ) $fieldlabel = $data['value']; - //$f = $objCustomFieldList->AddField(6, $data['name'], $fieldlabel); - $f = $objCustomFieldList->AddField(6, $data['name'], $fieldlabel, 1, 'la_inlink', 'lu_fieldcustom__'.$data['name'], 'text', ''); - - $r[ $data['name'] ] = $f->Get('CustomFieldId'); // Save ID of created CustomField - $objSession->SetVariable('custom_'.$data['name'], $f->Get('CustomFieldId') ); // Save that ID to session - $names[] = $data['name']; - $row->MoveNext(); - } - $objSession->SetVariable('custom_user',implode(',',$names) ); // save list of user custom fields - $ml_helper->createFields('u-cdata', true); - unset($names); - - // Category Custom Fields: - $names = Array(); - $query = "SELECT * FROM inl_config WHERE name LIKE 'cc%'"; - $row = $linkconn->Execute($query); - while($row && !$row->EOF) - { - $data = $row->fields; - $fieldlabel = $data['name']; - if( strlen($data['value']) ) $fieldlabel = $data['value']; - // DT_USER, $pending_uf, '', 1, 'la_bb', 'lu_fieldcustom__'.$pending_uf, 'text', ''); - $f = $objCustomFieldList->AddField(1, $data['name'], $fieldlabel,1,'la_inlink', 'lu_fieldcustom__'.$data['name'], 'text', ''); - //$f = $objCustomFieldList->AddField(1, $data['name'], $fieldlabel); - - $r[ $data['name'] ] = $f->Get('CustomFieldId'); - $objSession->SetVariable('custom_'.$data['name'], $f->Get('CustomFieldId') ); - $names[] = $data['name']; - $row->MoveNext(); - } - $objSession->SetVariable('custom_category', implode(',',$names) ); - $ml_helper->createFields('c-cdata', true); - unset($names); - - // Links Custom Fields: - $names = Array(); - $query = "SELECT * FROM inl_config WHERE name LIKE 'lc%'"; - $row = $linkconn->Execute($query); - while($row && !$row->EOF) - { - $data = $row->fields; - $fieldlabel = $data['name']; - if( strlen($data['value']) ) $fieldlabel = $data['value']; - //$f = $objCustomFieldList->AddField(4, $data['name'], $fieldlabel); - $f = $objCustomFieldList->AddField(4, $data['name'], $fieldlabel,1,'la_inlink', 'lu_fieldcustom__'.$data['name'], 'text', ''); - $r[ $data['name'] ] = $f->Get('CustomFieldId'); - $objSession->SetVariable('custom_'.$data['name'], $f->Get('CustomFieldId') ); - $names[] = $data['name']; - $row->MoveNext(); - } - $objSession->SetVariable('custom_links', implode(',',$names) ); - $ml_helper->createFields('l-cdata', true); - return $r; -} - -function getfields() #building and populating an array -{ - global $objSession; - - $r = Array(); - $tmp_fields = explode(',', $objSession->GetVariable('custom_user') ); // Array(uc1,uc2,uc3,...) - foreach($tmp_fields as $tmp_name) $r[$tmp_name] = $objSession->GetVariable('custom_'.$tmp_name); - - $tmp_fields = explode(',', $objSession->GetVariable('custom_category') ); - foreach($tmp_fields as $tmp_name) $r[$tmp_name] = $objSession->GetVariable('custom_'.$tmp_name); - - $tmp_fields = explode(',', $objSession->GetVariable('custom_links') ); - foreach($tmp_fields as $tmp_name) $r[$tmp_name] = $objSession->GetVariable('custom_'.$tmp_name); - - return $r; -} - - -################################################Relationships Import - -function relcatimport() -{ - global $linkconn,$objSession, $start; - $limit = 100; - $counter =0; - if ($start == 0) - { - $query='SELECT count(*) from inl_rel_cats'; - $row =$linkconn->Execute($query); - if ($row && !$row->EOF) - { - settotal($row->fields[0]); - - } - } - - $objRelList = new clsRelationshipList(); - $query='select * from inl_rel_cats LIMIT '.$start.', '.$limit; - $row =$linkconn->Execute($query); - while($row && !$row->EOF) - { - $counter++; - $sourceid = newcatrid($row->fields['cat_id']); - $targetid = newcatrid($row->fields['rel_id']); - if ($sourceid !='' && $targetid !='') - { - $r = $objRelList->Add($sourceid, 1,$targetid, 1); - $r->Create(); - } - $row->moveNext(); - } - - if ($counter == $limit) - { - setstart($start + $limit, 'relcat'); - } - else - { - setstart(0,'terminate'); - } - -} -function newcatrid($oid) -{ - global $portalconn, $TablePrefix; - $query2='select * from '.$TablePrefix.'import where otname=\'inl_cats\' and oid = '.$oid; - $row =$portalconn->Execute($query2); - if ($row->fields['nrid']) - { - return $row->fields['nrid']; - } - else - { - return ''; - } -} -// END OF RELATIONSHIP IMPORT -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.32.2/in-link/units/listings/listings_event_handler.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.32.2/in-link/units/listings/listings_event_handler.php (revision 12746) +++ branches/unlabeled/unlabeled-1.32.2/in-link/units/listings/listings_event_handler.php (revision 0) @@ -1,722 +0,0 @@ - Array('self' => true), - - ); - $this->permMapping = array_merge($this->permMapping, $permissions); - } - - /** - * Adds selected link to listing - * - * @param kEvent $event - */ - function OnProcessSelected(&$event) - { - $object =& $event->getObject(); - - $selected_ids = $this->Application->GetVar('selected_ids'); - if ($selected_ids['l']) { - $link_id = $selected_ids['l']; - $sql = 'SELECT ResourceId - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE '.$this->Application->getUnitOption('l', 'IDField').' = '.$link_id; - - $object->SetDBField($this->Application->RecallVar('dst_field'), $this->Conn->GetOne($sql)); - $object->IgnoreValidation = true; - // $this->RemoveRequiredFields($object); - $object->Update(); - } - - $this->finalizePopup($event); - } - - function OnPreSaveListing(&$event) - { - $event->redirect=false; - $object =& $event->getObject( Array('skip_autoload' => true) ); - $object->IgnoreValidation = true; - // $this->RemoveRequiredFields($object); - $event->CallSubEvent('OnPreSave'); - $this->Application->SetVar($event->getPrefixSpecial(true).'_id', $object->GetId()); - return; - } - - function OnBeforeItemUpdate(&$event) - { - $object =& $event->getObject(); - if($object->IgnoreValidation) - { - $object->UpdateFormattersMasterFields(); - } - } - - function OnBeforeItemCreate(&$event) - { - $object =& $event->getObject(); - if($object->IgnoreValidation) - { - $object->UpdateFormattersMasterFields(); - } - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnBeforeDeleteFromLive(&$event) - { - $object =& $event->getObject(); - $sql = 'SELECT * FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ListingId = '.$object->GetId(); - $original_values = $this->Conn->GetRow($sql); - - $type_modified = ($object->GetDBField('ListingTypeId') != $original_values['ListingTypeId']); - $link_modified = ($object->GetDBField('ItemResourceId') != $original_values['ItemResourceId']); - $status_modified = ($object->GetDBField('Status') != $original_values['Status']); - - if($status_modified) - { - $email_event = $object->GetDBField('Status') ? 'LINK.ENHANCE.APPROVE' : 'LINK.ENHANCE.APPROVE'; - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser($email_event, $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin($email_event); - } - - if( $type_modified || $link_modified ) - { - $this->ResetLink($original_values); - } - - if( $status_modified || $type_modified || $link_modified ) - { - $this->EnhanceLink($object, $original_values); - } - - if( $status_modified && !($type_modified || $link_modified) ) - { - $this->ResetLink($original_values); - } - } - - function EnhanceLink(&$object, $original_values) - { - if ($object->GetDBField('Status') != STATUS_ACTIVE) { - return false; - } - - if ($object->GetDBField('ExpiresOn') < adodb_mktime()) { - $object->SetDBField('Status', STATUS_PENDING); - $object->Update(); - $this->ResetLink($original_values); - return false; - } - - $this->UpdateLink('OnPurchase', $object->GetDBField('ItemResourceId'), $object->GetDBField('ListingTypeId')); - - $listtype_object =& $this->Application->recallObject('lst'); - if( $listtype_object->GetDBField('OnPurchaseAddToCatEnabled') ) - { - $link_object =& $this->Application->recallObject('l'); - $add_to_cat = (int)$listtype_object->GetDBField('OnPurchaseAddToCat'); - $sql = 'DELETE FROM '.$this->Application->getUnitOption('l-ci', 'TableName').' - WHERE CategoryId = '.$add_to_cat.' - AND ItemResourceId = '.$link_object->GetDBField('ResourceId').' - AND PrimaryCat = 0'; - $this->Conn->Query($sql); - $sql = 'INSERT INTO '.$this->Application->getUnitOption('l-ci', 'TableName').' - (CategoryId, ItemResourceId, PrimaryCat) - VALUES ('.$add_to_cat.', '.$link_object->GetDBField('ResourceId').', 0)'; - $this->Conn->Query($sql); - } - } - - function ResetLink($original_values) - { - static $has_been_reset = Array(); - - if( $original_values['Status'] != STATUS_ACTIVE || - getArrayValue($has_been_reset, $original_values['ListingId']) ) - { - return; - } - - $has_been_reset[$original_values['ListingId']] = 1; - - $this->UpdateLink('OnExpire', $original_values['ItemResourceId'], $original_values['ListingTypeId']); - - $listtype_object =& $this->Application->recallObject('lst'); - if( $listtype_object->GetDBField('OnExpireRemoveFromCatEnabled') ) - { - $remove_from_cat = $listtype_object->GetDBField('OnExpireRemoveFromCat'); - $sql = 'DELETE FROM '.$this->Application->getUnitOption('l-ci', 'TableName').' - WHERE ItemResourceId = '.$original_values['ItemResourceId'].' - AND CategoryId = '.$remove_from_cat.' - AND PrimaryCat = 0'; - $this->Conn->Query($sql); - } - } - - function UpdateLink($action_prefix, $resource_id, $listtype_id) - { - - $link_object =& $this->Application->recallObject('l', null, Array('skip_autoload' => true)); - $link_object->Load($resource_id, 'ResourceId'); - - // "-item", because can be called as regular after event, and just "lst" recalls list instead - $listtype_object =& $this->Application->recallObject('lst.-item', null, Array('skip_autoload' => true)); - $listtype_object->Load($listtype_id); - - $action_fields = Array( 'EdPick' => 'EditorsPick', - 'New' => 'NewItem', - 'Hot' => 'HotItem', - 'Pop' => 'PopItem', - 'Status' => 'Status' - ); - // $action_prefix = 'OnPurchase'; - - foreach($action_fields as $action => $field) - { - $action_value = $listtype_object->GetDBField($action_prefix.$action); - if( $action_value != 3 ) - { - $link_object->SetDBField($field, $action_value); - } - } - - $priority_value = $listtype_object->GetDBField($action_prefix.'PriorityValue'); - switch( $listtype_object->GetDBField($action_prefix.'PriorityAction') ) - { - case 1: // equal - $link_object->SetDBField('Priority', $priority_value); - break; - case 2: // increase - $original_priority = $link_object->GetDBField('Priority'); - $link_object->SetDBField('Priority', $original_priority + $priority_value); - break; - case 3: // decrease - $original_priority = $link_object->GetDBField('Priority'); - $link_object->SetDBField('Priority', $original_priority - $priority_value); - break; - default: - } - - $link_object->Update(); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnRequestEnhancement(&$event) - { - if ($this->Application->isModuleEnabled('In-Commerce')) { - $l_info = $this->Application->GetVar('l'); - if (!$l_info) { - return false; - } - - list($link_id, $link_info) = each($l_info); - $listing_type_id = $link_info['ListingTypeId']; - - $listing_type =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing_type->Load($listing_type_id); - - if ($listing_type->GetDBField('EnableBuying')) { - $add_to_cart_event =& new kEvent('ord:OnAddVirtualProductToCart'); - $this->Application->HandleEvent($add_to_cart_event); - - if($add_to_cart_event->redirect) - { - $event->SetRedirectParam('pass', 'm'); - $event->redirect = $add_to_cart_event->redirect; - } - return true; - } - } - - $event->CallSubEvent('OnListingCreate'); - } - - /** - * Create listing or extend existing listing period - * - * @param kEvent $event - */ - function OnListingCreate(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - - switch ($event->Name) { - case 'EnhanceLinkAfterOrderApprove': - case 'EnhancedLinkOnCompleteOrder': - // when order with listing virtual product is approved - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $listing_type_id = $item_data['ListingTypeId']; - $link_id = $item_data['LinkId']; - - $new_processing = getArrayValue($item_data, 'HasNewProcessing'); - break; - - case 'OnListingCreate': - // when requesting enhancement from front (and not via in-commerce) - $links_info = $this->Application->GetVar('l'); - if (!$links_info) return false; - - $event->redirect = false; - list($link_id, $link_info) = each($links_info); - $listing_type_id = $link_info['ListingTypeId']; - - $new_processing = false; - break; - } - - // get resource_id of link beeing enhanced - $sql = 'SELECT ResourceId - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $resource_id = $this->Conn->GetOne($sql); - - // get listing by link's resource_id - $object->Load($resource_id, 'ItemResourceId'); - if ($object->isLoaded()) { - $original_values = $object->FieldValues; - } - else { - // set initial fields to listing - $object->SetDBField('ListingTypeId', $listing_type_id); - $object->SetDBField('ItemResourceId', $resource_id); - - if ($event->Name == 'OnListingCreate' || $new_processing) { - $item_status = STATUS_PENDING; - } - else { - $item_status = STATUS_ACTIVE; - } - - $object->SetDBField('Status', $item_status); - } - - // set date of purchase for new listings - $purchased_on = max(adodb_mktime(), $object->GetDBField('ExpiresOn')); - if (!$object->isLoaded()) { - $object->SetDBField('PurchasedOn_date', $purchased_on); - $object->SetDBField('PurchasedOn_time', $purchased_on); - } - - // set expiration time for listing - $listing_type =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing_type->Load($listing_type_id); - - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $listing_type->GetDBField('Duration'); - $duration_type = $listing_type->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $expiration_date = $purchased_on + $expiration_interval; - $object->SetDBField('ExpiresOn_date', $expiration_date); - $object->SetDBField('ExpiresOn_time', $expiration_date); - - // when extending enhancement mark listing as non-received renewal reminder - $object->SetDBField('RenewalReminderSent', 0); - - $action = $object->isLoaded() ? 'Update' : 'Create'; - if ($object->$action()) { - $event->status = erSUCCESS; - switch ($event->Name) { - case 'EnhanceLinkAfterOrderApprove': - case 'EnhancedLinkOnCompleteOrder': - // when order with listing virtual product is approved - if (getArrayValue($original_values, 'Status') != STATUS_ACTIVE) { - $this->EnhanceLink($object, Array()); - } - break; - - case 'OnListingCreate': - // when requesting enhancement from front (and not via in-commerce) - $event->redirect = $this->Application->GetVar('success_template'); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE'); - break; - } - - - } - else { - $event->status = erFAIL; - } - - - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function EnhancedLinkOnCompleteOrder(&$event) - { - // create enhancement, but pending - $this->OnListingCreate($event); - - // save created listing_id back to itemdata - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - unset($item_data['ListingTypeId']); - $item_data['ListingId'] = $object->GetID(); - - $orditems_idfield = $this->Application->getUnitOption('orditems', 'IDField'); - $orditems_table = $this->Application->getUnitOption('orditems', 'TableName'); - - $this->Conn->doUpdate( Array('ItemData' => serialize($item_data)), $orditems_table, $orditems_idfield.' = '.$fields['OrderItemId'] ); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function EnhanceLinkAfterOrderApprove(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - - if ( getArrayValue($item_data, 'HasNewProcessing') ) { - // new processing: just approve created listing here - $listing_id = $item_data['ListingId']; - $object->Load($listing_id); - - // moved enhancement period to time admin approved enhancement - $time_diff = adodb_mktime() - $object->GetDBField('PurchasedOn'); - $object->SetDBField('PurchasedOn_date', $object->GetDBField('PurchasedOn_date') + $time_diff); - $object->SetDBField('PurchasedOn_time', $object->GetDBField('PurchasedOn_time') + $time_diff); - $object->SetDBField('ExpiresOn_date', $object->GetDBField('ExpiresOn_date') + $time_diff); - $object->SetDBField('ExpiresOn_time', $object->GetDBField('ExpiresOn_time') + $time_diff); - - $object->SetDBField('Status', STATUS_ACTIVE); - $object->Update(); - - $this->EnhanceLink($object, Array()); - return true; - } - else { - // create listing & approve it at the same time - $this->OnListingCreate($event); - } - } - - /** - * Delete listing - * - * @param kEvent $event - */ - function EnhanceLinkAfterOrderDeny(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $listing_id = $item_data['ListingId']; - - $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); - $temp_handler->DeleteItems($event->Prefix, $event->Special, Array($listing_id)); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function ExpireLink(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$item_data['LinkId']; - $listing_id = $this->Conn->GetOne($sql); - $object->Load($listing_id); - $original_values = $object->FieldValues; - $object->SetDBField('Status', 2); - - if($object->Update()) - { - $event->status = erSUCCESS; - $this->ResetLink($original_values); - } - else - { - $event->status = erFAIL; - } - } - - function iterateItems(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $ids = $this->StoreSelectedIDs($event); - - if($event->Name == 'OnMassApprove') - { - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') != 1) - { - $original_values = $object->FieldValues; - $object->SetDBField('Status', 1); - $this->EnhanceLink($object, $original_values); - } - } - } - if($event->Name == 'OnMassDecline') - { - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') == 1) - { - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.DENY', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.DENY'); - } - } - } - parent::iterateItems($event); - if($event->Name == 'OnMassApprove') - { - $lst_object =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $ids = $this->getSelectedIDs($event); - if($ids) - { - foreach($ids as $id) - { - $object->Load($id); - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $owner_id = $this->Conn->GetOne($sql); - if($object->GetDBField('PendingRenewal') == 1) - { - $lst_object->Load( $object->GetDBField('ListingTypeId') ); - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $lst_object->GetDBField('Duration'); - $duration_type = $lst_object->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $renewal_begins = max( adodb_mktime(), $object->GetDBField('ExpiresOn') ); - $expiration_date = $renewal_begins + $expiration_interval; - - $object->SetDBField('ExpiresOn_date', $expiration_date); - $object->SetDBField('ExpiresOn_time', $expiration_date); - - $object->SetDBField('RenewalReminderSent', 0); - $object->SetDBField('PendingRenewal', 0); - - if( $object->Update() ) - { - $event->status=erSUCCESS; - $event->redirect_params = Array('opener' => 's'); //stay! - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.RENEW', $owner_id); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.RENEW'); - } - else - { - $event->status=erFAIL; - $event->redirect=false; - break; - } - } - else - { - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.APPROVE', $owner_id); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.APPROVE'); - } - } - } - } - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnCancel(&$event) - { - parent::OnCancel($event); - $event->SetRedirectParam('opener', 's'); - $event->redirect = $this->Application->GetVar('cancel_template'); - } - - function OnExtendEnhancement(&$event) - { - $link_id = $this->Application->GetVar('l_id'); - $sql = 'SELECT ResourceId FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $link_resource_id = $this->Conn->GetOne($sql); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$link_resource_id; - - $object =& $event->getObject( Array('skip_autoload' => true) ); - $object->Load( $this->Conn->GetOne($sql) ); - - $object->SetDBField('PendingRenewal', 1); - $object->Update(); - $event->redirect = $this->Application->GetVar('success_template'); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.EXTEND', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.EXTEND'); - } - - function OnCancelEnhancement(&$event) - { - $link_id = $this->Application->GetVar('l_id'); - $sql = 'SELECT ResourceId FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $link_resource_id = $this->Conn->GetOne($sql); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$link_resource_id; - - $object =& $this->Application->recallObject($event->Prefix, null, Array('skip_autoload' => true)); - $object->Load( $this->Conn->GetOne($sql) ); - $original_values = $object->FieldValues; - $original_values['Status'] = 1; - $this->ResetLink($original_values); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.CANCEL', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.CANCEL'); - - $object->Delete(); - $event->redirect = $this->Application->GetVar('success_template'); - } - - function OnCheckExpiredPaidListings(&$event) - { - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ExpiresOn < '.adodb_mktime().' AND Status = 1'; - $expired_listings = $this->Conn->GetCol($sql); - if(is_array($expired_listings) && count($expired_listings) > 0) - { - $object =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true)); - foreach($expired_listings as $listing_id) - { - $object->Load($listing_id); - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - $object->SetDBField('Status', 2); - $object->Update(); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.EXPIRE', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.EXPIRE'); - } - } - - $sql = 'SELECT ls.ListingId, l.CreatedById FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' ls - LEFT JOIN '.$this->Application->getUnitOption('lst', 'TableName').' lst - ON ls.ListingTypeId = lst.ListingTypeId - LEFT JOIN '.$this->Application->getUnitOption('l', 'TableName').' l - ON ls.ItemResourceId = l.ResourceId - WHERE ls.Status = 1 - AND ls.ExpiresOn < '.adodb_mktime().' + lst.RenewalReminder * 3600 *24 - AND ls.RenewalReminderSent = 0'; - $res = $this->Conn->Query($sql); - if(is_array($res) && count($res) > 0) - { - $listing_ids = Array(); - foreach($res as $record) - { - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.RENEWAL.NOTICE', $record['CreatedById']); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.RENEWAL.NOTICE'); - $listing_ids[] = $record['ListingId']; - } - $sql = 'UPDATE '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - SET RenewalReminderSent = 1 - WHERE ListingId IN ('.implode(',', $listing_ids).')'; - $this->Conn->Query($sql); - } - } - - function OnMassDelete(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $ids = $this->StoreSelectedIDs($event); - - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') == 1) - { - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - } - } - parent::OnMassDelete($event); - } - - /** - * Moves enhancement from original link to it's pending copy, that is going to be approved - * - * @param kEvent $event - */ - function OnMoveEnhancement(&$event) - { - $id_field = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'IDField'); - $item_table_name = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'TableName'); - - $pending_id = $event->MasterEvent->getEventParam('id'); - $original_id = $event->MasterEvent->getEventParam('original_id'); - - $sql = 'SELECT ResourceId, '.$id_field.' - FROM '.$item_table_name.' - WHERE '.$id_field.' IN ('.$pending_id.','.$original_id.')'; - $resource_ids = $this->Conn->GetCol($sql, $id_field); - - $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); - $sql = 'UPDATE '.$table_name.' - SET ItemResourceId = '.$resource_ids[$pending_id].' - WHERE ItemResourceId = '.$resource_ids[$original_id]; - $this->Conn->Query($sql); - } -} - -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.12.2/in-link/admin/include/navmenu.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.12.2/in-link/admin/include/navmenu.php (revision 12746) +++ branches/unlabeled/unlabeled-1.12.2/in-link/admin/include/navmenu.php (revision 0) @@ -1,131 +0,0 @@ -AddSection("in-link:editlink_general", "la_tab_General",NULL,"in-link/admin/", - "javascript:edit_submit('link','LinkEditStatus','in-link/admin/addlink.php',0);", - $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", - NULL, "in-portal:browse", NULL, "in-link:editlink_category",-1); - -$objSections->AddSection("in-link:editlink_category","la_tab_Categories", NULL, "in-link/admin/", - "javascript:edit_submit('link','LinkEditStatus','in-link/admin/addlink_category.php',0);", - $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", - NULL,"in-portal:browse",'in-link:editlink_general', "in-link:editlink_relations",-1); - -$objSections->AddSection("in-link:editlink_relations","la_tab_Relations", NULL, "in-link/admin/", - "javascript:edit_submit('link','LinkEditStatus','in-link/admin/addlink_relations.php',0);", - $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", - NULL,"in-portal:browse",'in-link:editlink_category', "in-link:editlink_images",-1); - -$objSections->AddSection("in-link:editlink_images", "la_tab_Images", NULL,"in-link/admin/", - "javascript:edit_submit('link','LinkEditStatus','in-link/admin/addlink_images.php',0);", - $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", - NULL,"in-portal:browse",'in-link:editlink_relations', "in-link:editlink_reviews",-1); - -$objSections->AddSection("in-link:editlink_reviews", "la_tab_Reviews", NULL,"in-link/admin/", - "javascript:edit_submit('link','LinkEditStatus','in-link/admin/addlink_reviews.php',0);", - $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", - NULL,"in-portal:browse",'in-link:editlink_images', 'in-link:editlink_custom',-1); - -$objSections->AddSection("in-link:editlink_custom", "la_tab_Custom",NULL, "in-link/admin/", - "javascript:edit_submit('link','LinkEditStatus','in-link/admin/addlink_custom.php',0);", - $admin."/icons/icon46_struct.gif", $admin."/icons/icon24_navigate.gif", - NULL,"in-portal:browse",'in-link:editlink_reviews',NULL,-1); - -/* link edit subitems */ -$objSections->AddSection("in-link:editlink_image","la_tab_Images","la_title_edit_link",$admin."/category/", - "javascript:edit_submit('link','LinkEditStatus','in-link/admin/addimage.php',0);", - $admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_navigate.gif", - NULL, NULL, NULL,NULL,-1); - -$objSections->AddSection("in-link:editlink_relation","la_tab_Relations","la_title_edit_link",$admin."/category/", - "javascript:edit_submit('link','LinkEditStatus','in-link/admin/addrelation.php',0);", - $admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_navigate.gif", - NULL, NULL, NULL,NULL,-1); - -$objSections->AddSection("in-link:editlink_review","la_tab_Reviews","la_title_edit_link",$admin."/category/", - "javascript:edit_submit('link','LinkEditStatus','in-link/admin/addreview.php',0);", - $admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_navigate.gif", - NULL, NULL, NULL,NULL,-1); - -/*inlink tree items */ - -// Load In-Link module to get it's version -$mod = $objModules->GetModule("In-Link"); -$ModVersion = $mod ? $mod->Get('Version') : ''; - -$objSections->AddSection("in-link","la_title_In-Link","la_title_In-Link", $admin."/","subitems.php", - "in-link/admin/images/icon46_settings_in-link.gif","in-link/admin/images/icon24_settings_in-link.gif", - NULL,"in-portal:modules",NULL,NULL,0,"",1, - NULL,NULL,NULL,"in-link/admin/images/icon46_list_settings_in-link.gif","la_Text_Version"," $ModVersion"); - -$objSections->AddSection("in-link:inlink_general", "la_tab_GeneralSettings","la_tab_General", - "in-link/admin/","config_general.php", - $admin."/icons/icon46_settings_general.gif",$admin."/icons/icon24_settings_general.gif", - NULL,"in-link", NULL,"in-link:configuration_output",0,"",1, - NULL,NULL,NULL,$admin."/icons/icon46_list_settings_general.gif", "la_updating_config"); - -$objSections->AddSection("in-link:configuration_output", "la_tab_ConfigOutput","la_tab_ConfigOutput", - $admin.'/index4.php?section=in-link:configuration_output&module=In-Link', 'kernel4:config/config_universal', - $admin."/icons/icon46_settings_output.gif",$admin."/icons/icon24_settings_output.gif", - NULL,"in-link", "in-link:inlink_general","in-link:configuration_search",0,"",1, - NULL,NULL,NULL,$admin."/icons/icon46_list_settings_output.gif","la_updating_config"); - -$objSections->AddSection("in-link:configuration_search","la_tab_ConfigSearch", "la_tab_ConfigSearch", - $admin.'/index4.php?module=In-Link§ion=in-link:configuration_search&module_key=links', - 'kernel4:config/config_search', - $admin."/icons/icon46_settings_search.gif",$admin."/icons/icon24_settings_search.gif", - NULL,"in-link", "in-link:configuration_output", "in-link:configuration_email",0,"",1, - NULL,NULL,NULL,$admin."/icons/icon46_list_settings_search.gif","la_updating_config"); - -$objSections->AddSection("in-link:configuration_email", "la_tab_ConfigE-mail", "la_tab_ConfigE-mail", $admin."/config/", - "module_email.php?&module=In-Link§ion=in-link:configuration_email&lpn=1", - $admin."/icons/icon46_settings_email.gif",$admin."/icons/icon24_settings_email.gif", - NULL,"in-link", "in-link:configuration_search", "in-link:configuration_custom",0,"",1, - NULL,NULL,NULL,$admin."/icons/icon46_list_settings_email.gif","la_updating_config"); - -$objSections->AddSection("in-link:configuration_custom","la_tab_ConfigCustom","la_tab_ConfigCustom",$admin.'/index4.php', - "kernel4:custom_fields/custom_fields_list:cf----4-", - $admin."/icons/icon46_settings_custom.gif",$admin."/icons/icon24_settings_custom.gif", - NULL, "in-link", "in-link:configuration_email", "in-link:validation_list", 0,"",1, - NULL,NULL,NULL,$admin."/icons/icon46_list_settings_custom.gif","la_updating_config"); - -/*$objSections->AddSection("in-link:validation_list","la_tab_LinkValidation","la_tab_LinkValidation","in-link/admin/", "validation.php?§ion=in-link:validation_list", - $admin."/icons/icon46_validate.gif", $admin."/icons/icon24_validate.gif", NULL, "in-link", "in-link:configuration_custom", null,0,"",1, - NULL,NULL,NULL,$admin."/icons/icon46_list_validate.gif");*/ - -$objSections->AddSection("in-link:validation_list","la_tab_LinkValidation","la_tab_LinkValidation","in-link/admin/", "validation.php?§ion=in-link:validation_list", - $admin."/icons/icon46_validate.gif", $admin."/icons/icon24_validate.gif", NULL, "in-link", "in-link:configuration_custom", "in-link:inlink_paid_listings",0,"",1, - NULL,NULL,NULL,$admin."/icons/icon46_list_validate.gif"); - -$objSections->AddSection("in-link:inlink_paid_listings", "la_tab_PaidListings","la_tab_PaidListings", - $admin.'/index4.php','kernel4:in-link/paid_listings/paid_listing_types_list', - $module_images.'/icons/icon46_paid_listings.gif',$module_images.'/icons/icon24_paid_listings.gif', - NULL,"in-link", "in-link:validation_list",NULL,0,"",1, - NULL,NULL,NULL,$module_images.'/icons/icon46_paid_listings.gif', "la_updating_config"); - -$objSections->SimpleSection('in-link','in-link:in-link','la_tab_InlinkImport','la_title_Help','in-link/admin/import/', - 'inlink_import.php',null,null,null,null); - - -$name = admin_language("lu_btn_NewLink"); - -$NewButtons[] = array( - "ImagePath" => $rootURL."in-link/admin/images/", - "Action" => "new_link", - "Alt" => $name, - "Tab" => defined('K4_LINKS') && K4_LINKS ? 'k4links' : 'links'); - -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.12.2/in-link/admin_templates/paid_listings/paid_listing_edit.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.12.2/in-link/admin_templates/paid_listings/paid_listing_edit.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.12.2/in-link/admin_templates/paid_listings/paid_listing_edit.tpl (revision 0) @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - "> - - - - - - - - - -
    Link Name: - - -  
    - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.12.2/in-link/admin_templates/duplicate_checker.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.12.2/in-link/admin_templates/duplicate_checker.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.12.2/in-link/admin_templates/duplicate_checker.tpl (revision 0) @@ -1,172 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - nobottomnotop"> - - - -
    - -
    -
    - - - - nobottomnotop"> - - - -
    - -
    - - - - - - - - - - - - " id="_" sequence=""> - - - - - - - - - - - - - - -
    "> - Link: (Duplicates: ) -
    - - - _Sort1" name="_Sort1" value=""> - _Sort1_Dir" name="_Sort1_Dir" value="asc"> -
    - - - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.5.8/themes/default/inlink/blocks/links/link_extend_confirm.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.5.8/themes/default/inlink/blocks/links/link_extend_confirm.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.5.8/themes/default/inlink/blocks/links/link_extend_confirm.tpl (revision 0) @@ -1,38 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - -
    -

    -
    -

    -
    - -
    - - - " /> - - - " /> - - - " /> -
    -
    \ No newline at end of file Index: branches/unlabeled/unlabeled-1.9.26/in-link/admin/validation.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.9.26/in-link/admin/validation.php (revision 12746) +++ branches/unlabeled/unlabeled-1.9.26/in-link/admin/validation.php (revision 0) @@ -1,361 +0,0 @@ -$value) -{ - $path = $pathtoroot. $value."admin/include/parser.php"; - if(file_exists($path)) - { - include_once($path); - } -} - -$action = "m_item_image"; -/* -------------------------------------- Section configuration ------------------------------------------- */ -$envar = "env=" . BuildEnv() . "&en=$en"; -$section = 'in-link:validation_list'; -$sec = $objSections->GetSection($section); -$title = admin_language("la_Text_Link_Validation"); - -$SortFieldVar = "LinksValidation_LV_Sortfield"; -$SortOrderVar = "LinksValidation_LV_Sortorder"; -$DefaultSortField = "ValidationTime"; -$PerPageVar = "Perpage_Validation"; -$CurrentPageVar = "Page_ValidationList"; -$CurrentFilterVar = "LinkValidation_View"; - -$ListForm = "validationlistform"; -$CheckClass = "LinkChecks"; -/* ------------------------------------- Configure the toolbar ------------------------------------------- */ -$objListToolBar = new clsToolBar(); -$objListToolBar->Set("section",$section); -$objListToolBar->Set("load_menu_func",""); -$objListToolBar->Set("CheckClass",$CheckClass); -$objListToolBar->Set("CheckForm",$ListForm); - -$listImages = array(); - -$script_name = $objSession->HasSystemPermission("SYSTEM_ACCESS.READONLY") ? 'validation' : 'run_validation'; -$objListToolBar->Add("continue_val", "la_ToolTip_ContinueValidation", $rootURL."in-link/admin/".$script_name.".php?".$envar,"swap('continue_val','toolbar/tool_validate_continue_f2.gif');", - "swap('continue_val', 'toolbar/tool_validate_continue.gif');", - "","tool_validate_continue.gif"); - -$objListToolBar->Add("refresh_val", "la_ToolTip_NewValidation",$rootURL."in-link/admin/".$script_name.".php?".$envar."&refresh=1","swap('refresh_val','toolbar/tool_validate_restart_f2.gif');", - "swap('refresh_val', 'toolbar/tool_validate_restart.gif');", - "","tool_validate_restart.gif"); - -$objListToolBar->Add("divider"); - -$objListToolBar->Add("check_val","la_ToolTip_ValidateSelected","#", "if ($CheckClass.itemChecked()) swap('check_val','toolbar/tool_validate_f2.gif');", - "if ($CheckClass.itemChecked()) swap('check_val', 'toolbar/tool_validate.gif');","if ($CheckClass.itemChecked()) $CheckClass.check_submit('run_validation', '');", - "tool_validate.gif",TRUE,TRUE); -$listImages[] = "$CheckClass.addImage('check_val','$imagesURL/toolbar/tool_validate.gif','$imagesURL/toolbar/tool_validate_f3.gif',1);\n"; - -$objListToolBar->Add("reset_val_status","la_ToolTip_ResetValidationStatus","#", "if ($CheckClass.itemChecked()) swap('reset_val_status','toolbar/tool_validate_reset_f2.gif');", - "if ($CheckClass.itemChecked()) swap('reset_val_status', 'toolbar/tool_validate_reset.gif');","if ($CheckClass.itemChecked()) $CheckClass.check_submit('validation', 'l_reset_val_status_sel');", "tool_validate_reset.gif",TRUE,TRUE); -$listImages[] = "$CheckClass.addImage('reset_val_status','$imagesURL/toolbar/tool_validate_reset.gif','$imagesURL/toolbar/tool_validate_reset_f3.gif',1);\n"; - -$objListToolBar->Add("app_sel_link_val","la_ToolTip_Enable","#","if ($CheckClass.itemChecked()) swap('app_sel_link_val','toolbar/tool_approve_f2.gif');", - "if ($CheckClass.itemChecked()) swap('app_sel_link_val', 'toolbar/tool_approve.gif');","if ($CheckClass.itemChecked()) $CheckClass.check_submit('validation', 'l_approve_val_link');", - "tool_approve.gif",FALSE,TRUE); -$listImages[] = "$CheckClass.addImage('app_sel_link_val','$imagesURL/toolbar/tool_approve.gif','$imagesURL/toolbar/tool_approve_f3.gif',1); "; - -$objListToolBar->Add("deny_sel_link_val","la_ToolTip_Deny","#","if ($CheckClass.itemChecked()) swap('deny_sel_link_val','toolbar/tool_decline_f2.gif');", - "if ($CheckClass.itemChecked()) swap('deny_sel_link_val', 'toolbar/tool_decline.gif');","if ($CheckClass.itemChecked()) $CheckClass.check_submit('validation', 'l_deny_val_link');", - "tool_deny.gif",FALSE,TRUE); -$listImages[] = "$CheckClass.addImage('deny_sel_link_val','$imagesURL/toolbar/tool_decline.gif','$imagesURL/toolbar/tool_decline_f3.gif',1); "; - -$objListToolBar->Add("del_sel_link_val","la_ToolTip_Delete","#", "if ($CheckClass.itemChecked()) swap('del_sel_link_val','toolbar/tool_delete_f2.gif');", - "if ($CheckClass.itemChecked()) swap('del_sel_link_val', 'toolbar/tool_delete.gif');","if ($CheckClass.itemChecked()) $CheckClass.check_submit('validation', 'l_delete_val_link');", - "tool_delete.gif",TRUE,FALSE); -$listImages[] = "$CheckClass.addImage('del_sel_link_val','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1);\n "; - -$objListToolBar->Add("divider"); - -$objListToolBar->Add("viewmenubutton", "la_ToolTip_View","#","swap('viewmenubutton','toolbar/tool_view_f2.gif'); ", - "swap('viewmenubutton', 'toolbar/tool_view.gif');", - "ShowViewMenu();","tool_view.gif"); - -$objListToolBar->AddToInitScript($listImages); - -/* ----------------------------------------- Set the View Filter ---------------------------------------- */ -$Img_AllValue = 7; -$Bit_Valid=1; -$Bit_Invalid=2; -$Bit_New=4; -$FilterLabels = array(); - -$FilterLabels[0] = admin_language("la_Text_Valid"); -$FilterLabels[1] = admin_language("la_Text_Invalid"); -$FilterLabels[2] = admin_language("la_Text_Not_Validated"); - -$ValView = $objConfig->Get($CurrentFilterVar); - -if(!is_numeric($ValView)) -{ - $ValView = $Img_AllValue; - $imgFilter = ''; -} -else -{ - if($ValView & $Bit_Valid) - $Filters[] = "val.ValidationStatus=1"; - - if($ValView & $Bit_Invalid) - $Filters[] = "val.ValidationStatus=2"; - - if($ValView & $Bit_New) - $Filters[] = "(val.ValidationStatus=0 OR val.ValidationStatus IS NULL)"; - - if(count($Filters)) - { - $imgFilter = implode(" OR ",$Filters); - } - else - $imgFilter = "LinkValidationId = -1"; -} - - - -/* ------------------------------------ Build the SQL statement to populate the list ---------------------------*/ - - -$sql = "SELECT (CASE WHEN (val.ValidationStatus IS NULL) THEN '".admin_language("la_Text_Not_Validated")."' ELSE ( ELT(val.ValidationStatus+1,'".admin_language("la_Text_Not_Validated")." ','".admin_language("la_Text_Valid")."', '".admin_language("la_Text_Invalid")." ')) END) as ValStatus, "; -$sql .="FROM_UNIXTIME(val.ValidationTime,'%m-%d-%Y') as ValidationTime, val.ValidationStatus as intValStatus, "; -$sql .="val.LinkValidationId as LinkValidationId, val.ValidationCode as ValidationCode, SUBSTRING(link.Name, 1, 30) as LinkName, "; -$sql .="CONCAT('', SUBSTRING(link.Url, 1, 30), '') as LinkUrl, "; -$sql .="FROM_UNIXTIME(link.CreatedOn,'%m-%d-%Y') as LinkCreatedOn, link.LinkId, link.Status "; - -$sql .="FROM ".$objLinkList->SourceTable." as link LEFT JOIN ".GetTablePrefix()."LinkValidation as val ON (link.LinkId=val.LinkId)"; - - -$order = trim($objConfig->Get($SortFieldVar)." ".$objConfig->Get($SortOrderVar)); - -if (strlen($imgFilter)) - $sql.= " WHERE (".$imgFilter.")"; - -/* Search */ -$objLinkList->AdminSearchFields = array('Name', 'Url', 'Description'); -$SearchWords = $objSession->GetVariable("ValiLinkSearchWord"); -if(strlen($SearchWords)) -{ - $where = $objLinkList->AdminSearchWhereClause($SearchWords); -} -else - $where = ""; - -if(strlen($where)) -{ - $sql .= strlen($imgFilter)? " AND (".$where.") ": "WHERE (".$where.")"; -} - -/* End Search */ - - -if(strlen($order)) - $sql .=" ORDER BY ".$order." "; - -/* Page navigation */ -if( (int)GetVar('lpn') ) -{ - $objSession->SetVariable($CurrentPageVar, (int)$_GET["lpn"]); - $page = (int)$_GET["lpn"]; -} -else -{ - $page = $objSession->GetVariable($CurrentPageVar); -} - -$sql .= GetLimitSQL($page, (int)$objConfig->Get($PerPageVar)); - -//echo $sql; - -$itemcount = QueryCount($sql); -$objLinkList->Query_Item($sql," "); - -if($objSession->HasSystemPermission("DEBUG.LIST")) - echo htmlentities($sql,ENT_NOQUOTES)."
    \n"; - - -for($i=0;$iItems);$i++) -{ - $image_file = ""; - $img = &$objLinkList->GetItemRefByIndex($i); - if(is_numeric($img->Get("intValStatus"))) - { - switch($img->Get("intValStatus")) - { - case 0: - if ($img->Get("Status") == 0) - $image_file = "icon16_not_validated_disabled.gif"; - elseif ($img->Get("Status") == 1) - $image_file = "icon16_not_validated.gif"; - elseif ($img->Get("Status") == 2) - $image_file = "icon16_not_validated_pend.gif"; - - break; - - case 1: - if ($img->Get("Status") == 0) - $image_file = "icon16_valid_disabled.gif"; - elseif ($img->Get("Status") == 1) - $image_file = "icon16_valid.gif"; - elseif ($img->Get("Status") == 2) - $image_file = "icon16_valid_pend.gif"; - - break; - - case 2: - if ($img->Get("Status") == 0) - $image_file = "icon16_invalid_disabled.gif"; - elseif ($img->Get("Status") == 1) - $image_file = "icon16_invalid.gif"; - elseif ($img->Get("Status") == 2) - $image_file = "icon16_invalid_pend.gif"; - - break; - } - } - else - { - if ($img->Get("Status") == 0) - $image_file = "icon16_not_validated_disabled.gif"; - elseif ($img->Get("Status") == 1) - $image_file = "icon16_not_validated.gif"; - elseif ($img->Get("Status") == 2) - $image_file = "icon16_not_validated_pend.gif"; - } - - if (strlen($image_file)) - $img->Set("Icon", $rootURL."in-link/admin/images/".$image_file); -} - - -/* ---------------------------------------- Configure the list view ---------------------------------------- */ - $objListView = new clsListView($objListToolBar, $objLinkList); - - $SortOrder=0; - - if($objConfig->Get($SortOrderVar)=="asc") - $SortOrder=1; - - $objListView->ColumnHeaders->Add("LinkName",language("la_ColHeader_Name"),1,0,$order,"width=\"30%\" nowrap",$SortFieldVar,$SortOrderVar,"LinkName"); - $objListView->ColumnHeaders->Add("LinkUrl",language("la_ColHeader_Url"),1,0,$order,"width=\"35%\" nowrap",$SortFieldVar,$SortOrderVar,"LinkUrl"); - $objListView->ColumnHeaders->Add("ValStatus",language("la_ColHeader_ValidationStatus"),1,0,$order,"width=\"15%\" nowrap",$SortFieldVar,$SortOrderVar,"ValStatus"); - $objListView->ColumnHeaders->Add("ValidationTime",language("la_ColHeader_ValidationTime"),1,0,$order,"width=\"10%\"",$SortFieldVar,$SortOrderVar,"val.ValidationTime"); - $objListView->ColumnHeaders->Add("LinkCreatedOn",language("la_ColHeader_CreatedOn"),1,0,$order,"width=\"10%\"",$SortFieldVar,$SortOrderVar,"CreatedOn"); - - $objListView->ColumnHeaders->SetSort($objConfig->Get($SortFieldVar), $objConfig->Get($SortOrderVar)); - - - $objListView->PrintToolBar = FALSE; - $objListView->SearchBar = TRUE; - $objListView->SearchKeywords = $SearchWords; - $objListView->SearchAction="l_vallist_search"; - $objListView->CurrentPageVar = $CurrentPageVar; - $objListView->PerPageVar = $PerPageVar; - $objListView->CheckboxName = "itemlist[]"; - $objListView->IdField = "LinkId"; - $objListView->TotalItemCount = $itemcount; - - $objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField, - $CurrentFilterVar,$ValView,$Img_AllValue); - - foreach($FilterLabels as $Bit=>$Label) - { - $objListView->AddViewMenuFilter($Label,$Bit); - } - - for($i=0;$iItems);$i++) - { - $img =& $objLinkList->GetItemRefByIndex($i); - $objListView->RowIcons[] = $img->Get("Icon"); - } - -$objListToolBar->AddToInitScript("fwLoadMenus();\n"); - -$filter = false; // always initialize variables before use -if($SearchWords != '') { - $filter = true; -} -else { - if ($ValView != $Img_AllValue) { - $filter = true; - } -} - -if(strlen($SearchWords)) - $title = prompt_language("la_Text_Search_Results")." (".$itemcount.")"; -else - $title .= " ($itemcount)"; - -$h = "\n\n\n"; -int_header($objListToolBar,NULL, $title,NULL,$h); -if ($filter) { ?> - - - - -
    - -
    - -
    " method=POST> - - -PrintList(); -?> - - - -
    -
    - - -
    -
    - - -
    - -
    " name="viewmenu"> - - - - -
    - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.9.26/in-link/admin/addreview.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.9.26/in-link/admin/addreview.php (revision 12746) +++ branches/unlabeled/unlabeled-1.9.26/in-link/admin/addreview.php (revision 0) @@ -1,221 +0,0 @@ -SourceTable = $objSession->GetEditTable("Link"); - -//Multiedit init -$en = (int)$_GET["en"]; -$objEditCat->Query_Item("SELECT * FROM ".$objEditCat->SourceTable); -$objEditCat->EnablePaging = FALSE; -$itemcount=$objEditCat->NumItems(); -$c = $objEditCat->GetItemByIndex($en); - -unset($objEditItems); - -$objEditItems = new clsItemReviewList(); -$objEditItems->SourceTable = $objSession->GetEditTable("ItemReview"); - -if(isset($_POST["itemlist"])) -{ - if(is_array($_POST["itemlist"])) - { - $ReviewId = $_POST["itemlist"][0]; - } - else - { - $ReviewId = $_POST["itemlist"]; - } - $Rev = $objEditItems->GetItem($ReviewId); - $action = "m_review_edit"; -} -else -{ - $Rev = new clsItemReview(); - $Rev->Set("ItemId",$c->Get("ResourceId")); - $Rev->Set("ItemType",4); - $Rev->Set("Status",2); - $Rev->Set("Priority",0); - $Rev->Set("CreatedById",$objSession->Get("PortalUserId")); - $Rev->Set("CreatedOn",adodb_date("U")); - $action = "m_review_add"; -} - -$envar = "env=" . BuildEnv() . "&en=$en"; - -$section = 'in-link:editlink_review'; - -$ado = &GetADODBConnection(); - -if(is_numeric($Rev->Get("CreatedById"))) -{ - if($Rev->Get("CreatedById")>0) - { - $u = $objUsers->GetUser($Rev->Get("CreatedById")); - $login_name = $u->Get("Login"); - } - else - $login_name = "root"; -} -else -{ - if($objSession->Get("PortalUserId")>0) - { - $u = $objUsers->Get($objSession->Get("PortalUserId")); - $login_name = $u->Get("CreatedById"); - } - else - $login_name="root"; -} - -$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Link")." '".$c->Get("Name")."' - ".prompt_language("la_tab_Review")." by ".$login_name; - -$objListToolBar = new clsToolBar(); -$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_save_review('link','in-link/admin/addlink_reviews.php',0);",$imagesURL."/toolbar/tool_select.gif"); -$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_save_review('link','in-link/admin/addlink_reviews.php',-1);",$imagesURL."/toolbar/tool_cancel.gif"); -int_header($objListToolBar,NULL,$title); -if ($objSession->GetVariable("HasChanges") == 1) { -?> - - - - -
    - -
    - - - - - - > - - - > - - - - - - > - - - - - - - > - - - - - - - - > - - - - - - > - - - - - - > - - - - - > - - - - - "> - "> - "> - "> - - - -
    - Get("TextFormat")==1) echo "CHECKED"; ?>> -
    - -
    - Get("ReviewId"); ?> -  
    - - - - - - -  

    - - - -
    - -
    - Get("Status") == 1) echo "checked"; ?>> - Get("Status") == 2) echo "checked"; ?>> - Get("Status") == 0) echo "checked"; ?>> -  
    - "> -  
    - "> -
    - "> -
    -
    - - -
    - -
    " name="viewmenu"> - - - - -
    - - - - - Index: branches/unlabeled/unlabeled-1.4.2/in-link/admin_templates/export.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.4.2/in-link/admin_templates/export.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.4.2/in-link/admin_templates/export.tpl (revision 0) @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - - - - - - "> - - - - - - - "> - - - - - - - - - - -
    - - - - - - - - - - - -
    - " onclick="move_options_up('', 1)" class="button"> - " onclick="move_options_down('', 1)" class="button">
    -
    -

    :
    - - " value="" /> - - ', '')" class="button">
    -
    - ', ''); select_sort('');" class="button"> -
    - -
    -
     
    - - - - - - - - - - - - - -
    - checked name="" id="_1" value="1" /> - - -
    - error"> *: - " id="" value="" size="2" maxlength="1" />
    - (will look like "Category:Sub-category:Sub-sub-category") - -
    - checked name="" id="_2" value="2" /> - -
    - (the fields will be titled Category1..CategoryN accordingly) -
    -
     
    - - Index: branches/unlabeled/unlabeled-1.4.2/in-link/admin_templates/links/links_images.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.4.2/in-link/admin_templates/links/links_images.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.4.2/in-link/admin_templates/links/links_images.tpl (revision 0) @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.27.2/in-link/admin/install/langpacks/english.lang =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.27.2/in-link/admin/install/langpacks/english.lang (revision 12746) +++ branches/unlabeled/unlabeled-1.27.2/in-link/admin/install/langpacks/english.lang (revision 0) @@ -1,152 +0,0 @@ - - m/d/Yg:i:s Am/d/Yg:i:s A.,iso-8859-12 - - QWN0aW9ucyBVcG9uIEV4cGlyYXRpb24= - QWN0aW9ucyBVcG9uIFB1cmNoYXNl - RXhwaXJlcyBPbg== - TGluaw== - T3duZXI= - TGlzdGluZyBUeXBl - TW9kaWZpZWQ= - UGVuZGluZyBSZW5ld2Fs - RW5hYmxlZCBPbg== - RGVjcmVhc2UgQnk= - VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgZHVwbGljYXRlIGxpbmtz - VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgcGFpZCBsaXN0aW5ncw== - VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgcGFpZCBsaXN0aW5ncw== - RG9uJ3QgQ2hhbmdl - TGluayBlbmhhbmNlbWVudCBzdWJtaXR0ZWQ= - TGluayBlbmhhbmNlbWVudCBhcHByb3ZlZA== - TGluayBlbmhhbmNlbWVudCBkZW5pZWQ= - TGluayBlbmhhbmNlbWVudCBleHBpcmVk - TGluayBlbmhhbmNlbWVudCByZW5ld2FsIHN1Ym1pdHRlZA== - TGluayBlbmhhbmNlbWVudCBleHRlbmRlZA== - TGluayBlbmhhbmNlbWVudCBpcyBhYm91dCB0byBleHBpcmU= - TGluayBlbmhhbmNlbWVudCBjYW5jZWxsZWQ= - TGluayBlbmhhbmNlbWVudCByZW5ld2FsIGZhaWxlZA== - TGluayBJdGVtIFRlbXBsYXRl - RW5hYmxlIFB1cmNoYXNpbmc= - RXhwaXJhdGlvbiBEYXRl - TGluayBPd25lcg== - TWF4aW11bSBudW1iZXIgb2YgSE9UIGxpbmtz - TWluaW11bSByYXRpbmcgdG8gY29uc2lkZXIgbGluayBQT1A= - TWluaW11bSBudW1iZXIgb2Ygdm90ZXMgdG8gY29uc2lkZXIgbGluayBQT1A= - SUQ= - TGlzdGluZyBUeXBl - RGVzY3JpcHRpb24= - SUQ= - TmFtZQ== - UGVuZGluZyBSZW5ld2Fs - UHVyY2hhc2UgRGF0ZQ== - UmVjdXJyaW5n - UmVuZXdhbCBSZW1pbmRlcg== - UHJvZHVjdCBOYW1l - VXNlcm5hbWU= - SW4tbGluaw== - SW5jcmVhc2UgQnk= - SzQgTGlua3M= - QWxsb3cgRnJlZSBMaXN0aW5ncw== - RW5oYW5jZWQgTGlzdGluZ3M= - R3JvdXBpbmcgQnk= - TXVsdGlwbGUgbGlua3MgZnJvbSBvbmUgZ3JvdXAgY291bGQgbm90IGJlIHNlbGVjdGVkIGF0IG9uY2UuIFBsZWFzZSBzZWxlY3Qgb25seSBvbmUgbGluayBmcm9tIGdyb3VwLg== - Tm8gQ2F0ZWdvcmllcw== - Tm8= - UGVuZGluZyBSZW5ld2Fs - TGluaw== - U2V0IEVxdWFsIFRv - RHVwbGljYXRlIENoZWNrZXI= - TGlzdGluZ3M= - TGlzdGluZyBUeXBlcw== - UGFpZCBMaXN0aW5ncw== - U2hvcHBpbmcgQ2FydCBFbnRyeQ== - SzQgTGlua3M= - UGFpZCBMaXN0aW5n - TGlzdGluZyBUeXBl - U2hvcHBpbmcgQ2FydCBJdGVt - QWRkaW5nIExpbms= - QWRkaW5nIExpc3Rpbmc= - QWRkaW5nIExpc3RpbmcgVHlwZQ== - RHVwbGljYXRlIExpbmtz - RWRpdGluZyBMaW5r - RWRpdGluZyBMaXN0aW5n - RWRpdGluZyBMaXN0aW5nIFR5cGU= - SW1wb3J0IExpbmtz - TGlua3M= - TGlua3MgRHVwbGljYXRlIENoZWNrZXI= - TGlua3MgRXhwb3J0 - TGlzdGluZyBUeXBlcw== - TmV3IExpbms= - TmV3IExpc3Rpbmc= - TmV3IExpc3RpbmcgVHlwZQ== - UGFpZCBMaXN0aW5ncw== - TGlzdGluZyBUeXBlcw== - U2hvcHBpbmcgQ2FydCBFbnRyeQ== - TWVyZ2U= - TmV3IEZpbGU= - TmV3IExpc3Rpbmc= - TmV3IExpc3RpbmcgVHlwZQ== - WW91IGFyZSBhYm91dCB0byBjYW5jZWwgeW91ciBsaW5rIGVuaGFuY2VtZW50Lg== - WW91IGFyZSBhYm91dCB0byBleHRlbmQgeW91ciBsaW5rIGVuaGFuY2VtZW50Lg== - Q2FuY2VsIExpbmsgRW5oYW5jZW1lbnQ= - QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGNhbmNlbCB5b3VyIGVuaGFuY2VkIGxpbms/IFRoZSBsaXN0aW5nIHR5cGUgd2lsbCBiZSByZXNldCB0byByZWd1bGFyLg== - Q2hvb3NlIExpc3RpbmcgVHlwZQ== - Q29uZmlybSBFbmhhbmNlbWVudCBDYW5jZWw= - Q29uZmlybSBFbmhhbmNlbWVudCBFeHRlbmQ= - RW5oYW5jZQ== - RW5oYW5jZSBMaW5r - VGhhbmsgeW91IGZvciBlbmhhbmNpbmcgeW91ciBsaW5rLiBZb3UgbGluayBlbmhhbmNlbWVudCBpcyBub3cgcGVuZGluZyBhZG1pbmlzdHJhdG9yIGFwcHJvdmFsLiBZb3Ugd2lsbCBiZSBub3RpZmllZCBieSBlbWFpbCB3aGVuIHlvdXIgbGluayBlbmhhbmNlbWVudCBpcyBhcHByb3ZlZC4= - RW5oYW5jZW1lbnQgc2V0IHRvIHJlbmV3IGF1dG9tYXRpY2FsbHkgb24= - RXh0ZW5kL0NhbmNlbCBFbmhhbmNlbWVudA== - RXh0ZW5kIExpbmsgRW5oYW5jZW1lbnQ= - QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGV4dGVuZCB5b3VyIGxpbmsgZW5oYW5jZW1lbnQ/ - Tm8gZGVzY3JpcHRpb24gZW50ZXJlZCE= - Tm8gbmFtZSBlbnRlcmVkIQ== - Tm8gVVJMIGVudGVyZWQh - RnJlZSBMaXN0aW5n - TGluayBFbmhhbmNlbWVudCBSZXN1bHRz - RXhwaXJhdGlvbiBEYXRl - TGlzdGluZyBUeXBl - TGlzdGluZyBUeXBl - QWZ0ZXIgc2VsZWN0aW5nIGxpc3RpbmcgdHlwZSBpdCB3aWxsIGJlIGFkZGVkIHRvIHlvdXIgc2hvcHBpbmcgY2FydC4gT25jZSB5b3UgY29tcGxldGUgY2hlY2tvdXQgYW5kIHlvdXIgb3JkZXIgaXMgYXBwcm92ZWQgeW91ciBsaW5rIHN0YXR1cyB3aWxsIGJlIHVwZ3JhZGVkLiBZb3Ugd2lsbCBiZSBub3RpZmllZCBieSBlbWFpbCB3aGVuIHRoaXMgaXMgZG9uZS4= - cGVuZGluZw== - TGlzdGluZyBUeXBl - dG8gY2FuY2VsIGxpbmsgZW5oYW5jZW1lbnQ= - - - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgYWRkZWQKCllvdXIgbGluayBoYXMgYmVlbiBhZGRlZC4NCjE= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBhZGRlZAoKQSBsaW5rIGhhcyBiZWVuIGFkZGVk - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBhcHByb3ZlZAoKWW91ciBsaW5rIGhhcyBiZWVuIGFwcHJvdmVk - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBkZW5pZWQKCllvdXIgbGluayBoYXMgYmVlbiBkZW5pZWQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQKCkRlYXIgPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJGaXJzdE5hbWUiIC8+IDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iTGFzdE5hbWUiIC8+LA0KDQpUaGFuayB5b3UgZm9yIHN1Ym1pdHRpbmcgbGluayBlbmhhbmNlbWVudCByZXF1ZXN0LiBZb3Ugd2lsbCBiZSBub3RpZmllZCB3aGVuIHlvdXIgbGluayBlbmhhbmNlbWVudCBpcyBwcm9jZXNzZWQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgRW5oYW5jZW1lbnQgc3VibWl0dGVkCgpBIHVzZXIgaGFzIHN1Ym1pdHRlZCBhIGxpbmsgZW5oYW5jZW1lbnQgcmVxdWVzdC4gUGxlYXNlIHByb2NlZWQgdG8gYWRtaW5pc3RyYXRpdmUgY29uc29sZSB0byByZXZpZXcgaXQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgYXBwcm92ZWQKCkRlYXIgPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJGaXJzdE5hbWUiIC8+IDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iTGFzdE5hbWUiIC8+LA0KDQpZb3VyIHJlY2VudCBsaW5rIGVuaGFuY2VtZW50IHJlcXVlc3QgaGFzIGJlZW4gYXBwcm92ZWQuIFRoYW5rIHlvdSENCg== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgYXBwcm92ZWQKCkxpbmsgZW5oYW5jZW1lbnQgaGFzIGJlZW4gYXBwcm92ZWQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgY2FuY2VsbGVkCgpEZWFyIDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iRmlyc3ROYW1lIiAvPiA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9Ikxhc3ROYW1lIiAvPiwNCg0KWW91ciBsaW5rIGVuaGFuY2VtZW50IG9uIDxpbnAyOmNvbmZfQ29uZmlnVmFsdWUgbmFtZT0iU2l0ZV9OYW1lIi8+IGhhcyBiZWVuIGNhbmNlbGxlZC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgY2FuY2VsbGVkCgpMaW5rIGVuaGFuY2VtZW50IGhhcyBiZWVuIGNhbmNlbGxlZC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZGVuaWVkCgpEZWFyIDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iRmlyc3ROYW1lIiAvPiA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9Ikxhc3ROYW1lIiAvPiwNCg0KU29ycnksIGJ1dCB5b3VyIHJlY2VudCBsaW5rIGVuaGFuY2VtZW50IHJlcXVlc3QgaGFzIGJlZW4gZGVuaWVkLg== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZGVuaWVkCgpMaW5rIGVuaGFuY2VtZW50IGhhcyBiZWVuIGRlbmllZC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZXhwaXJlZAoKRGVhciA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9IkZpcnN0TmFtZSIgLz4gPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJMYXN0TmFtZSIgLz4sDQoNCllvdXIgZW5oYW5jZWQgbGluayBhdCA8aW5wMjpjb25mX0NvbmZpZ1ZhbHVlIG5hbWU9IlNpdGVfTmFtZSIvPiBoYXMgZXhwaXJlZC4gSWYgeW91IHdhbnQgdG8gcmVuZXcgeW91ciBlbmhhbmNlZCBsaW5rLCBwbGVhc2UgcmUtc3VibWl0IGxpbmsgZW5oYW5jZW1lbnQgcmVxdWVzdC4gVGhhbmsgeW91IQ== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZXhwaXJlZAoKRW5oYW5jZWQgbGluayBoYXMgZXhwaXJlZC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgcmVuZXdhbAoKRGVhciA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9IkZpcnN0TmFtZSIgLz4gPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJMYXN0TmFtZSIgLz4sDQoNClRoYW5rIHlvdSBmb3Igc3VibWl0dGluZyBsaW5rIGVuaGFuY2VtZW50IHJlbmV3YWwgcmVxdWVzdC4gWW91IHdpbGwgYmUgbm90aWZpZWQgd2hlbiB5b3UgcmVxdWVzdCBpcyBwcm9jZXNzZWQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgcmVuZXdhbCBzdWJtaXRlZAoKTGluayBlbmhhbmNlbWVudCByZW5ld2FsIHJlcXVlc3QgaGFzIGJlZW4gc3VibWl0dGVkLCBwbGVhc2UgcHJvY2VlZCB0byBhZG1pbmlzdHJhdGl2ZSBjb25zb2xlIHRvIHJldmlldyBpdC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZXh0ZW5kZWQKCkRlYXIgPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJGaXJzdE5hbWUiIC8+IDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iTGFzdE5hbWUiIC8+LA0KDQpZb3UgbGluayBlbmhhbmNlbWVudCBvbiA8aW5wMjpjb25mX0NvbmZpZ1ZhbHVlIG5hbWU9IlNpdGVfTmFtZSIvPiBoYXMgYmVlbiBleHRlbmRlZC4gVGhhbmsgeW91IQ== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZXh0ZW5kZWQKCkxpbmsgZW5oYW5jZW1lbnQgaGFzIGJlZW4gZXh0ZW5kZWQ= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IEVuaGFuY2UgTGluayBSZW5ld2FsIEZhaWxlZAoKRW5oYW5jZSBMaW5rIFJlbmV3YWwgRmFpbGVk - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IEVuaGFuY2UgTGluayBSZW5ld2FsIEZhaWxlZAoKRW5oYW5jZSBMaW5rIFJlbmV3YWwgRmFpbGVk - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgcmVuZXdhbCBub3RpY2UKCkRlYXIgPGlucDI6dV9GaWVsZCBuYW1lPSJGaXJzdE5hbWUiIC8+IDxpbnAyOnVfRmllbGQgbmFtZT0iTGFzdE5hbWUiIC8+LA0KDQpZb3VyIGxpbmsgZW5oYW5jZW1lbnQgb24gPGlucDI6Y29uZl9Db25maWdWYWx1ZSBuYW1lPSJTaXRlX05hbWUiLz4gaXMgYWJvdXQgdG8gZXhwaXJlLiBQbGVhc2UgbG9naW4gdG8geW91ciBhY2NvdW50IHRvIHJlbmV3IHlvdXIgbGluayBlbmhhbmNlbWVudC4gVGhhbmsgeW91IQ== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgYWJvdXQgdG8gZXhwaXJlCgpMaW5rIGVuaGFuY2VtZW50IGlzIGFib3V0IHRvIGV4cGlyZS4= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBtb2RpZmVkCgpZb3VyIGxpbmsgaGFzIGJlZW4gbW9kaWZpZWQ= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBtb2RpZmllZAoKQSBsaW5rIGhhcyBiZWVuIG1vZGlmaWVkLg== - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBhcHByb3ZlZAoKWW91ciBsaW5rIG1vZGlmaWNhdGlvbiBoYXMgYmVlbiBhcHByb3ZlZA== - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBtb2RpZmljYXRpb24gZGVuaWVkCgpZb3VyIGxpbmsgbW9kaWZpY2F0aW9uIGhhcyBiZWVuIGRlbmllZC4= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYWRkZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gYWRkZWQ= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYWRkZWQKCkEgbGluayByZXZpZXcgaGFzIGJlZW4gYWRkZWQ= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYWRkZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gYWRkZWQgYW5kIGlzIHBlbmRpbmcgYXBwcm92YWwu - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYXBwcm92ZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gYXBwcm92ZWQ= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgZGVjbGluZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gZGVjbGluZWQ= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgQWNjZXB0ZWQKCkRlYXIgPGlucDI6bV9nZXQgdmFyPSJ0b19uYW1lIi8+LA0KDQpZb3UgbGluayA8aW5wMjpsX0ZpZWxkIG5hbWU9Ik5hbWUiLz4gaGFzIGJlZW4gYWNjZXB0ZWQuDQoNCg== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgTm90IEFjY2VwdGVkCgpEZWFyIDxpbnAyOm1fZ2V0IHZhcj0idG9fbmFtZSIvPiwNCg0KVW5mb3J0dW5hdGVseSB5b3UgbGluayA8aW5wMjpsX0ZpZWxkIG5hbWU9Ik5hbWUiIC8+IGhhcyBub3QgYmVlbiBhY2NlcHRlZC4NCg0K - U3ViamVjdDogUmVjaXByb2NhbCBMaW5rIE5vdCBGb3VuZAoKRGVhciA8aW5wMjptX2dldCB2YXI9InRvX25hbWUiLz4sDQoNClVuZm9ydHVuYXRlbHkgd2Ugd2VyZSB1bmFibGUgdG8gZmluZCByZWNpcHJvY2FsIGxpbmsgYXQgPGlucDI6bF9GaWVsZCBuYW1lPSJjdXN0X3JlY2lwcm9jYWwiIC8+Lg0KDQo= - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.27.2/in-link/units/listings/listings_event_handler.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.27.2/in-link/units/listings/listings_event_handler.php (revision 12746) +++ branches/unlabeled/unlabeled-1.27.2/in-link/units/listings/listings_event_handler.php (revision 0) @@ -1,700 +0,0 @@ -getObject(); - - $selected_ids = $this->Application->GetVar('selected_ids'); - if ($selected_ids['l']) { - $link_id = $selected_ids['l']; - $sql = 'SELECT ResourceId - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE '.$this->Application->getUnitOption('l', 'IDField').' = '.$link_id; - - $object->SetDBField($this->Application->RecallVar('dst_field'), $this->Conn->GetOne($sql)); - $object->IgnoreValidation = true; - // $this->RemoveRequiredFields($object); - $object->Update(); - } - - $this->finalizePopup($event); - } - - function OnPreSaveListing(&$event) - { - $event->redirect=false; - $object =& $event->getObject( Array('skip_autoload' => true) ); - $object->IgnoreValidation = true; - // $this->RemoveRequiredFields($object); - $event->CallSubEvent('OnPreSave'); - $this->Application->SetVar($event->getPrefixSpecial(true).'_id', $object->GetId()); - return; - } - - function OnBeforeItemUpdate(&$event) - { - $object =& $event->getObject(); - if($object->IgnoreValidation) - { - $object->UpdateFormattersMasterFields(); - } - } - - function OnBeforeItemCreate(&$event) - { - $object =& $event->getObject(); - if($object->IgnoreValidation) - { - $object->UpdateFormattersMasterFields(); - } - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnBeforeDeleteFromLive(&$event) - { - $object =& $event->getObject(); - $sql = 'SELECT * FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ListingId = '.$object->GetId(); - $original_values = $this->Conn->GetRow($sql); - - $type_modified = ($object->GetDBField('ListingTypeId') != $original_values['ListingTypeId']); - $link_modified = ($object->GetDBField('ItemResourceId') != $original_values['ItemResourceId']); - $status_modified = ($object->GetDBField('Status') != $original_values['Status']); - - if($status_modified) - { - $email_event = $object->GetDBField('Status') ? 'LINK.ENHANCE.APPROVE' : 'LINK.ENHANCE.APPROVE'; - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser($email_event, $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin($email_event); - } - - if( $type_modified || $link_modified ) - { - $this->ResetLink($original_values); - } - - if( $status_modified || $type_modified || $link_modified ) - { - $this->EnhanceLink($object, $original_values); - } - - if( $status_modified && !($type_modified || $link_modified) ) - { - $this->ResetLink($original_values); - } - } - - function EnhanceLink(&$object, $original_values) - { - if ($object->GetDBField('Status') != STATUS_ACTIVE) { - return false; - } - - if ($object->GetDBField('ExpiresOn') < adodb_mktime()) { - $object->SetDBField('Status', STATUS_PENDING); - $object->Update(); - $this->ResetLink($original_values); - return false; - } - - $this->UpdateLink('OnPurchase', $object->GetDBField('ItemResourceId'), $object->GetDBField('ListingTypeId')); - - $listtype_object =& $this->Application->recallObject('lst'); - if( $listtype_object->GetDBField('OnPurchaseAddToCatEnabled') ) - { - $link_object =& $this->Application->recallObject('l'); - $add_to_cat = (int)$listtype_object->GetDBField('OnPurchaseAddToCat'); - $sql = 'DELETE FROM '.$this->Application->getUnitOption('l-ci', 'TableName').' - WHERE CategoryId = '.$add_to_cat.' - AND ItemResourceId = '.$link_object->GetDBField('ResourceId').' - AND PrimaryCat = 0'; - $this->Conn->Query($sql); - $sql = 'INSERT INTO '.$this->Application->getUnitOption('l-ci', 'TableName').' - (CategoryId, ItemResourceId, PrimaryCat) - VALUES ('.$add_to_cat.', '.$link_object->GetDBField('ResourceId').', 0)'; - $this->Conn->Query($sql); - } - } - - function ResetLink($original_values) - { - static $has_been_reset = Array(); - - if( $original_values['Status'] != STATUS_ACTIVE || - getArrayValue($has_been_reset, $original_values['ListingId']) ) - { - return; - } - - $has_been_reset[$original_values['ListingId']] = 1; - - $this->UpdateLink('OnExpire', $original_values['ItemResourceId'], $original_values['ListingTypeId']); - - $listtype_object =& $this->Application->recallObject('lst'); - if( $listtype_object->GetDBField('OnExpireRemoveFromCatEnabled') ) - { - $remove_from_cat = $listtype_object->GetDBField('OnExpireRemoveFromCat'); - $sql = 'DELETE FROM '.$this->Application->getUnitOption('l-ci', 'TableName').' - WHERE ItemResourceId = '.$original_values['ItemResourceId'].' - AND CategoryId = '.$remove_from_cat.' - AND PrimaryCat = 0'; - $this->Conn->Query($sql); - } - } - - function UpdateLink($action_prefix, $resource_id, $listtype_id) - { - - $link_object =& $this->Application->recallObject('l', null, Array('skip_autoload' => true)); - $link_object->Load($resource_id, 'ResourceId'); - - // "-item", because can be called as regular after event, and just "lst" recalls list instead - $listtype_object =& $this->Application->recallObject('lst.-item', null, Array('skip_autoload' => true)); - $listtype_object->Load($listtype_id); - - $action_fields = Array( 'EdPick' => 'EditorsPick', - 'New' => 'NewItem', - 'Hot' => 'HotItem', - 'Pop' => 'PopItem' - ); - // $action_prefix = 'OnPurchase'; - - foreach($action_fields as $action => $field) - { - $action_value = $listtype_object->GetDBField($action_prefix.$action); - if( $action_value != 3 ) - { - $link_object->SetDBField($field, $action_value); - } - } - - $priority_value = $listtype_object->GetDBField($action_prefix.'PriorityValue'); - switch( $listtype_object->GetDBField($action_prefix.'PriorityAction') ) - { - case 1: // equal - $link_object->SetDBField('Priority', $priority_value); - break; - case 2: // increase - $original_priority = $link_object->GetDBField('Priority'); - $link_object->SetDBField('Priority', $original_priority + $priority_value); - break; - case 3: // decrease - $original_priority = $link_object->GetDBField('Priority'); - $link_object->SetDBField('Priority', $original_priority - $priority_value); - break; - default: - } - - $link_object->Update(); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnRequestEnhancement(&$event) - { - if ($this->Application->isModuleEnabled('In-Commerce')) { - $l_info = $this->Application->GetVar('l'); - if (!$l_info) { - return false; - } - - list($link_id, $link_info) = each($l_info); - $listing_type_id = $link_info['ListingTypeId']; - - $listing_type =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing_type->Load($listing_type_id); - - if ($listing_type->GetDBField('EnableBuying')) { - $add_to_cart_event =& new kEvent('ord:OnAddVirtualProductToCart'); - $this->Application->HandleEvent($add_to_cart_event); - if($add_to_cart_event->redirect) - { - $event->SetRedirectParam('pass', 'm'); - $event->redirect = $add_to_cart_event->redirect; - } - return true; - } - } - - $event->CallSubEvent('OnListingCreate'); - } - - /** - * Create listing or extend existing listing period - * - * @param kEvent $event - */ - function OnListingCreate(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - - switch ($event->Name) { - case 'EnhanceLinkAfterOrderApprove': - case 'EnhancedLinkOnCompleteOrder': - // when order with listing virtual product is approved - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $listing_type_id = $item_data['ListingTypeId']; - $link_id = $item_data['LinkId']; - - $new_processing = getArrayValue($item_data, 'HasNewProcessing'); - break; - - case 'OnListingCreate': - // when requesting enhancement from front (and not via in-commerce) - $links_info = $this->Application->GetVar('l'); - if (!$links_info) return false; - - $event->redirect = false; - list($link_id, $link_info) = each($links_info); - $listing_type_id = $link_info['ListingTypeId']; - - $new_processing = false; - break; - } - - // get resource_id of link beeing enhanced - $sql = 'SELECT ResourceId - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $resource_id = $this->Conn->GetOne($sql); - - // get listing by link's resource_id - $object->Load($resource_id, 'ItemResourceId'); - if ($object->isLoaded()) { - $original_values = $object->FieldValues; - } - else { - // set initial fields to listing - $object->SetDBField('ListingTypeId', $listing_type_id); - $object->SetDBField('ItemResourceId', $resource_id); - - if ($event->Name == 'OnListingCreate' || $new_processing) { - $item_status = STATUS_PENDING; - } - else { - $item_status = STATUS_ACTIVE; - } - - $object->SetDBField('Status', $item_status); - } - - // set date of purchase for new listings - $purchased_on = max(adodb_mktime(), $object->GetDBField('ExpiresOn')); - if (!$object->isLoaded()) { - $object->SetDBField('PurchasedOn_date', $purchased_on); - $object->SetDBField('PurchasedOn_time', $purchased_on); - } - - // set expiration time for listing - $listing_type =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing_type->Load($listing_type_id); - - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $listing_type->GetDBField('Duration'); - $duration_type = $listing_type->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $expiration_date = $purchased_on + $expiration_interval; - $object->SetDBField('ExpiresOn_date', $expiration_date); - $object->SetDBField('ExpiresOn_time', $expiration_date); - - // when extending enhancement mark listing as non-received renewal reminder - $object->SetDBField('RenewalReminderSent', 0); - - $action = $object->isLoaded() ? 'Update' : 'Create'; - if ($object->$action()) { - $event->status = erSUCCESS; - switch ($event->Name) { - case 'EnhanceLinkAfterOrderApprove': - case 'EnhancedLinkOnCompleteOrder': - // when order with listing virtual product is approved - if (getArrayValue($original_values, 'Status') != STATUS_ACTIVE) { - $this->EnhanceLink($object, Array()); - } - break; - - case 'OnListingCreate': - // when requesting enhancement from front (and not via in-commerce) - $event->redirect = $this->Application->GetVar('success_template'); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE'); - break; - } - - - } - else { - $event->status = erFAIL; - } - - - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function EnhancedLinkOnCompleteOrder(&$event) - { - // create enhancement, but pending - $this->OnListingCreate($event); - - // save created listing_id back to itemdata - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - unset($item_data['ListingTypeId']); - $item_data['ListingId'] = $object->GetID(); - - $orditems_idfield = $this->Application->getUnitOption('orditems', 'IDField'); - $orditems_table = $this->Application->getUnitOption('orditems', 'TableName'); - - $this->Conn->doUpdate( Array('ItemData' => serialize($item_data)), $orditems_table, $orditems_idfield.' = '.$fields['OrderItemId'] ); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function EnhanceLinkAfterOrderApprove(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - - if ( getArrayValue($item_data, 'HasNewProcessing') ) { - // new processing: just approve created listing here - $listing_id = $item_data['ListingId']; - $object->Load($listing_id); - $object->SetDBField('Status', STATUS_ACTIVE); - $object->Update(); - - $this->EnhanceLink($object, Array()); - return true; - } - else { - // create listing & approve it at the same time - $this->OnListingCreate($event); - } - } - - /** - * Delete listing - * - * @param kEvent $event - */ - function EnhanceLinkAfterOrderDeny(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $listing_id = $item_data['ListingId']; - - $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); - $temp_handler->DeleteItems($event->Prefix, $event->Special, Array($listing_id)); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function ExpireLink(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$item_data['LinkId']; - $listing_id = $this->Conn->GetOne($sql); - $object->Load($listing_id); - $original_values = $object->FieldValues; - $object->SetDBField('Status', 2); - - if($object->Update()) - { - $event->status = erSUCCESS; - $this->ResetLink($original_values); - } - else - { - $event->status = erFAIL; - } - } - - function iterateItems(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $this->StoreSelectedIDs($event); - - if($event->Name == 'OnMassApprove') - { - $ids = $this->getSelectedIDs($event); - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') != 1) - { - $original_values = $object->FieldValues; - $object->SetDBField('Status', 1); - $this->EnhanceLink($object, $original_values); - } - } - } - if($event->Name == 'OnMassDecline') - { - $ids = $this->getSelectedIDs($event); - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') == 1) - { - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.DENY', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.DENY'); - } - } - } - parent::iterateItems($event); - if($event->Name == 'OnMassApprove') - { - $lst_object =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $ids = $this->getSelectedIDs($event); - if($ids) - { - foreach($ids as $id) - { - $object->Load($id); - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $owner_id = $this->Conn->GetOne($sql); - if($object->GetDBField('PendingRenewal') == 1) - { - $lst_object->Load( $object->GetDBField('ListingTypeId') ); - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $lst_object->GetDBField('Duration'); - $duration_type = $lst_object->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $renewal_begins = max( adodb_mktime(), $object->GetDBField('ExpiresOn') ); - $expiration_date = $renewal_begins + $expiration_interval; - - $object->SetDBField('ExpiresOn_date', $expiration_date); - $object->SetDBField('ExpiresOn_time', $expiration_date); - - $object->SetDBField('RenewalReminderSent', 0); - $object->SetDBField('PendingRenewal', 0); - - if( $object->Update() ) - { - $event->status=erSUCCESS; - $event->redirect_params = Array('opener' => 's', 'pass_events' => true); //stay! - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.RENEW', $owner_id); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.RENEW'); - } - else - { - $event->status=erFAIL; - $event->redirect=false; - break; - } - } - else - { - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.APPROVE', $owner_id); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.APPROVE'); - } - } - } - } - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnCancel(&$event) - { - parent::OnCancel($event); - $event->SetRedirectParam('opener', 's'); - $event->redirect = $this->Application->GetVar('cancel_template'); - } - - function OnExtendEnhancement(&$event) - { - $link_id = $this->Application->GetVar('l_id'); - $sql = 'SELECT ResourceId FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $link_resource_id = $this->Conn->GetOne($sql); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$link_resource_id; - - $object =& $event->getObject( Array('skip_autoload' => true) ); - $object->Load( $this->Conn->GetOne($sql) ); - - $object->SetDBField('PendingRenewal', 1); - $object->Update(); - $event->redirect = $this->Application->GetVar('success_template'); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.EXTEND', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.EXTEND'); - } - - function OnCancelEnhancement(&$event) - { - $link_id = $this->Application->GetVar('l_id'); - $sql = 'SELECT ResourceId FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $link_resource_id = $this->Conn->GetOne($sql); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$link_resource_id; - - $object =& $this->Application->recallObject($event->Prefix, null, Array('skip_autoload' => true)); - $object->Load( $this->Conn->GetOne($sql) ); - $original_values = $object->FieldValues; - $original_values['Status'] = 1; - $this->ResetLink($original_values); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.CANCEL', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.CANCEL'); - - $object->Delete(); - $event->redirect = $this->Application->GetVar('success_template'); - } - - function OnCheckExpiredPaidListings(&$event) - { - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ExpiresOn < '.adodb_mktime().' AND Status = 1'; - $expired_listings = $this->Conn->GetCol($sql); - if(is_array($expired_listings) && count($expired_listings) > 0) - { - $object =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true)); - foreach($expired_listings as $listing_id) - { - $object->Load($listing_id); - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - $object->SetDBField('Status', 2); - $object->Update(); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.EXPIRE', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.EXPIRE'); - } - } - - $sql = 'SELECT ls.ListingId, l.CreatedById FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' ls - LEFT JOIN '.$this->Application->getUnitOption('lst', 'TableName').' lst - ON ls.ListingTypeId = lst.ListingTypeId - LEFT JOIN '.$this->Application->getUnitOption('l', 'TableName').' l - ON ls.ItemResourceId = l.ResourceId - WHERE ls.Status = 1 - AND ls.ExpiresOn < '.adodb_mktime().' + lst.RenewalReminder * 3600 *24 - AND ls.RenewalReminderSent = 0'; - $res = $this->Conn->Query($sql); - if(is_array($res) && count($res) > 0) - { - $listing_ids = Array(); - foreach($res as $record) - { - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.RENEWAL.NOTICE', $record['CreatedById']); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.RENEWAL.NOTICE'); - $listing_ids[] = $record['ListingId']; - } - $sql = 'UPDATE '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - SET RenewalReminderSent = 1 - WHERE ListingId IN ('.implode(',', $listing_ids).')'; - $this->Conn->Query($sql); - } - } - - function OnMassDelete(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $this->StoreSelectedIDs($event); - - $ids = $this->getSelectedIDs($event); - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') == 1) - { - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - } - } - parent::OnMassDelete($event); - } - - /** - * Moves enhancement from original link to it's pending copy, that is going to be approved - * - * @param kEvent $event - */ - function OnMoveEnhancement(&$event) - { - $id_field = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'IDField'); - $item_table_name = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'TableName'); - - $pending_id = $event->MasterEvent->getEventParam('id'); - $original_id = $event->MasterEvent->getEventParam('original_id'); - - $sql = 'SELECT ResourceId, '.$id_field.' - FROM '.$item_table_name.' - WHERE '.$id_field.' IN ('.$pending_id.','.$original_id.')'; - $resource_ids = $this->Conn->GetCol($sql, $id_field); - - $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); - $sql = 'UPDATE '.$table_name.' - SET ItemResourceId = '.$resource_ids[$pending_id].' - WHERE ItemResourceId = '.$resource_ids[$original_id]; - $this->Conn->Query($sql); - } -} - -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.49.2/in-link/parser.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.49.2/in-link/parser.php (revision 12746) +++ branches/unlabeled/unlabeled-1.49.2/in-link/parser.php (revision 0) @@ -1,1412 +0,0 @@ -GetVariable("LinkListType"); - $LastShortType = $objSession->GetVariable("LinkShortList"); - $NoPaging = (getArrayValue($attribs,'_paging')=='0' || getArrayValue($attribs,'_paging')=='false'); - if(!$NoPaging && !strlen($PagingList)) - { - $PagingList=$ListType; - } - //echo "Last: $LastList, Short: $LastShortType Current: $ListType, Short:".$attribs["_shortlist"]." PageList: $PagingList
    \n"; - - if($ListType==$PagingList) - { - $objLinkList->EnablePaging = TRUE; - //echo "Last: $LastList, Short: $LastShortType Current: $ListType, Short:".$attribs["_shortlist"]."
    \n"; - if($LastList != $ListType || $LastShortType != $attribs["_shortlist"]) - { - //echo "Resetting Page..
    \n"; - $l_var_list_update["p"] = 1; - $l_var_list["p"] = 1; - $objSession->SetVariable("LinkListType",$ListType); - $objSession->SetVariable("LinkShortList",$attribs["_shortlist"]); - $objLinkList->Page = 1; - } - else - $objLinkList->Page=$l_var_list["p"]; - } - else - { - if(is_numeric(getArrayValue($attribs,'_maxcount'))) - { - $objLinkList->MaxListCount = $attribs["_maxcount"]; - } - else { - $objLinkList->MaxListCount = 10; - } - - $objLinkList->EnablePaging = FALSE; - } - $objLinkList->ListType=$ListType; - - switch($ListType) - { - case "category": - $objLinkList->LoadListCategory($attribs); - break; - case "myitems": - $objLinkList->LoadMyItems($attribs); - break; - case "hot": - $objLinkList->LoadHotItems($attribs); - break; - case "pop": - $objLinkList->LoadPopItems($attribs); - break; - case "pick": - $objLinkList->LoadPickItems($attribs); - break; - case "favorites": - $objLinkList->LoadFavorites($attribs); - break; - case "search": - $attribs['multiple'] = 'links'; - $objLinkList->LoadSearchItems($attribs); - break; - case "new": - $objLinkList->LoadNewItems($attribs); - break; - case "my_new": - $scope = $objSession->CurrentUser->Vars["LastLogin"]; - $attribs["_scope"] = $scope; - $attribs["_show_since_last"] = 1; - //print_pre($objSession->CurrentUser); - if (is_numeric($scope) && $scope > 0) { - $objLinkList->LoadNewItems($attribs); - } - break; - default: - $objLinkList->Clear(); - break; - } /* end of switch */ -} - - -function l_ParseEnv($str = NULL) -{ - global $l_var_list, $objSession, $orderByClause, $objConfig; - - if ($str != NULL) - { - if( substr($str,0,2) == 'l-' ) - { - $str = preg_replace('/^([a-zA-Z]+)-([0-9]+)-(.*)/','\\1\\2-\\3', $str); - } - - $str = substr($str,1); - $pieces = explode("-", $str); - $l_var_list["id"] = $pieces[0]; - $l_var_list["p"] = $pieces[1]; - $l_var_list["rp"] = $pieces[2]; -// $l_var_list['event'] = $pieces[3]; - ResetPage('l'); - } - else - { - $l_var_list["id"] = 0; - $l_var_list["p"] = 1; - $l_var_list["rp"] = 1; -// $l_var_list['event'] = ''; - } -} - -function l_LoadEnv() -{ - global $objSession, $l_var_list; - - $str = $objSession->GetVariable("Env_Link"); - l_ParseEnv($str); -} - -function l_SaveEnv($str="") -{ - global $objSession; - - $str = $objSession->SetVariable("Env_Link",$str); -} - -function l_BuildEnv() -{ - $module_vars = Array('id','p','rp','event'); - return GenerateModuleEnv('l', $module_vars); -} - -function l_BuildEnv_NEW() -{ - $module_vars = Array('id' => 'l_id', 'p' => 'l_Page', 'rp' => 'l_Reviews_Page', 'event' => 'l_event'); - return GenerateModuleEnv_NEW('l', $module_vars); -} - -/* - @description: returns the date of the last modification to the link table - @attrib: _Part:: part of the date to display - @attrib: _local:bool: If set, returns the modified date for the current category (and subcats) - @example: -*/ -function l_link_modified($attribs) -{ - global $objConfig, $objCatList; - $ret=''; - $CachedValue = GetTagCache("inlink","l_link_modified",$attribs,""); - if(strlen($CachedValue)) - { - return $CachedValue; - } - $ado = &GetADODBConnection(); - if(getArrayValue($attribs,'_local') && $objCatList->CurrentCategoryID() != 0) - { - $c = $objCatList->GetItem($objCatList->CurrentCategoryID()); - $catlist = $c->GetSubCatIds(); - - $catwhere = "CategoryId IN (".explode(",",$catlist).")"; - $sql = "SELECT MAX(Modified) as ModDate,MAX(CreatedOn) as NewDate FROM ".GetTablePrefix()."Link "; - $sql .= "INNER JOIN ".GetTablePrefix()."CategoryItems ON (".GetTablePrefix()."Link.ResourceId=".GetTablePrefix()."CategoryItems.ItemResourceId) "; - $sql .= "WHERE $catwhere LIMIT 1"; - } - else - { - $sql = "SELECT MAX(Modified) as ModDate, MAX(CreatedOn) As NewDate FROM ".GetTablePrefix()."Link LIMIT 1"; - } - $rs = $ado->Execute($sql); - if($rs && ! $rs->EOF) - { - $new = $rs->fields["NewDate"]; - $mod = $rs->fields["ModDate"]; - if($new>$mod) $mod = $new; - if($mod) - { - $part = strtolower(getArrayValue($attribs,'_part')); - $ret = $part?ExtractDatePart($part,$mod):LangDate($mod); - } - } - if($ret) SaveTagCache("inlink","l_link_modified",$attribs,"",$ret); - return $ret; -} - -/* - @description: returns the date of the last review for a link - @attrib: _Part:: part of the date to display - @attrib: _LinkId:int: if set, the link to display the review modified date - @example: -*/ -function l_review_modified($attribs) -{ - global $objConfig, $objLinkList; - - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link = $objLinkList->GetItem($LinkId); - } - else - $link = $objLinkList->GetCurrentItem(); - if(is_object($link)) - { - $ado = &GetADODBConnection(); - $ResId = $link->Get("ResourceId"); - $sql = "SELECT MAX(CreatedOn) as ModDate FROM ".GetTablePrefix()."ItemReview WHERE ItemId=$ResId AND Status=1 LIMIT 1"; - $rs = $ado->Execute($sql); - if($rs && ! $rs->EOF) - { - $mod = $rs->fields["ModDate"]; - if($mod) - { - $part = strtolower($attribs["_part"]); - if(strlen($part)) - { - $ret = ExtractDatePart($part,$mod); - } - else - { - $ret = LangDate($mod); - } - } - } - } - return $ret; -} - -/* - @description: returns a link to the link (directory) root category - @attrib: _Category:int: Override the In-Link root category - @attrib: _Template:tpl: The template to link to - @example: -*/ -function l_root_link($attribs = array()) -{ - global $objConfig, $l_var_list_update, $objModules; - - //$RootCat = (int)$objConfig->Get("Link_Root"); - $RootCat = $objModules->GetModuleRoot("In-Link"); - if($RootCat != -1) - $attribs["_category"] = $RootCat; - $l_var_list_update["p"] = ""; - $l_var_list_update["id"] = ""; - $l_var_list_update["cat"] = ""; - $l_var_list_update["rp"] = ""; - - unset($l_var_list_update["p"],$l_var_list_update["id"],$l_var_list_update["cat"],$l_var_list_update["rp"]); - $o = m_template_link($attribs); - unset($l_var_list_update["p"],$l_var_list_update["id"],$l_var_list_update["cat"],$l_var_list_update["rp"]); - - return $o; - -} - -function l_form_load_values($FormName,$IdValue) -{ - global $FormValues, $objLinkList; - - switch($FormName) - { - case "editlink": - $l =& $objLinkList->GetItem($IdValue); - $FormValues[$FormName]["name"] = stripslashes($l->Get("Name")); - $FormValues[$FormName]["url"] = stripslashes($l->Get("Url")); - $FormValues[$FormName]["description"] = stripslashes($l->Get("Description")); - $l->LoadCustomFields(); - if(is_array($l->CustomFields)) - { - foreach($l->CustomFields as $f=>$v) - { - if (is_array($v)) - { - $FormValues[$FormName][$f] = $v; - } - } - } - break; - } -} - -/* - @description: Generates the ACTION property for a FORM tag used by In-Link - @attrib: _Template:tpl: If set, this is the template the form submits to (default is the current template) - @attrib: _Form:: The form name
    Possible Values: -
      -
    • addlink: add a link to the database -
    • addlink_confirm: Confirm for addlink -
    • editlink: Modify an existing link -
    • editlink_confifirm: Confirmation for link modify -
    • l_rate: Form used to rate a link -
    • l_rate_confirm: Confirm for rate link -
    • l_addreview: add a review for a link -
    • l_review_confirm: Review confirmation -
    • l_delete_confirm: Form to confirm link delete (prior to delete) -
    • l_sort_links: Form to sort links and set number of results -
    • l_getting_rated: Form for external rating -
    - @example:
    "> -*/ -function l_form_action($attribs = array()) -{ - global $var_list_update, $var_list, $l_var_list, $l_var_list_update, $objSession, $objLinkList; - - $var_list_update['t'] = getArrayValue($attribs, '_template') ? $attribs['_template'] : $var_list['t']; - - if( is_object($objLinkList) && $objLinkList->CurrentItem ) $l_var_list_update['id'] = $objLinkList->CurrentItem; - - $ret = ''; - $form = strtolower( $attribs['_form'] ); - $url_params = Array(); - - switch($form) - { - case 'addlink': - /* add link needs to be passed in: _CompleteTemplate=... _PendingTemplate=... _DestinationTemplate=... */ - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_add_link', 'DestTemplate' => $attribs['_finishtemplate'] ); - if ( $objSession->HasCatPermission('LINK.ADD.PENDING') ) - { - $url_params['Confirm'] = $attribs[ getArrayValue($attribs, '_confirmpending') ? '_confirmpending' : '_confirm' ]; - $url_params['Action'] = 'l_add_link_confirm'; - } - - if ( $objSession->HasCatPermission('LINK.ADD') ) - { - $url_params['Confirm'] = $attribs['_confirm']; - $url_params['Action'] = 'l_add_link_confirm'; - } - if( !$url_params['Confirm'] ) unset($url_params['Confirm']); - } - break; - - case 'addlink_confirm': - $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t']; - break; - - case 'editlink': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_edit_link', 'DestTemplate' => $attribs['_finishtemplate'] ); - if ( $objSession->HasCatPermission('LINK.MODIFY.PENDING') ) - { - $url_params['Confirm'] = $attribs[ getArrayValue($attribs, '_confirmpending') ? '_confirmpending' : '_confirm' ]; - } - - if ( $objSession->HasCatPermission('LINK.MODIFY') ) - { - $url_params['Confirm'] = $attribs['_confirm']; - } - - if( !$url_params['Confirm'] ) unset($url_params['Confirm']); - l_form_load_values( $form, $l_var_list['id'] ); - } - break; - - case 'editlink_confirm': - $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t']; - break; - - - case 'l_rate': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_rate_link', 'DestTemplate' => $attribs['_finishtemplate'] ); - if ( $objSession->HasCatPermission('LINK.RATE') && getArrayValue($attribs, '_confirm') ) $url_params['Confirm'] = $attribs['_confirm']; - $l_var_list_update['id'] = $objLinkList->CurrentItem; - - if( getArrayValue($attribs, '_duplicate') ) $url_params['Duplicate'] = $attribs['_duplicate']; - } - break; - - case 'l_getting_rated': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_rate_link', 'DestTemplate' => $attribs['_finishtemplate'] ); - if ($objSession->HasCatPermission("LINK.RATE") && getArrayValue($attribs, '_confirm') ) $url_params['Confirm'] = $attribs['_confirm']; - $var_list_update['t'] = 'inlink/rate'; - $l_var_list_update['id'] = $objLinkList->CurrentItem; - if( getArrayValue($attribs, '_duplicate') ) $url_params['Duplicate'] = $attribs['_duplicate']; - } - break; - - case 'l_sort_links': - $url_params = Array('Action' => 'l_sort_links'); - break; - - case 'l_rate_confirm': - $l_var_list_update['id'] = $objLinkList->CurrentItem; - $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t']; - break; - - case 'l_addreview': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_add_review', 'DestTemplate' => $attribs['_finishtemplate'] ); - $l_var_list_update['id'] = $objLinkList->CurrentItem; - - if ( $objSession->HasCatPermission('LINK.REVIEW.PENDING') ) - { - $url_params['Confirm'] = $attribs[ getArrayValue($attribs, '_confirmpending') ? '_confirmpending' : '_confirm' ]; - } - - if ( $objSession->HasCatPermission('LINK.REVIEW') ) $url_params['Confirm'] = $attribs['_confirm']; - if( !$url_params['Confirm'] ) unset($url_params['Confirm']); - } - break; - - case 'l_review_confirm': - $l_var_list_update["id"] = $objLinkList->CurrentItem; - $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t']; - break; - - case 'l_delete_confirm': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - if( getArrayValue($attribs, '_accept_template') ) $url_params['DestYes'] = $attribs['_accepttemplate']; - if( getArrayValue($attribs, '_declinetemplate') ) $url_params['DestNo'] = $attribs['_declinetemplate']; - } - break; - } - - $ret = HREF_Wrapper('', $url_params); - unset($var_list_update['t']); - return $ret; -} - -/* - @description: returns a list of links - @attrib: _CatId:int: Override the current category - @attrib: _useroot:bool: If set, the current category is changed to In-Link's root category - @attrib: _ShortList:bool: If set, the Perpage_Links_Short setting is used instead of Perpage_links - @attrib: _Paging:bool: If set to 0 or false, paging will not be allowed for this list (only one paging list is allowed per item type per page load) - @attrib: _maxcount:int: If paging is not used on this list, this value determines how many items to load - @attrib: _ListType::Determines the type of list to generate
    - Possible values:
      -
    • Category: List links from the current category (default) -
    • Top: Most Popular & highest rated links -
    • Pop: Most Popular links -
    • New: List new links -
    • Hot: List links with the most click-throughs -
    • Pick: List editor's picks -
    • myitems: List topics created by the current user -
    • favorites: List topics marked as favorites by the current user -
    • search: List search results -
    - @attrib: _FirstItemTemplate:tpl: Template used for the first link listed - @attrib: _LastItemTemplate:tpl: Template used for the last link listed - @attrib: _EdItemTemplate:tpl: Editors Pick template used for link list items - @attrib: _ItemTemplate:tpl: default template used for link list items - @attrib: _notable:bool: if not 0, a table is used to contain the link list (any extra HTML attributes are used for the table tag) - @attrib: _Columns:int: the number of columns to use for table (defaults to 1) - @example: -*/ -function l_list_links($attribs = array()) -{ - global $objConfig, $objSession, $var_list, $l_var_list, $objLinkList, $objCatList, $content_set; - - if(strlen($attribs["_itemtemplate"])==0) - { - $content_set = 0; - return "ERROR -1"; - } - - $CatId = getArrayValue($attribs,'_catid'); - if (!is_numeric($CatId)) { - $CatId = $objCatList->CurrentCategoryID(); - } - - if ((int)getArrayValue($attribs,'_useroot')) { - $CatId = (int)$objConfig->Get("Link_Root"); - } - - $ListType = getArrayValue($attribs,'_listtype'); - - if (!$ListType) $ListType = 'category'; - - if ($ListType != "search") { - $evar = $evar = $_GET["env"]; //m_BuildEnv().$objSession->GetVariable("Env_Link"); - - $tagname = "l_list_links-".$ListType."-".(int)$attribs["_shortlist"]; - $CachedList = GetTagCache("inlink",$tagname,$attribs,$evar); - if($CachedList) return $CachedList; - } - - if ( ($attribs['_shortlist'] == 1) && $objConfig->Get('Perpage_Links_Short') ) { - $objLinkList->PerPageVar = 'Perpage_Links_Short'; - } - else { - $objLinkList->PerPageVar = 'Perpage_Links'; - } - - //echo "PerPage ".$objLinkList->PerPageVar."
    "; - //echo "ListType: ".$objLinkList->ListType." Passed: $ListType
    "; - if($objLinkList->ListType != $ListType) - { - LoadLinkList($attribs); - } - - $cols = (int)getArrayValue($attribs,'_columns'); - if (!$cols) $cols = 1; - - //echo "Items: ".$objLinkList->NumItems()."
    "; - - if ($objLinkList->NumItems() == 0) { - - $content_set = 0; - return language('lu_no_links'); - } - - $html_attribs = ExtraAttributes($attribs); - $o=""; - $notable = (getArrayValue($attribs,'_notable')!="0"); - - if(!$notable) - { - $max_links = $objConfig->Get($objLinkList->PerPageVar); - - $items_to_print = $objLinkList->NumItems()>$max_links ? $max_links : $objLinkList->NumItems(); - - if($cols==0) - $cols = 1; - $per_row = ceil($items_to_print/$cols); - $count = 0; - $row = 0; - $total = 1; - $o=""; - $o .= ""; - } - $o .= "\n
    "; - foreach($objLinkList->Items as $index => $link) - { - $parsed = 0; - $objLinkList->CurrentItem = $index; - if($count==$per_row) - { - $o .= ""; - $count=0; - } - if($row==0 && getArrayValue($attribs,'_firstitemtemplate') ) - { - $o .= $link->ParseTemplate($attribs['_firstitemtemplate']); - $parsed = 1; - } - if($row==$objLinkList->NumItems()-1 && !$parsed && getArrayValue($attribs,'_lastitemtemplate') ) - { - $o .= $link->ParseTemplate($attribs['_lastitemtemplate']); - $parsed = 1; - } - if(!$parsed) - { - if (getArrayValue($attribs, '_editemtemplate') && (int)$link->Get('EditorsPick')) - { - $o .= $link->ParseTemplate($attribs["_editemtemplate"]); - } - else - { - $o .= $link->ParseTemplate($attribs['_itemtemplate']); - } - } - $row++; - $count++; - $total++; - - if ($total>$max_links) break; - } - $objLinkList->SetCurrentItem(); - - if($count != $per_row) { - $o .= "
    \n"; - } - else - { - $keywords = $objSession->GetVariable("Search_Keywords"); - - $links_showed = 0; //nl - $max_links = $objConfig->Get($objLinkList->PerPageVar); //nl - //echo "MaxLinks: $max_links
    "; - foreach($objLinkList->Items as $index => $link) - { - //echo "
    "; print_r($link); echo "
    "; - $show = 1; - /* if ($keywords) { - if (strstr(strip_tags(strtolower($link->Data['Name'])), strtolower($keywords)) || strstr(strip_tags(strtolower($link->Data['Description'])), strtolower($keywords))) { - $show = 1; - } - } - else { - $show = 1; - }*/ - - if ($show == 1) { - - $parsed = 0; - $objLinkList->CurrentItem = $index; - if($row==0 && strlen($attribs["_firstitemtemplate"])) - { - $o .= $link->ParseTemplate($attribs["_firstitemtemplate"]); - $parsed = 1; - } - if($row==$objLinkList->NumItems()-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0) - { - $o .= $link->ParseTemplate($attribs["_lastitemtemplate"]); - $parsed = 1; - } - if(!$parsed) - { - if (getArrayValue($attribs, '_editemtemplate') && (int)$link->Get('EditorsPick')) - { - $o .= $link->ParseTemplate($attribs["_editemtemplate"]); - } - else - { - $o .= $link->ParseTemplate($attribs['_itemtemplate']); - } - } - - $links_showed++; // nl - if($links_showed == $max_links) break; //nl - } - } - $objLinkList->SetCurrentItem(); - } - $o.="\n"; - if(strlen($o)) - SaveTagCache("inlink",$tagname,$attribs,$evar,$o); - - global $l_var_list_update; - $l_var_list_update = array(); - return $o; -} - - -/* - @description: Used in conjuction with l_list_links. Returns the number if links in the list - @attrib: _CatId:int: Override the current category - @attrib: _useroot:bool: If set, the current category is changed to In-Link's root category - - @attrib: _ListType::Determines the type of list to generate
    - Possible values:
      -
    • Category: List links from the current category (default) -
    • Hot: Hot Links (Most Popular & highest rated links) -
    • Pop: Most Popular links -
    • New: List new links -
    • Hot: List links with the most click-throughs -
    • Pick: List editor's picks -
    • myitems: List topics created by the current user -
    • favorites: List topics marked as favorites by the current user -
    • search: List search results -
    - - @example: -*/ -function l_list_count($attribs = array()) -{ - global $objConfig, $objLinkList, $objCatList, $objSession; - - $CatId = getArrayValue($attribs,'_catid'); - if(!is_numeric($CatId)) - $CatId = $objCatList->CurrentCategoryID(); - - if((int)getArrayValue($attribs,'_useroot')) - $CatId = (int)$objConfig->Get("Link_Root"); - - $ListType = getArrayValue($attribs,'_listtype'); - if(!strlen($ListType)) - $ListType="category"; - - if ( ($attribs['_shortlist']) && $objConfig->Get('Perpage_Links_Short') ) { - $objLinkList->PerPageVar = 'Perpage_Links_Short'; - } - else { - $objLinkList->PerPageVar = 'Perpage_Links'; - } - - if(!getArrayValue($attribs,'_today')) - { - if($objLinkList->ListType != $ListType) - { - LoadLinkList($attribs); - } - $o = 0; - $keywords = $objSession->GetVariable("Search_Keywords"); - if ($keywords) { -// foreach ($objLinkList->Items as $cat) { - // if (strstr(strip_tags(strtolower($cat->Data['Name'])), strtolower($keywords)) || strstr(strip_tags(strtolower($cat->Data['Description'])), strtolower($keywords))) { - // $o++; - // } -// } -// echo "Counted: $o


    "; -// echo "Reasly: ".$objLinkList->QueryItemCount."


    "; -// } -// else { - $o = $objLinkList->QueryItemCount; - } - $o = $objLinkList->QueryItemCount; // only use when no highlighting issued - } - else - { - $o = $objLinkList->PerformItemCount($attribs); - } - - if ($o == '') { - $o = 0; - } - return $o; -} - - -/* - @description: Used in conjuction with l_list_links. This function generates the page navigation - for the list. If this tag is called before the list tag, this function will load - the links. For that reason, the _ListType attribute is required if the pagnav - tag preceeds the l_list_links tag in the template. Generally, it is good practice to - duplicate all attributes set for l_list_links. - @attrib: _PagesToList:int: Number of pages to list (default is 10) - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for links - @attrib: _label:lang: language tag to include in the output if there are pages to list. If there are no pages listed, this text will not be included (resulting in an empty output) - @attrib: _ListType::Determines the type of list to generate
    - Possible values:
      -
    • Category: List links from the current category (default) -
    • Hot: Hot Links (Most Popular & highest rated links) -
    • Pop: Most Popular links -
    • New: List new links -
    • Hot: List links with the most click-throughs -
    • Pick: List editor's picks -
    • myitems: List topics created by the current user -
    • favorites: List topics marked as favorites by the current user -
    • search: List search results -
    - -*/ -function l_link_pagenav($attribs = array()) -{ - global $objLinkList, $objCatList, $objSession, $objConfig; - - $DestTemplate = getArrayValue($attribs,'_template'); - $PagesToList = getArrayValue($attribs,'_pagestolist'); - $image = getArrayValue($attribs,'_PageIcon'); - if(!is_numeric($PagesToList)) - $PagesToList = 10; - - $CatId = getArrayValue($attribs,'_catid'); - if(!is_numeric($CatId)) - $CatId = $objCatList->CurrentCategoryID(); - - if ( ($attribs['_shortlist'] == 1) && $objConfig->Get('Perpage_Links_Short') ) { - $objLinkList->PerPageVar = 'Perpage_Links_Short'; - } - else { - $objLinkList->PerPageVar = 'Perpage_Links'; - } - - - $ListType = getArrayValue($attribs,'_listtype'); - if(!strlen($ListType)) - $ListType="category"; - - if($objLinkList->ListType != $ListType) { - LoadLinkList($attribs); - } - - $o = $objLinkList->GetPageLinkList($DestTemplate, '', 10, true, '', ExtraAttributes($attribs) ); - if (strlen($image)) { - $o_i = ' '; - } - else - { - $o_i=''; - } - if(strlen($o) && strlen($attribs["_label"])) - $o = $o_i.language($attribs["_label"]).' '.$o; - return $o; -} - -/* - @description: Used in conjuction with l_list_links. This function generates a navigation link which is - used to switch from a short list to a longer list. The page number is not changed. - If this tag is called before the list tag, this function will load the link list. - For that reason, the _ListType attribute is required if the pagnav - tag preceeds the l_list_links tag in the template. Generally, it is good practice to - duplicate all attributes set for l_list_links. - @attrib: _root:bool: If set, the current category is set to In-Link's root category - @attrib: _text:lang: language tag to include as text for the anchor tag - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for links - @attrib: _plaintext:: plain text to include as text for the anchor tag. The _text attribute takes presedence - if both are included. - @attrib: _image:: URL to an image to include inside the anchor tag. -*/ -function l_link_more($attribs = array()) -{ - global $objLinkList, $objConfig, $l_var_list_update, $objSession, $l_CachedList; - - $l_var_list_update['id'] = 0; - - $html_attribs = ExtraAttributes($attribs); - $DestTemplate = $attribs["_template"]; - - if ( ($attribs['_shortlist'] == 1) && $objConfig->Get('Perpage_Links_Short') ) { - $objLinkList->PerPageVar = 'Perpage_Links_Short'; - } - else { - $objLinkList->PerPageVar = 'Perpage_Links'; - } - - $ListType = $attribs["_listtype"]; - if(!strlen($ListType)) - $ListType="category"; - - if($ListType != "search") - { - $evar = $_GET["env"]; //m_BuildEnv().$objSession->GetVariable("Env_Link"); - $tagname = "l_list_links-".$ListType."-".(int)$attribs["_ShortList"]; - $CachedList = GetTagCache("inlink",$tagname,FALSE,$evar); - - if(strlen($CachedList)) - { - $moretag = "l_link_more-".$ListType."-".(int)$attribs["_ShortList"]; - $CachedPageNav = GetTagCache("inlink",$moretag,FALSE,$evar); - if(strlen($CachedPageNav)) - return $CachedPageNav; - } - } - if($objLinkList->ListType != $ListType) - LoadLinkList($attribs); - - if($objLinkList->QueryItemCount > $objConfig->Get($objLinkList->PerPageVar)) - { - if($attribs["_root"]) - { - $url = l_root_link($attribs); - } - else - { - $l_var_list_update["p"]=1; - $url = m_template_link($attribs); - unset($l_var_list_update["p"]); - } - $o = ""; - $text = $attribs["_text"]; - if(!strlen($text)) - { - $text = $attribs["_plaintext"]; - if(!strlen($text)) - { - } - $o .= $text.""; - } - else - $o .= language($text); - if(strlen($attribs["_image"])) - { - $o .= ""; - } - $o .= ""; - } - if(strlen($o) && strlen($CachedList)>0 && strlen($moretag)>0) - SaveTagCache("inlink",$moretag,FALSE,$evar,$o); - return $o; -} - -/* - @description: List items related to the current link - @attrib: _ItemId:int: the link to use (If not set, the current link is used) - @attrib: _ListItems:: List of item types to include (ie: _ListItems="Category,Topic") - @attrib: _*Template:none: For each item type lsted in _ListItems, an item type template must be included - (ie: _CategoryTemplate=".." _TopicTemplate="..") - @example: -*/ -function l_related_items($attribs) -{ - global $objItemTypes, $objLinkList, $objCatList, $content_set; - static $Related; - - global $LinkRelations; - - $id = getArrayValue($attribs,'_itemid'); - if(!is_numeric($id)) - { - $c =& $objLinkList->GetCurrentItem(); - } - else - $c =& $objLinkList->GetItem($id); - - $data_sent=0; - if(is_object($c)) - { - $ResourceId = $c->Get("ResourceId"); - $IncludeList = explode(",",trim(strtolower($attribs["_listitems"]))); - $o = ""; - - if(!is_object($LinkRelations)) - { - //echo "
    "; print_r($c); echo "
    "; - $LinkRelations = new clsMultiTypeList(); - LoadRelatedItems($Related, $LinkRelations,$c->Get("ResourceId")); - } - - if($LinkRelations->NumItems()>0) - { - for($inc=0;$incGetTypeByName($item_type); - if(is_object($objType)) - { - foreach($LinkRelations->Items as $item) - { - if(is_object($item)) - { - if(strtolower($objType->Get("ItemName")) == strtolower($item_type) && $item->type==$objType->Get("ItemType")) - { - if(strlen($item->BasePermissionName)) - { - $perm = $item->BasePermissionName.".VIEW"; - $haspem = $objSession->HasCatPermission($perm,$item->Get("CategoryId")); - } - else - $hasperm = 1; - - if($hasperm) - { - $data_sent =1; - $classname = $objType->Get("ClassName"); - if(strlen($classname)) - { - $l = new $classname; - $l->Data = $item->Data; - $o .= $l->ParseTemplate($t); - } - } - } - } - $item = NULL; - } - } - else - echo $item_type." not found
    \n"; - } - } - if($data_sent) - { - return $o; - } - else - { - $content_set=0; - return ""; - } - } - else - { - $content_set = 0; - return ""; - } - } - else - { - $content_set = 0; - return ""; - } -} - -/* - @description: Returns the number of items related to the current link - @attrib: _ItemId:int: the link to use (If not set, the current link is used) - @attrib: _ItemType:: Name of item to count (ie: _ItemType="Category") - @example: -*/ -function l_related_count($attribs) -{ - global $objItemTypes, $objLinkList, $content_set; - global $LinkRelations; - - $count = 0; - - $id = getArrayValue($attribs,'_itemid'); - if( !is_numeric($id) ) - { - $c =& $objLinkList->GetCurrentItem(); - } - else - { - $c =& $objLinkList->GetItem($id); - } - - if( is_object($c) ) - { - $ResourceId = $c->Get('ResourceId'); - if( !is_object($LinkRelations) ) - { - $LinkRelations = new clsMultiTypeList(); - LoadRelatedItems($Related, $LinkRelations,$c->Get('ResourceId')); - } - - if(strlen($attribs['_itemtype'])) - { - $objType = $objItemTypes->GetTypeByName($item_type); - $TargetType = is_object($objType) ? $objType->Get('ItemType') : ''; - } - - if( $LinkRelations->NumItems() > 0 ) - { - for($x=0;$x<$LinkRelations->NumItems();$x++) - { - $a = $LinkRelations->GetItemByIndex($x); - if($a->type == $TargetType || !strlen($TargetType)) $count++; - } - } - } - return $count; -} - -/* - @description: Returns a list of reviews for a link - @attrib: _LinkId:int: the link to use (If not set, the current link is used) - @attrib: _maxcount:int: Maximum number of reviews to list (defaults to all) - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for link reviews - @attrib: _ReviewTemplate:tpl: template used to display the reviews -*/ -function l_list_reviews($attribs = array()) -{ - global $objLinkList,$content_set, $l_var_list; - - $max = (int)$attribs["_maxcount"]; - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link =& $objLinkList->GetItem($LinkId); - } - else - $link =& $objLinkList->GetCurrentItem(); - - if(is_object($link)) - { - if($link->ReviewsLoaded()==0) - { - if($attribs["_shortlist"]) - { - $link->ReviewPerPageVar = "Perpage_LinkReviews_Short"; - } - else - { - $link->ReviewPerPageVar = "Perpage_LinkReviews"; - } - $ReviewList =& $link->GetItemReviews($l_var_list["rp"]); - } - else - $ReviewList =& $link->Reviews; - - $o = ""; - $t = $attribs["_reviewtemplate"]; - if($ReviewList->NumItems()>0 && strlen($t)) - { - foreach($ReviewList->Items as $r) - { - if($i >= $max && $max>0) - break; - - $o .= $r->ParseTemplate($t); - $i++; - } - } - } - if(!strlen($o)) - $content_set =0; - return $o; -} - -/* - @description: Used in conjuction with l_list_reviews. This function generates a navigation link which is - used to switch from a short list to a longer list. The page number is not changed. - If this tag is called before the list tag, this function will load the review list. - Any extra HTML attributes are passed to the anchor tag used to create the link. - @attrib: _LinkId:int: If set, the this value is used for a link ID (default to the current link) - @attrib: _root:bool: If set, the current category is set to In-Link's root category - @attrib: _text:lang: language tag to include as text for the anchor tag - @attrib: _Template:tpl: Destination template of More link - @attrib: _plaintext:: plain text to include as text for the anchor tag. The _text attribute takes presedence - if both are included. - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for link reviews - @attrib: _image:: URL to an image to include inside the anchor tag. -*/ -function l_review_more($attribs) -{ - global $objLinkList, $objConfig, $l_var_list_update, $l_var_list; - - $html_attribs = ExtraAttributes($attribs); - $DestTemplate = $attribs["_template"]; - - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link =& $objLinkList->GetItem($LinkId); - } - else - $link =& $objLinkList->GetCurrentItem(); - - if(is_object($link)) - { - if($link->ReviewsLoaded()==0) - { - if($attribs["_shortlist"]) - { - $link->ReviewPerPageVar = "Perpage_LinkReviews_Short"; - } - else - { - $link->ReviewPerPageVar = "Perpage_LinkReviews"; - } - $ReviewList =& $link->GetItemReviews($l_var_list["rp"]); - } - else - $ReviewList =& $link->Reviews; - - if($ReviewList->ItemCount() < $ReviewList->QueryItemCount) - { - if($attribs["_root"]) - { - $url = l_root_link($attribs); - } - else - { - $l_var_list_update['id'] = $l_var_list['id']; - $url = m_template_link($attribs); - } - $o = ""; - $text = $attribs["_text"]; - if(!strlen($text)) - { - $text = $attribs["_plaintext"]; - if(!strlen($text)) - { - } - $o .= $text.""; - } - else - $o .= language($text); - if(strlen($attribs["_image"])) - { - $o .= ""; - } - $o .= ""; - } - } - return $o; -} - -/* - @description: Used in conjuction with l_list_reviews. This function generates the page navigation - for the list of reviews. If this tag is called before the list tag, this function will load - the reviews. For that reason, the _ListType attribute is required if the pagnav - tag preceeds the l_list_reviews tag in the template. Generally, it is good practice to - duplicate all attributes set for l_list_reviews. - @attrib: _PagesToList:int: Number of pages to list (default is 10) - @attrib: _Template:tpl: destination template for page links (defaults to current template) - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for link reviews - @attrib: _LinkId:int: If set, the this value is used for a link ID (default to the current link) - @attrib: _label:lang: language tag to include in the output if there are pages to list. If there are no pages - listed, this text will not be included (resulting in an empty output) -*/ -function l_review_pagenav($attribs) -{ - global $l_var_list, $l_var_list_update, $objLinkList; - - $DestTemplate = $attribs["_template"]; - $PagesToList = $attribs["_pagestolist"]; - if(!is_numeric($PagesToList)) - $PagesToList = 10; - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link =& $objLinkList->GetItem($LinkId); - } - else - $link =& $objLinkList->GetCurrentItem(); - - if(is_object($link)) - { - if($link->ReviewsLoaded()==0) - { - if($attribs["_shortlist"]) - { - $link->ReviewPerPageVar = "Perpage_LinkReviews_Short"; - } - else - { - $link->ReviewPerPageVar = "Perpage_LinkReviews"; - } - $ReviewList =& $link->GetItemReviews($l_var_list["rp"]); - } - else - $ReviewList =& $link->Reviews; - $o = $ReviewList->GetPageLinkList($l_var_list_update,$DestTemplate); - } - if(strlen($o) && strlen($attribs["_label"])) - $o = language($attribs["_label"]).$o; - return $o; -} - -/* - @description: Parse a link item template - @attrib: _ItemTemplate:tpl: Link template to parse - @attrib: _LinkId:int: Link ID to parse (uses current link if not set) -*/ -function l_link_detail($attribs = array()) -{ - global $objLinkList; - - $t = $attribs["_itemtemplate"]; - if(strlen($t)) - { - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link = $objLinkList->GetItem($LinkId); - } - else - $link = $objLinkList->GetCurrentItem(); - if(is_object($link)) - { - $o = $link->ParseTemplate($t); - } - } - return $o; -} - - /* - @description: Parse a link field and return the value - @attrib: _Field:: Link field to parse - @attrib: _LinkId:int: Link ID to parse (uses current link if not set) - */ - function l_link_field($attribs = array()) - { - global $objLinkList; - - $o = ""; - $field = $attribs["_field"]; - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link = $objLinkList->GetItem($LinkId); - } - else - { - $link = $objLinkList->GetCurrentItem(); - } - - if(strlen($field)) - { - if(is_object($link)) - { - $element = new clsHtmlTag(); - $element->name = $link->TagPrefix; - $element->attributes = $attribs; - $o = $link->ParseObject($element); - } - else - $o = ""; - } - - if (substr($o, 0, 9) == "Undefined") { - $attrib = Array(); - $attrib['_template'] = "error_template"; - $attrib['_unsecure'] = 1; - $location = m_template_link($attrib); - Header("Location: $location"); - } - - return $o; - } - - function l_multiple_submit($params=Array()) - { - global $objCatList,$objConfig,$objModules; - $ret=''; - $root_cat_name=language($objConfig->Get('Root_Name')); - $selected_tpl=''.$root_cat_name.'>'."%2\$s".''; - if(getArrayValue($_POST,'cat_ids')) - { - foreach ($_POST['cat_ids'] as $cat_id) - { - $that_cat =& $objCatList->GetItem($cat_id); - $ret.=sprintf($selected_tpl,$cat_id,$that_cat->GetNavbar()); - } - } - - - $ret .= ''; - $suggest_cat_id=isset($_POST['suggest_cat_id'])?$_POST['suggest_cat_id']:$objCatList->CurrentCategoryID(); - $suggest_cat=$objCatList->GetItem($suggest_cat_id); - - $ret.=$root_cat_name.' > '.$suggest_cat->GetNavbar().'  - - - '; - - - - return $ret; - - } - - function l_home_cat() - { - global $objConfig; - return language($objConfig->Get('Root_Name')); - } - - function l_show_listings($params) - { - global $FormValues, $objConfig; - $html_attribs = ExtraAttributes($params); - $form = $params['_form']; - $field = strtolower($params['_field']); - - if (isset($_POST[$field])) { - $value = $_POST[$field]; - } - elseif ( getArrayValue($FormValues, $form, $field) ) { - $value = $FormValues[$form][$field]; - } - - $sql = 'SELECT Name, ListingTypeId FROM '.TABLE_PREFIX.'ListingTypes ORDER BY Name'; - - $application =& kApplication::Instance(); - $db =& $application->GetADODBConnection(); - $options = $db->GetCol($sql, 'ListingTypeId'); - - if ($objConfig->Get('Link_AllowFreeListings')) { - $options = array_merge_recursive2(Array('' => language('lu_free_listing') ), $options); - } - - if (!isset($value)) { - list($option_key, $option_title) = each($options); - $value = $option_key; - } - - $ret = ''; - $tag_params = Array('name' => $params['_render_as']); - foreach ($options as $option_key => $option_title) { - $tag_params['IsSelected'] = $option_key == $value; - $tag_params['ListingTypeId'] = $option_key; - $tag_params['ListingTypeName'] = $option_title; - $tag_params['IsFree'] = $option_key ? 0 : 1; - $tag_params['DetailsLink'] = $application->HREF($params['_moreinfotemplate'], '', Array('listing_type' => $option_key, 'pass' => 'm') ); - $ret .= $application->ParseBlock($tag_params); - } - return $ret; - } - -?> Index: branches/unlabeled/unlabeled-1.7.26/in-link/admin/advanced_view.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.7.26/in-link/admin/advanced_view.php (revision 12746) +++ branches/unlabeled/unlabeled-1.7.26/in-link/admin/advanced_view.php (revision 0) @@ -1,63 +0,0 @@ - - - - - Index: branches/unlabeled/unlabeled-1.47.2/in-link/parser.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.47.2/in-link/parser.php (revision 12746) +++ branches/unlabeled/unlabeled-1.47.2/in-link/parser.php (revision 0) @@ -1,1409 +0,0 @@ -GetVariable("LinkListType"); - $LastShortType = $objSession->GetVariable("LinkShortList"); - $NoPaging = (getArrayValue($attribs,'_paging')=='0' || getArrayValue($attribs,'_paging')=='false'); - if(!$NoPaging && !strlen($PagingList)) - { - $PagingList=$ListType; - } - //echo "Last: $LastList, Short: $LastShortType Current: $ListType, Short:".$attribs["_shortlist"]." PageList: $PagingList
    \n"; - - if($ListType==$PagingList) - { - $objLinkList->EnablePaging = TRUE; - //echo "Last: $LastList, Short: $LastShortType Current: $ListType, Short:".$attribs["_shortlist"]."
    \n"; - if($LastList != $ListType || $LastShortType != $attribs["_shortlist"]) - { - //echo "Resetting Page..
    \n"; - $l_var_list_update["p"] = 1; - $l_var_list["p"] = 1; - $objSession->SetVariable("LinkListType",$ListType); - $objSession->SetVariable("LinkShortList",$attribs["_shortlist"]); - $objLinkList->Page = 1; - } - else - $objLinkList->Page=$l_var_list["p"]; - } - else - { - if(is_numeric(getArrayValue($attribs,'_maxcount'))) - { - $objLinkList->MaxListCount = $attribs["_maxcount"]; - } - else { - $objLinkList->MaxListCount = 10; - } - - $objLinkList->EnablePaging = FALSE; - } - $objLinkList->ListType=$ListType; - - switch($ListType) - { - case "category": - $objLinkList->LoadListCategory($attribs); - break; - case "myitems": - $objLinkList->LoadMyItems($attribs); - break; - case "hot": - $objLinkList->LoadHotItems($attribs); - break; - case "pop": - $objLinkList->LoadPopItems($attribs); - break; - case "pick": - $objLinkList->LoadPickItems($attribs); - break; - case "favorites": - $objLinkList->LoadFavorites($attribs); - break; - case "search": - $attribs['multiple'] = 'links'; - $objLinkList->LoadSearchItems($attribs); - break; - case "new": - $objLinkList->LoadNewItems($attribs); - break; - case "my_new": - $scope = $objSession->CurrentUser->Vars["LastLogin"]; - $attribs["_scope"] = $scope; - $attribs["_show_since_last"] = 1; - //print_pre($objSession->CurrentUser); - if (is_numeric($scope) && $scope > 0) { - $objLinkList->LoadNewItems($attribs); - } - break; - default: - $objLinkList->Clear(); - break; - } /* end of switch */ -} - - -function l_ParseEnv($str = NULL) -{ - global $l_var_list, $objSession, $orderByClause, $objConfig; - - if ($str != NULL) - { - if( substr($str,0,2) == 'l-' ) - { - $str = preg_replace('/^([a-zA-Z]+)-([0-9]+)-(.*)/','\\1\\2-\\3', $str); - } - - $str = substr($str,1); - $pieces = explode("-", $str); - $l_var_list["id"] = $pieces[0]; - $l_var_list["p"] = $pieces[1]; - $l_var_list["rp"] = $pieces[2]; -// $l_var_list['event'] = $pieces[3]; - ResetPage('l'); - } - else - { - $l_var_list["id"] = 0; - $l_var_list["p"] = 1; - $l_var_list["rp"] = 1; -// $l_var_list['event'] = ''; - } -} - -function l_LoadEnv() -{ - global $objSession, $l_var_list; - - $str = $objSession->GetVariable("Env_Link"); - l_ParseEnv($str); -} - -function l_SaveEnv($str="") -{ - global $objSession; - - $str = $objSession->SetVariable("Env_Link",$str); -} - -function l_BuildEnv() -{ - $module_vars = Array('id','p','rp','event'); - return GenerateModuleEnv('l', $module_vars); -} - -function l_BuildEnv_NEW() -{ - $module_vars = Array('id' => 'l_id', 'p' => 'l_Page', 'rp' => 'l_Reviews_Page', 'event' => 'l_event'); - return GenerateModuleEnv_NEW('l', $module_vars); -} - -/* - @description: returns the date of the last modification to the link table - @attrib: _Part:: part of the date to display - @attrib: _local:bool: If set, returns the modified date for the current category (and subcats) - @example: -*/ -function l_link_modified($attribs) -{ - global $objConfig, $objCatList; - $ret=''; - $CachedValue = GetTagCache("inlink","l_link_modified",$attribs,""); - if(strlen($CachedValue)) - { - return $CachedValue; - } - $ado = &GetADODBConnection(); - if(getArrayValue($attribs,'_local') && $objCatList->CurrentCategoryID() != 0) - { - $c = $objCatList->GetItem($objCatList->CurrentCategoryID()); - $catlist = $c->GetSubCatIds(); - - $catwhere = "CategoryId IN (".explode(",",$catlist).")"; - $sql = "SELECT MAX(Modified) as ModDate,MAX(CreatedOn) as NewDate FROM ".GetTablePrefix()."Link "; - $sql .= "INNER JOIN ".GetTablePrefix()."CategoryItems ON (".GetTablePrefix()."Link.ResourceId=".GetTablePrefix()."CategoryItems.ItemResourceId) "; - $sql .= "WHERE $catwhere LIMIT 1"; - } - else - { - $sql = "SELECT MAX(Modified) as ModDate, MAX(CreatedOn) As NewDate FROM ".GetTablePrefix()."Link LIMIT 1"; - } - $rs = $ado->Execute($sql); - if($rs && ! $rs->EOF) - { - $new = $rs->fields["NewDate"]; - $mod = $rs->fields["ModDate"]; - if($new>$mod) $mod = $new; - if($mod) - { - $part = strtolower(getArrayValue($attribs,'_part')); - $ret = $part?ExtractDatePart($part,$mod):LangDate($mod); - } - } - if($ret) SaveTagCache("inlink","l_link_modified",$attribs,"",$ret); - return $ret; -} - -/* - @description: returns the date of the last review for a link - @attrib: _Part:: part of the date to display - @attrib: _LinkId:int: if set, the link to display the review modified date - @example: -*/ -function l_review_modified($attribs) -{ - global $objConfig, $objLinkList; - - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link = $objLinkList->GetItem($LinkId); - } - else - $link = $objLinkList->GetCurrentItem(); - if(is_object($link)) - { - $ado = &GetADODBConnection(); - $ResId = $link->Get("ResourceId"); - $sql = "SELECT MAX(CreatedOn) as ModDate FROM ".GetTablePrefix()."ItemReview WHERE ItemId=$ResId AND Status=1 LIMIT 1"; - $rs = $ado->Execute($sql); - if($rs && ! $rs->EOF) - { - $mod = $rs->fields["ModDate"]; - if($mod) - { - $part = strtolower($attribs["_part"]); - if(strlen($part)) - { - $ret = ExtractDatePart($part,$mod); - } - else - { - $ret = LangDate($mod); - } - } - } - } - return $ret; -} - -/* - @description: returns a link to the link (directory) root category - @attrib: _Category:int: Override the In-Link root category - @attrib: _Template:tpl: The template to link to - @example: -*/ -function l_root_link($attribs = array()) -{ - global $objConfig, $l_var_list_update, $objModules; - - //$RootCat = (int)$objConfig->Get("Link_Root"); - $RootCat = $objModules->GetModuleRoot("In-Link"); - if($RootCat != -1) - $attribs["_category"] = $RootCat; - $l_var_list_update["p"] = ""; - $l_var_list_update["id"] = ""; - $l_var_list_update["cat"] = ""; - $l_var_list_update["rp"] = ""; - - unset($l_var_list_update["p"],$l_var_list_update["id"],$l_var_list_update["cat"],$l_var_list_update["rp"]); - $o = m_template_link($attribs); - unset($l_var_list_update["p"],$l_var_list_update["id"],$l_var_list_update["cat"],$l_var_list_update["rp"]); - - return $o; - -} - -function l_form_load_values($FormName,$IdValue) -{ - global $FormValues, $objLinkList; - - switch($FormName) - { - case "editlink": - $l =& $objLinkList->GetItem($IdValue); - $FormValues[$FormName]["name"] = stripslashes($l->Get("Name")); - $FormValues[$FormName]["url"] = stripslashes($l->Get("Url")); - $FormValues[$FormName]["description"] = stripslashes($l->Get("Description")); - $l->LoadCustomFields(); - if(is_array($l->CustomFields)) - { - foreach($l->CustomFields as $f=>$v) - { - if (is_array($v)) - { - $FormValues[$FormName][$f] = $v; - } - } - } - break; - } -} - -/* - @description: Generates the ACTION property for a FORM tag used by In-Link - @attrib: _Template:tpl: If set, this is the template the form submits to (default is the current template) - @attrib: _Form:: The form name
    Possible Values: -
      -
    • addlink: add a link to the database -
    • addlink_confirm: Confirm for addlink -
    • editlink: Modify an existing link -
    • editlink_confifirm: Confirmation for link modify -
    • l_rate: Form used to rate a link -
    • l_rate_confirm: Confirm for rate link -
    • l_addreview: add a review for a link -
    • l_review_confirm: Review confirmation -
    • l_delete_confirm: Form to confirm link delete (prior to delete) -
    • l_sort_links: Form to sort links and set number of results -
    • l_getting_rated: Form for external rating -
    - @example:
    "> -*/ -function l_form_action($attribs = array()) -{ - global $var_list_update, $var_list, $l_var_list, $l_var_list_update, $objSession, $objLinkList; - - $var_list_update['t'] = getArrayValue($attribs, '_template') ? $attribs['_template'] : $var_list['t']; - - if( is_object($objLinkList) && $objLinkList->CurrentItem ) $l_var_list_update['id'] = $objLinkList->CurrentItem; - - $ret = ''; - $form = strtolower( $attribs['_form'] ); - $url_params = Array(); - - switch($form) - { - case 'addlink': - /* add link needs to be passed in: _CompleteTemplate=... _PendingTemplate=... _DestinationTemplate=... */ - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_add_link', 'DestTemplate' => $attribs['_finishtemplate'] ); - if ( $objSession->HasCatPermission('LINK.ADD.PENDING') ) - { - $url_params['Confirm'] = $attribs[ getArrayValue($attribs, '_confirmpending') ? '_confirmpending' : '_confirm' ]; - $url_params['Action'] = 'l_add_link_confirm'; - } - - if ( $objSession->HasCatPermission('LINK.ADD') ) - { - $url_params['Confirm'] = $attribs['_confirm']; - $url_params['Action'] = 'l_add_link_confirm'; - } - if( !$url_params['Confirm'] ) unset($url_params['Confirm']); - } - break; - - case 'addlink_confirm': - $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t']; - break; - - case 'editlink': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_edit_link', 'DestTemplate' => $attribs['_finishtemplate'] ); - if ( $objSession->HasCatPermission('LINK.MODIFY.PENDING') ) - { - $url_params['Confirm'] = $attribs[ getArrayValue($attribs, '_confirmpending') ? '_confirmpending' : '_confirm' ]; - } - - if ( $objSession->HasCatPermission('LINK.MODIFY') ) - { - $url_params['Confirm'] = $attribs['_confirm']; - } - - if( !$url_params['Confirm'] ) unset($url_params['Confirm']); - l_form_load_values( $form, $l_var_list['id'] ); - } - break; - - case 'editlink_confirm': - $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t']; - break; - - - case 'l_rate': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_rate_link', 'DestTemplate' => $attribs['_finishtemplate'] ); - if ( $objSession->HasCatPermission('LINK.RATE') && getArrayValue($attribs, '_confirm') ) $url_params['Confirm'] = $attribs['_confirm']; - $l_var_list_update['id'] = $objLinkList->CurrentItem; - - if( getArrayValue($attribs, '_duplicate') ) $url_params['Duplicate'] = $attribs['_duplicate']; - } - break; - - case 'l_getting_rated': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_rate_link', 'DestTemplate' => $attribs['_finishtemplate'] ); - if ($objSession->HasCatPermission("LINK.RATE") && getArrayValue($attribs, '_confirm') ) $url_params['Confirm'] = $attribs['_confirm']; - $var_list_update['t'] = 'inlink/rate'; - $l_var_list_update['id'] = $objLinkList->CurrentItem; - if( getArrayValue($attribs, '_duplicate') ) $url_params['Duplicate'] = $attribs['_duplicate']; - } - break; - - case 'l_sort_links': - $url_params = Array('Action' => 'l_sort_links'); - break; - - case 'l_rate_confirm': - $l_var_list_update['id'] = $objLinkList->CurrentItem; - $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t']; - break; - - case 'l_addreview': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_add_review', 'DestTemplate' => $attribs['_finishtemplate'] ); - $l_var_list_update['id'] = $objLinkList->CurrentItem; - - if ( $objSession->HasCatPermission('LINK.REVIEW.PENDING') ) - { - $url_params['Confirm'] = $attribs[ getArrayValue($attribs, '_confirmpending') ? '_confirmpending' : '_confirm' ]; - } - - if ( $objSession->HasCatPermission('LINK.REVIEW') ) $url_params['Confirm'] = $attribs['_confirm']; - if( !$url_params['Confirm'] ) unset($url_params['Confirm']); - } - break; - - case 'l_review_confirm': - $l_var_list_update["id"] = $objLinkList->CurrentItem; - $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t']; - break; - - case 'l_delete_confirm': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - if( getArrayValue($attribs, '_accept_template') ) $url_params['DestYes'] = $attribs['_accepttemplate']; - if( getArrayValue($attribs, '_declinetemplate') ) $url_params['DestNo'] = $attribs['_declinetemplate']; - } - break; - } - - $ret = HREF_Wrapper('', $url_params); - unset($var_list_update['t']); - return $ret; -} - -/* - @description: returns a list of links - @attrib: _CatId:int: Override the current category - @attrib: _useroot:bool: If set, the current category is changed to In-Link's root category - @attrib: _ShortList:bool: If set, the Perpage_Links_Short setting is used instead of Perpage_links - @attrib: _Paging:bool: If set to 0 or false, paging will not be allowed for this list (only one paging list is allowed per item type per page load) - @attrib: _maxcount:int: If paging is not used on this list, this value determines how many items to load - @attrib: _ListType::Determines the type of list to generate
    - Possible values:
      -
    • Category: List links from the current category (default) -
    • Top: Most Popular & highest rated links -
    • Pop: Most Popular links -
    • New: List new links -
    • Hot: List links with the most click-throughs -
    • Pick: List editor's picks -
    • myitems: List topics created by the current user -
    • favorites: List topics marked as favorites by the current user -
    • search: List search results -
    - @attrib: _FirstItemTemplate:tpl: Template used for the first link listed - @attrib: _LastItemTemplate:tpl: Template used for the last link listed - @attrib: _EdItemTemplate:tpl: Editors Pick template used for link list items - @attrib: _ItemTemplate:tpl: default template used for link list items - @attrib: _notable:bool: if not 0, a table is used to contain the link list (any extra HTML attributes are used for the table tag) - @attrib: _Columns:int: the number of columns to use for table (defaults to 1) - @example: -*/ -function l_list_links($attribs = array()) -{ - global $objConfig, $objSession, $var_list, $l_var_list, $objLinkList, $objCatList, $content_set; - - if(strlen($attribs["_itemtemplate"])==0) - { - $content_set = 0; - return "ERROR -1"; - } - - $CatId = getArrayValue($attribs,'_catid'); - if (!is_numeric($CatId)) { - $CatId = $objCatList->CurrentCategoryID(); - } - - if ((int)getArrayValue($attribs,'_useroot')) { - $CatId = (int)$objConfig->Get("Link_Root"); - } - - $ListType = getArrayValue($attribs,'_listtype'); - - if (!$ListType) $ListType = 'category'; - - if ($ListType != "search") { - $evar = $evar = $_GET["env"]; //m_BuildEnv().$objSession->GetVariable("Env_Link"); - - $tagname = "l_list_links-".$ListType."-".(int)$attribs["_shortlist"]; - $CachedList = GetTagCache("inlink",$tagname,$attribs,$evar); - if($CachedList) return $CachedList; - } - - if ( ($attribs['_shortlist'] == 1) && $objConfig->Get('Perpage_Links_Short') ) { - $objLinkList->PerPageVar = 'Perpage_Links_Short'; - } - else { - $objLinkList->PerPageVar = 'Perpage_Links'; - } - - //echo "PerPage ".$objLinkList->PerPageVar."
    "; - //echo "ListType: ".$objLinkList->ListType." Passed: $ListType
    "; - if($objLinkList->ListType != $ListType) - { - LoadLinkList($attribs); - } - - $cols = (int)getArrayValue($attribs,'_columns'); - if (!$cols) $cols = 1; - - //echo "Items: ".$objLinkList->NumItems()."
    "; - - if ($objLinkList->NumItems() == 0) { - - $content_set = 0; - return language('lu_no_links'); - } - - $html_attribs = ExtraAttributes($attribs); - $o=""; - $notable = (getArrayValue($attribs,'_notable')!="0"); - - if(!$notable) - { - $max_links = $objConfig->Get($objLinkList->PerPageVar); - - $items_to_print = $objLinkList->NumItems()>$max_links ? $max_links : $objLinkList->NumItems(); - - if($cols==0) - $cols = 1; - $per_row = ceil($items_to_print/$cols); - $count = 0; - $row = 0; - $total = 1; - $o=""; - $o .= ""; - } - $o .= "\n
    "; - foreach($objLinkList->Items as $index => $link) - { - $parsed = 0; - $objLinkList->CurrentItem = $index; - if($count==$per_row) - { - $o .= ""; - $count=0; - } - if($row==0 && getArrayValue($attribs,'_firstitemtemplate') ) - { - $o .= $link->ParseTemplate($attribs['_firstitemtemplate']); - $parsed = 1; - } - if($row==$objLinkList->NumItems()-1 && !$parsed && getArrayValue($attribs,'_lastitemtemplate') ) - { - $o .= $link->ParseTemplate($attribs['_lastitemtemplate']); - $parsed = 1; - } - if(!$parsed) - { - if (getArrayValue($attribs, '_editemtemplate') && (int)$link->Get('EditorsPick')) - { - $o .= $link->ParseTemplate($attribs["_editemtemplate"]); - } - else - { - $o .= $link->ParseTemplate($attribs['_itemtemplate']); - } - } - $row++; - $count++; - $total++; - - if ($total>$max_links) break; - } - $objLinkList->SetCurrentItem(); - - if($count != $per_row) { - $o .= "
    \n"; - } - else - { - $keywords = $objSession->GetVariable("Search_Keywords"); - - $links_showed = 0; //nl - $max_links = $objConfig->Get($objLinkList->PerPageVar); //nl - //echo "MaxLinks: $max_links
    "; - foreach($objLinkList->Items as $index => $link) - { - //echo "
    "; print_r($link); echo "
    "; - $show = 1; - /* if ($keywords) { - if (strstr(strip_tags(strtolower($link->Data['Name'])), strtolower($keywords)) || strstr(strip_tags(strtolower($link->Data['Description'])), strtolower($keywords))) { - $show = 1; - } - } - else { - $show = 1; - }*/ - - if ($show == 1) { - - $parsed = 0; - $objLinkList->CurrentItem = $index; - if($row==0 && strlen($attribs["_firstitemtemplate"])) - { - $o .= $link->ParseTemplate($attribs["_firstitemtemplate"]); - $parsed = 1; - } - if($row==$objLinkList->NumItems()-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0) - { - $o .= $link->ParseTemplate($attribs["_lastitemtemplate"]); - $parsed = 1; - } - if(!$parsed) - { - if (getArrayValue($attribs, '_editemtemplate') && (int)$link->Get('EditorsPick')) - { - $o .= $link->ParseTemplate($attribs["_editemtemplate"]); - } - else - { - $o .= $link->ParseTemplate($attribs['_itemtemplate']); - } - } - - $links_showed++; // nl - if($links_showed == $max_links) break; //nl - } - } - $objLinkList->SetCurrentItem(); - } - $o.="\n"; - if(strlen($o)) - SaveTagCache("inlink",$tagname,$attribs,$evar,$o); - return $o; -} - - -/* - @description: Used in conjuction with l_list_links. Returns the number if links in the list - @attrib: _CatId:int: Override the current category - @attrib: _useroot:bool: If set, the current category is changed to In-Link's root category - - @attrib: _ListType::Determines the type of list to generate
    - Possible values:
      -
    • Category: List links from the current category (default) -
    • Hot: Hot Links (Most Popular & highest rated links) -
    • Pop: Most Popular links -
    • New: List new links -
    • Hot: List links with the most click-throughs -
    • Pick: List editor's picks -
    • myitems: List topics created by the current user -
    • favorites: List topics marked as favorites by the current user -
    • search: List search results -
    - - @example: -*/ -function l_list_count($attribs = array()) -{ - global $objConfig, $objLinkList, $objCatList, $objSession; - - $CatId = getArrayValue($attribs,'_catid'); - if(!is_numeric($CatId)) - $CatId = $objCatList->CurrentCategoryID(); - - if((int)getArrayValue($attribs,'_useroot')) - $CatId = (int)$objConfig->Get("Link_Root"); - - $ListType = getArrayValue($attribs,'_listtype'); - if(!strlen($ListType)) - $ListType="category"; - - if ( ($attribs['_shortlist']) && $objConfig->Get('Perpage_Links_Short') ) { - $objLinkList->PerPageVar = 'Perpage_Links_Short'; - } - else { - $objLinkList->PerPageVar = 'Perpage_Links'; - } - - if(!getArrayValue($attribs,'_today')) - { - if($objLinkList->ListType != $ListType) - { - LoadLinkList($attribs); - } - $o = 0; - $keywords = $objSession->GetVariable("Search_Keywords"); - if ($keywords) { -// foreach ($objLinkList->Items as $cat) { - // if (strstr(strip_tags(strtolower($cat->Data['Name'])), strtolower($keywords)) || strstr(strip_tags(strtolower($cat->Data['Description'])), strtolower($keywords))) { - // $o++; - // } -// } -// echo "Counted: $o


    "; -// echo "Reasly: ".$objLinkList->QueryItemCount."


    "; -// } -// else { - $o = $objLinkList->QueryItemCount; - } - $o = $objLinkList->QueryItemCount; // only use when no highlighting issued - } - else - { - $o = $objLinkList->PerformItemCount($attribs); - } - - if ($o == '') { - $o = 0; - } - return $o; -} - - -/* - @description: Used in conjuction with l_list_links. This function generates the page navigation - for the list. If this tag is called before the list tag, this function will load - the links. For that reason, the _ListType attribute is required if the pagnav - tag preceeds the l_list_links tag in the template. Generally, it is good practice to - duplicate all attributes set for l_list_links. - @attrib: _PagesToList:int: Number of pages to list (default is 10) - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for links - @attrib: _label:lang: language tag to include in the output if there are pages to list. If there are no pages listed, this text will not be included (resulting in an empty output) - @attrib: _ListType::Determines the type of list to generate
    - Possible values:
      -
    • Category: List links from the current category (default) -
    • Hot: Hot Links (Most Popular & highest rated links) -
    • Pop: Most Popular links -
    • New: List new links -
    • Hot: List links with the most click-throughs -
    • Pick: List editor's picks -
    • myitems: List topics created by the current user -
    • favorites: List topics marked as favorites by the current user -
    • search: List search results -
    - -*/ -function l_link_pagenav($attribs = array()) -{ - global $objLinkList, $objCatList, $objSession, $objConfig; - - $DestTemplate = getArrayValue($attribs,'_template'); - $PagesToList = getArrayValue($attribs,'_pagestolist'); - $image = getArrayValue($attribs,'_PageIcon'); - if(!is_numeric($PagesToList)) - $PagesToList = 10; - - $CatId = getArrayValue($attribs,'_catid'); - if(!is_numeric($CatId)) - $CatId = $objCatList->CurrentCategoryID(); - - if ( ($attribs['_shortlist'] == 1) && $objConfig->Get('Perpage_Links_Short') ) { - $objLinkList->PerPageVar = 'Perpage_Links_Short'; - } - else { - $objLinkList->PerPageVar = 'Perpage_Links'; - } - - - $ListType = getArrayValue($attribs,'_listtype'); - if(!strlen($ListType)) - $ListType="category"; - - if($objLinkList->ListType != $ListType) { - LoadLinkList($attribs); - } - - $o = $objLinkList->GetPageLinkList($DestTemplate, '', 10, true, '', ExtraAttributes($attribs) ); - if (strlen($image)) { - $o_i = ' '; - } - else - { - $o_i=''; - } - if(strlen($o) && strlen($attribs["_label"])) - $o = $o_i.language($attribs["_label"]).' '.$o; - return $o; -} - -/* - @description: Used in conjuction with l_list_links. This function generates a navigation link which is - used to switch from a short list to a longer list. The page number is not changed. - If this tag is called before the list tag, this function will load the link list. - For that reason, the _ListType attribute is required if the pagnav - tag preceeds the l_list_links tag in the template. Generally, it is good practice to - duplicate all attributes set for l_list_links. - @attrib: _root:bool: If set, the current category is set to In-Link's root category - @attrib: _text:lang: language tag to include as text for the anchor tag - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for links - @attrib: _plaintext:: plain text to include as text for the anchor tag. The _text attribute takes presedence - if both are included. - @attrib: _image:: URL to an image to include inside the anchor tag. -*/ -function l_link_more($attribs = array()) -{ - global $objLinkList, $objConfig, $l_var_list_update, $objSession, $l_CachedList; - - $l_var_list_update['id'] = 0; - - $html_attribs = ExtraAttributes($attribs); - $DestTemplate = $attribs["_template"]; - - if ( ($attribs['_shortlist'] == 1) && $objConfig->Get('Perpage_Links_Short') ) { - $objLinkList->PerPageVar = 'Perpage_Links_Short'; - } - else { - $objLinkList->PerPageVar = 'Perpage_Links'; - } - - $ListType = $attribs["_listtype"]; - if(!strlen($ListType)) - $ListType="category"; - - if($ListType != "search") - { - $evar = $_GET["env"]; //m_BuildEnv().$objSession->GetVariable("Env_Link"); - $tagname = "l_list_links-".$ListType."-".(int)$attribs["_ShortList"]; - $CachedList = GetTagCache("inlink",$tagname,FALSE,$evar); - - if(strlen($CachedList)) - { - $moretag = "l_link_more-".$ListType."-".(int)$attribs["_ShortList"]; - $CachedPageNav = GetTagCache("inlink",$moretag,FALSE,$evar); - if(strlen($CachedPageNav)) - return $CachedPageNav; - } - } - if($objLinkList->ListType != $ListType) - LoadLinkList($attribs); - - if($objLinkList->QueryItemCount > $objConfig->Get($objLinkList->PerPageVar)) - { - if($attribs["_root"]) - { - $url = l_root_link($attribs); - } - else - { - $l_var_list_update["p"]=1; - $url = m_template_link($attribs); - unset($l_var_list_update["p"]); - } - $o = ""; - $text = $attribs["_text"]; - if(!strlen($text)) - { - $text = $attribs["_plaintext"]; - if(!strlen($text)) - { - } - $o .= $text.""; - } - else - $o .= language($text); - if(strlen($attribs["_image"])) - { - $o .= ""; - } - $o .= ""; - } - if(strlen($o) && strlen($CachedList)>0 && strlen($moretag)>0) - SaveTagCache("inlink",$moretag,FALSE,$evar,$o); - return $o; -} - -/* - @description: List items related to the current link - @attrib: _ItemId:int: the link to use (If not set, the current link is used) - @attrib: _ListItems:: List of item types to include (ie: _ListItems="Category,Topic") - @attrib: _*Template:none: For each item type lsted in _ListItems, an item type template must be included - (ie: _CategoryTemplate=".." _TopicTemplate="..") - @example: -*/ -function l_related_items($attribs) -{ - global $objItemTypes, $objLinkList, $objCatList, $content_set; - static $Related; - - global $LinkRelations; - - $id = getArrayValue($attribs,'_itemid'); - if(!is_numeric($id)) - { - $c =& $objLinkList->GetCurrentItem(); - } - else - $c =& $objLinkList->GetItem($id); - - $data_sent=0; - if(is_object($c)) - { - $ResourceId = $c->Get("ResourceId"); - $IncludeList = explode(",",trim(strtolower($attribs["_listitems"]))); - $o = ""; - - if(!is_object($LinkRelations)) - { - //echo "
    "; print_r($c); echo "
    "; - $LinkRelations = new clsMultiTypeList(); - LoadRelatedItems($Related, $LinkRelations,$c->Get("ResourceId")); - } - - if($LinkRelations->NumItems()>0) - { - for($inc=0;$incGetTypeByName($item_type); - if(is_object($objType)) - { - foreach($LinkRelations->Items as $item) - { - if(is_object($item)) - { - if(strtolower($objType->Get("ItemName")) == strtolower($item_type) && $item->type==$objType->Get("ItemType")) - { - if(strlen($item->BasePermissionName)) - { - $perm = $item->BasePermissionName.".VIEW"; - $haspem = $objSession->HasCatPermission($perm,$item->Get("CategoryId")); - } - else - $hasperm = 1; - - if($hasperm) - { - $data_sent =1; - $classname = $objType->Get("ClassName"); - if(strlen($classname)) - { - $l = new $classname; - $l->Data = $item->Data; - $o .= $l->ParseTemplate($t); - } - } - } - } - $item = NULL; - } - } - else - echo $item_type." not found
    \n"; - } - } - if($data_sent) - { - return $o; - } - else - { - $content_set=0; - return ""; - } - } - else - { - $content_set = 0; - return ""; - } - } - else - { - $content_set = 0; - return ""; - } -} - -/* - @description: Returns the number of items related to the current link - @attrib: _ItemId:int: the link to use (If not set, the current link is used) - @attrib: _ItemType:: Name of item to count (ie: _ItemType="Category") - @example: -*/ -function l_related_count($attribs) -{ - global $objItemTypes, $objLinkList, $content_set; - global $LinkRelations; - - $count = 0; - - $id = getArrayValue($attribs,'_itemid'); - if( !is_numeric($id) ) - { - $c =& $objLinkList->GetCurrentItem(); - } - else - { - $c =& $objLinkList->GetItem($id); - } - - if( is_object($c) ) - { - $ResourceId = $c->Get('ResourceId'); - if( !is_object($LinkRelations) ) - { - $LinkRelations = new clsMultiTypeList(); - LoadRelatedItems($Related, $LinkRelations,$c->Get('ResourceId')); - } - - if(strlen($attribs['_itemtype'])) - { - $objType = $objItemTypes->GetTypeByName($item_type); - $TargetType = is_object($objType) ? $objType->Get('ItemType') : ''; - } - - if( $LinkRelations->NumItems() > 0 ) - { - for($x=0;$x<$LinkRelations->NumItems();$x++) - { - $a = $LinkRelations->GetItemByIndex($x); - if($a->type == $TargetType || !strlen($TargetType)) $count++; - } - } - } - return $count; -} - -/* - @description: Returns a list of reviews for a link - @attrib: _LinkId:int: the link to use (If not set, the current link is used) - @attrib: _maxcount:int: Maximum number of reviews to list (defaults to all) - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for link reviews - @attrib: _ReviewTemplate:tpl: template used to display the reviews -*/ -function l_list_reviews($attribs = array()) -{ - global $objLinkList,$content_set, $l_var_list; - - $max = (int)$attribs["_maxcount"]; - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link =& $objLinkList->GetItem($LinkId); - } - else - $link =& $objLinkList->GetCurrentItem(); - - if(is_object($link)) - { - if($link->ReviewsLoaded()==0) - { - if($attribs["_shortlist"]) - { - $link->ReviewPerPageVar = "Perpage_LinkReviews_Short"; - } - else - { - $link->ReviewPerPageVar = "Perpage_LinkReviews"; - } - $ReviewList =& $link->GetItemReviews($l_var_list["rp"]); - } - else - $ReviewList =& $link->Reviews; - - $o = ""; - $t = $attribs["_reviewtemplate"]; - if($ReviewList->NumItems()>0 && strlen($t)) - { - foreach($ReviewList->Items as $r) - { - if($i >= $max && $max>0) - break; - - $o .= $r->ParseTemplate($t); - $i++; - } - } - } - if(!strlen($o)) - $content_set =0; - return $o; -} - -/* - @description: Used in conjuction with l_list_reviews. This function generates a navigation link which is - used to switch from a short list to a longer list. The page number is not changed. - If this tag is called before the list tag, this function will load the review list. - Any extra HTML attributes are passed to the anchor tag used to create the link. - @attrib: _LinkId:int: If set, the this value is used for a link ID (default to the current link) - @attrib: _root:bool: If set, the current category is set to In-Link's root category - @attrib: _text:lang: language tag to include as text for the anchor tag - @attrib: _Template:tpl: Destination template of More link - @attrib: _plaintext:: plain text to include as text for the anchor tag. The _text attribute takes presedence - if both are included. - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for link reviews - @attrib: _image:: URL to an image to include inside the anchor tag. -*/ -function l_review_more($attribs) -{ - global $objLinkList, $objConfig, $l_var_list_update, $l_var_list; - - $html_attribs = ExtraAttributes($attribs); - $DestTemplate = $attribs["_template"]; - - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link =& $objLinkList->GetItem($LinkId); - } - else - $link =& $objLinkList->GetCurrentItem(); - - if(is_object($link)) - { - if($link->ReviewsLoaded()==0) - { - if($attribs["_shortlist"]) - { - $link->ReviewPerPageVar = "Perpage_LinkReviews_Short"; - } - else - { - $link->ReviewPerPageVar = "Perpage_LinkReviews"; - } - $ReviewList =& $link->GetItemReviews($l_var_list["rp"]); - } - else - $ReviewList =& $link->Reviews; - - if($ReviewList->ItemCount() < $ReviewList->QueryItemCount) - { - if($attribs["_root"]) - { - $url = l_root_link($attribs); - } - else - { - $l_var_list_update['id'] = $l_var_list['id']; - $url = m_template_link($attribs); - } - $o = ""; - $text = $attribs["_text"]; - if(!strlen($text)) - { - $text = $attribs["_plaintext"]; - if(!strlen($text)) - { - } - $o .= $text.""; - } - else - $o .= language($text); - if(strlen($attribs["_image"])) - { - $o .= ""; - } - $o .= ""; - } - } - return $o; -} - -/* - @description: Used in conjuction with l_list_reviews. This function generates the page navigation - for the list of reviews. If this tag is called before the list tag, this function will load - the reviews. For that reason, the _ListType attribute is required if the pagnav - tag preceeds the l_list_reviews tag in the template. Generally, it is good practice to - duplicate all attributes set for l_list_reviews. - @attrib: _PagesToList:int: Number of pages to list (default is 10) - @attrib: _Template:tpl: destination template for page links (defaults to current template) - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for link reviews - @attrib: _LinkId:int: If set, the this value is used for a link ID (default to the current link) - @attrib: _label:lang: language tag to include in the output if there are pages to list. If there are no pages - listed, this text will not be included (resulting in an empty output) -*/ -function l_review_pagenav($attribs) -{ - global $l_var_list, $l_var_list_update, $objLinkList; - - $DestTemplate = $attribs["_template"]; - $PagesToList = $attribs["_pagestolist"]; - if(!is_numeric($PagesToList)) - $PagesToList = 10; - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link =& $objLinkList->GetItem($LinkId); - } - else - $link =& $objLinkList->GetCurrentItem(); - - if(is_object($link)) - { - if($link->ReviewsLoaded()==0) - { - if($attribs["_shortlist"]) - { - $link->ReviewPerPageVar = "Perpage_LinkReviews_Short"; - } - else - { - $link->ReviewPerPageVar = "Perpage_LinkReviews"; - } - $ReviewList =& $link->GetItemReviews($l_var_list["rp"]); - } - else - $ReviewList =& $link->Reviews; - $o = $ReviewList->GetPageLinkList($l_var_list_update,$DestTemplate); - } - if(strlen($o) && strlen($attribs["_label"])) - $o = language($attribs["_label"]).$o; - return $o; -} - -/* - @description: Parse a link item template - @attrib: _ItemTemplate:tpl: Link template to parse - @attrib: _LinkId:int: Link ID to parse (uses current link if not set) -*/ -function l_link_detail($attribs = array()) -{ - global $objLinkList; - - $t = $attribs["_itemtemplate"]; - if(strlen($t)) - { - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link = $objLinkList->GetItem($LinkId); - } - else - $link = $objLinkList->GetCurrentItem(); - if(is_object($link)) - { - $o = $link->ParseTemplate($t); - } - } - return $o; -} - - /* - @description: Parse a link field and return the value - @attrib: _Field:: Link field to parse - @attrib: _LinkId:int: Link ID to parse (uses current link if not set) - */ - function l_link_field($attribs = array()) - { - global $objLinkList; - - $o = ""; - $field = $attribs["_field"]; - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link = $objLinkList->GetItem($LinkId); - } - else - { - $link = $objLinkList->GetCurrentItem(); - } - - if(strlen($field)) - { - if(is_object($link)) - { - $element = new clsHtmlTag(); - $element->name = $link->TagPrefix; - $element->attributes = $attribs; - $o = $link->ParseObject($element); - } - else - $o = ""; - } - - if (substr($o, 0, 9) == "Undefined") { - $attrib = Array(); - $attrib['_template'] = "error_template"; - $attrib['_unsecure'] = 1; - $location = m_template_link($attrib); - Header("Location: $location"); - } - - return $o; - } - - function l_multiple_submit($params=Array()) - { - global $objCatList,$objConfig,$objModules; - $ret=''; - $root_cat_name=language($objConfig->Get('Root_Name')); - $selected_tpl=''.$root_cat_name.'>'."%2\$s".''; - if(getArrayValue($_POST,'cat_ids')) - { - foreach ($_POST['cat_ids'] as $cat_id) - { - $that_cat =& $objCatList->GetItem($cat_id); - $ret.=sprintf($selected_tpl,$cat_id,$that_cat->Get('CachedNavbar')); - } - } - - - $ret .= ''; - $suggest_cat_id=isset($_POST['suggest_cat_id'])?$_POST['suggest_cat_id']:$objCatList->CurrentCategoryID(); - $suggest_cat=$objCatList->GetItem($suggest_cat_id); - - $ret.=$root_cat_name.'>'.$suggest_cat->Get('CachedNavbar').'  - - - '; - - - - return $ret; - - } - - function l_home_cat() - { - global $objConfig; - return language($objConfig->Get('Root_Name')); - } - - function l_show_listings($params) - { - global $FormValues, $objConfig; - $html_attribs = ExtraAttributes($params); - $form = $params['_form']; - $field = strtolower($params['_field']); - - if (isset($_POST[$field])) { - $value = $_POST[$field]; - } - elseif ( getArrayValue($FormValues, $form, $field) ) { - $value = $FormValues[$form][$field]; - } - - $sql = 'SELECT Name, ListingTypeId FROM '.TABLE_PREFIX.'ListingTypes ORDER BY Name'; - - $application =& kApplication::Instance(); - $db =& $application->GetADODBConnection(); - $options = $db->GetCol($sql, 'ListingTypeId'); - - if ($objConfig->Get('Link_AllowFreeListings')) { - $options = array_merge_recursive2(Array('' => language('lu_free_listing') ), $options); - } - - if (!isset($value)) { - list($option_key, $option_title) = each($options); - $value = $option_key; - } - - $ret = ''; - $tag_params = Array('name' => $params['_render_as']); - foreach ($options as $option_key => $option_title) { - $tag_params['IsSelected'] = $option_key == $value; - $tag_params['ListingTypeId'] = $option_key; - $tag_params['ListingTypeName'] = $option_title; - $tag_params['IsFree'] = $option_key ? 0 : 1; - $tag_params['DetailsLink'] = $application->HREF($params['_moreinfotemplate'], '', Array('listing_type' => $option_key, 'pass' => 'm') ); - $ret .= $application->ParseBlock($tag_params); - } - return $ret; - } - -?> Index: branches/unlabeled/unlabeled-1.47.2/in-link/admin/install/inportal_data.sql =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.47.2/in-link/admin/install/inportal_data.sql (revision 12746) +++ branches/unlabeled/unlabeled-1.47.2/in-link/admin/install/inportal_data.sql (revision 0) @@ -1,265 +0,0 @@ -INSERT INTO ConfigurationAdmin VALUES ('Link_SortField', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 4) AND (IsSystem = 0)', 10.01, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.01, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortField2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 4) AND (IsSystem = 0)', 10.02, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.02, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links', 'la_Text_Links', 'la_link_perpage_prompt', 'text', '', '', 10.03, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_NewDays', 'la_Text_Links', 'la_link_newdays_prompt', 'text', '', '', 10.05, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MinPopRating', 'la_Text_Links', 'la_fld_Link_MinPopRating', 'text', '', '', 10.06, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MaxHotNumber', 'la_Text_Links', 'la_fld_Link_MaxHotNumber', 'text', '', '', 10.08, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_EnhancedLinks', 'la_Text_Links', 'la_link_EnhancedLinks', 'checkbox', '', '', 10.09, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_AllowFreeListings', 'la_Text_Links', 'la_link_AllowFreeListings', 'checkbox', '', '', 10.1, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ShowPick', 'la_Text_Links', 'la_link_editorspick_prompt', 'checkbox', '', '', 10.11, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_UrlStatus', 'la_Text_Links', 'la_link_urlstatus_prompt', 'checkbox', '', '', 10.12, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'ReviewText=la_common_ReviewText,CreatedOn=la_common_CreatedOn', 20.01, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 20.01, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'ReviewText=la_common_ReviewText,date=la_common_CreatedOn', 20.02, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 20.02, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MinPopVotes', 'la_Text_Links', 'la_fld_Link_MinPopVotes', 'text', '', '', 10.07, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_LinkReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 20.03, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links_Short', 'la_Text_Links', 'la_link_perpage_short_prompt', 'text', '', '', 10.04, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Name', 'la_Text_Link_Search', 'la_Link_Name', 'checkbox', '', '', 2, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Description', 'la_Text_Link_Search', 'la_Link_Description', 'checkbox', '', '', 1, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Url', 'la_Text_Link_Search', 'la_Link_Url', 'checkbox', '', '', 5, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CreatedOn', 'la_Text_Link_Search', 'la_Link_CreatedOn', 'checkbox', '', '', 5, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Hits', 'la_Text_Link_Search', 'la_Link_Hits', 'checkbox', '', '', 6, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedRating', 'la_Text_Link_Search', 'la_Link_CatchedRating', 'checkbox', '', '', 7, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedVotesQty', 'la_Text_Link_Search', 'la_Link_CatchedVotesQty', 'checkbox', '', '', 8, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedReviewsQty', 'la_Text_Link_Search', 'la_Link_CatchedReviewsQty', 'checkbox', '', '', 9, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Value', 'la_Text_Links', 'la_prompt_DupReviews', 'text', '', '', 10.13, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Interval', 'la_Text_Links', 'la_prompt_DupReviews', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.13, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Value', 'la_Text_Links', 'la_prompt_DupRating', 'text', '', '', 10.14, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Interval', 'la_Text_Links', 'la_prompt_DupRating', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.14, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('l_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 30.01, 0, 0); -INSERT INTO ConfigurationAdmin VALUES ('l_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 30.02, 0, 0); - -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_links', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_links', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_links', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_links', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_links', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 0, 1); - -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_Links', '10', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_SortField', 'Name', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_SortOrder', 'asc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_SortField2', 'Description', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_SortOrder2', 'desc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_NewDays', '100', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_MinPopRating', '5', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_MaxHotNumber', '5', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_EnhancedLinks', '0', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_AllowFreeListings', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_ShowPick', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_UrlStatus', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_ReviewsSort', 'CreatedOn', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_ReviewsOrder', 'desc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_ReviewsSort2', 'ReviewText', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_ReviewsOrder2', 'asc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_MinPopVotes', '20', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_LinkId', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_Name', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_Description', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_Url', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_CreatedOn', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_Hits', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_CatchedRating', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_CatchedVotesQty', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_CatchedReviewsQty', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_ReviewById', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_Priority', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_Status', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_EditorsPick', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_ResourceId', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_HotItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_PopItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_Link_NewItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'link_ReviewDelay_Value', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'link_ReviewDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'link_RatingDelay_Value', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'link_RatingDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_Root', '{LinkCatId}', 'In-Portal', '') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_Links_Short', '3', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_Highlight_OpenTag', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_Highlight_CloseTag', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_LinkReviews_Short', '3', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_LinkReviews', '10', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'l_CategoryTemplate', 'inlink/index', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'l_ItemTemplate', 'inlink/detail', 'In-Link', 'in-link:configuration_output'); - -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Keyword_links', '90', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Pop_links', '5', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Rating_links', '5', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Increase_links', '30', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_ShowMultiple_links', '0', 'In-Link', 'in-link:configuration_search'); - -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'StartValidationTime', '0', 'In-Link', ''); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'LastExpirationTime', '0', 'In-Link', ''); -INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Link_RatingToPop', '5', 'In-Link', 'in-link:configuration_output'); - -INSERT INTO Events VALUES (DEFAULT, 'LINK.ADD', NULL, 2, 0, 'In-Link', 'la_event_link.add', 1); -INSERT INTO Events VALUES (DEFAULT, 'LINK.MODIFY', NULL, 2, 0, 'In-Link', 'la_event_link.modify', 1); -INSERT INTO Events VALUES (DEFAULT, 'LINK.REVIEW.ADD', NULL, 2, 0, 'In-Link', 'la_event_link.review.add', 1); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ADD', NULL, 1, 0, 'In-Link', 'la_event_link.add', 0); -INSERT INTO Events VALUES (DEFAULT, 'LINK.APPROVE', NULL, 1, 0, 'In-Link', 'la_event_link.approve', 0); -INSERT INTO Events VALUES (DEFAULT, 'LINK.DENY', NULL, 1, 0, 'In-Link', 'la_event_link.deny', 0); -INSERT INTO Events VALUES (DEFAULT, 'LINK.MODIFY', NULL, 1, 0, 'In-Link', 'la_event_link.modify', 0); -INSERT INTO Events VALUES (DEFAULT, 'LINK.MODIFY.APPROVE', NULL, 1, 0, 'In-Link', 'la_event_link.modify.approve', 0); -INSERT INTO Events VALUES (DEFAULT, 'LINK.REVIEW.ADD', NULL, 1, 0, 'In-Link', 'la_event_link.review.add', 0); -INSERT INTO Events VALUES (DEFAULT, 'LINK.REVIEW.APPROVE', NULL, 1, 0, 'In-Link', 'la_event_link.review.approve', 0); -INSERT INTO Events VALUES (DEFAULT, 'LINK.REVIEW.DENY', NULL, 1, 0, 'In-Link', 'la_event_link.review.deny', 0); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ADD.PENDING', NULL, 1, 0, 'In-Link', 'la_event_link.add.pending', 0); -INSERT INTO Events VALUES (DEFAULT, 'LINK.MODIFY.PENDING', NULL, 1, 0, 'In-Link', 'la_event_link.modify.pending', 0); -INSERT INTO Events VALUES (DEFAULT, 'LINK.REVIEW.ADD.PENDING', NULL, 1, 0, 'In-Link', 'la_event_link.review.add.pending', 0); -INSERT INTO Events VALUES (DEFAULT, 'LINK.MODIFY.DENY', NULL, 1, 0, 'In-Link', 'la_event_link.modify.deny', 0); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ENHANCE', NULL, 1, 0, 'In-Link', 'la_event_link.link.enhance', '1'); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ENHANCE', NULL, 1, 0, 'In-Link', 'la_event_link.link.enhance', '0'); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ENHANCE.APPROVE', NULL, 0, 0, 'In-Link', 'la_event_link.link.enhance.approve', '1'); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ENHANCE.APPROVE', NULL, 1, 0, 'In-Link', 'la_event_link.link.enhance.approve', '0'); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ENHANCE.DENY', NULL, 0, 0, 'In-Link', 'la_event_link.link.enhance.deny', '1'); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ENHANCE.DENY', NULL, 1, 0, 'In-Link', 'la_event_link.link.enhance.deny', '0'); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ENHANCE.EXPIRE', NULL, 1, 0, 'In-Link', 'la_event_link.link.enhance.expire', '1'); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ENHANCE.EXPIRE', NULL, 1, 0, 'In-Link', 'la_event_link.link.enhance.expire', '0'); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ENHANCE.EXTEND', NULL, 1, 0, 'In-Link', 'la_event_link.link.enhance.extend', '1'); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ENHANCE.EXTEND', NULL, 1, 0, 'In-Link', 'la_event_link.link.enhance.extend', '0'); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ENHANCE.RENEW', NULL, 0, 0, 'In-Link', 'la_event_link.link.enhance.renew', '1'); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ENHANCE.RENEW', NULL, 1, 0, 'In-Link', 'la_event_link.link.enhance.renew', '0'); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ENHANCE.RENEW.FAILED', NULL, 1, 0, 'In-Link', 'la_event_link.link.enhance.renew_failed', '1'); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ENHANCE.RENEW.FAILED', NULL, 1, 0, 'In-Link', 'la_event_link.link.enhance.renew_failed', '0'); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ENHANCE.CANCEL', NULL, 1, 0, 'In-Link', 'la_event_link.link.enhance.renew_cancel', '1'); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ENHANCE.CANCEL', NULL, 1, 0, 'In-Link', 'la_event_link.link.enhance.renew_cancel', '0'); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ENHANCE.RENEWAL.NOTICE', NULL, 1, 0, 'In-Link', 'la_event_link.link.enhance.renewal_notice', '1'); -INSERT INTO Events VALUES (DEFAULT, 'LINK.ENHANCE.RENEWAL.NOTICE', NULL, 1, 0, 'In-Link', 'la_event_link.link.enhance.renewal_notice', '0'); - -INSERT INTO ItemTypes VALUES (4, 'In-Link', 'l', 'Link', 'Name', 'CreatedById', 'Hits', 'CachedRating', 'la_ItemTab_Links', 1, 'in-link/admin/addlink.php', 'clsLink', 'Link'); - -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.ADD', 'lu_PermName_Link.Add_desc', 'lu_PermName_Link.Add_error', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.VIEW', 'lu_PermName_Link.View_desc', 'lu_PermName_Link.View_error', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.ADD.PENDING', 'lu_PermName_Link.Add.Pending_desc', 'lu_PermName_Link.Add.Pending_error', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.MODIFY', 'lu_PermName_Link.Modify_desc', 'lu_PermName_Link.Modify_desc', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.DELETE', 'lu_PermName_Link.Delete_desc', 'lu_PermName_Link.Delete_error', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.RATE', 'lu_PermName_Link.Rate_desc', 'lu_PermName_Link.Rate_error', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.REVIEW', 'lu_PermName_Link.Review_desc', 'lu_PermName_Link.Review_error', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.REVIEW.PENDING', 'lu_PermName_Link.Review_Pending_desc', ' lu_PermName_Link.Review_Pending_error', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.MODIFY.PENDING', 'lu_PermName_Link.Modify.Pending_desc', 'lu_PermName_Link.Modify.Pending_desc', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.OWNER.MODIFY', 'lu_PermName_Link.Owner.Modify_desc', 'lu_PermName_Link.Owner.Modify_error', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.OWNER.MODIFY.PENDING', 'lu_PermName_Link.Owner.Modify.Pending_desc', 'lu_PermName_Link.Owner.Modify.Pending_error', 'In-Link'); -INSERT INTO PermissionConfig VALUES (DEFAULT, 'LINK.OWNER.DELETE', 'lu_PermName_Link.Owner.Delete_desc', 'lu_PermName_Link.Owner.Delete_error', 'In-Link'); - -INSERT INTO SearchConfig VALUES ('Link', 'OrgId', 0, 0, 'lu_fielddesc_link_orgid', 'lu_field_orgid', 'In-Link', 'la_text_link', 19, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'NewItem', 0, 1, 'lu_fielddesc_link_newitem', 'lu_field_newitem', 'In-Link', 'la_text_link', 18, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'PopItem', 0, 1, 'lu_fielddesc_link_popitem', 'lu_field_popitem', 'In-Link', 'la_text_link', 17, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'HotItem', 0, 1, 'lu_fielddesc_link_hotitem', 'lu_field_hotitem', 'In-Link', 'la_text_link', 16, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'ResourceId', 0, 1, 'lu_fielddesc_link_resourceid', 'lu_field_resourceid', 'In-Link', 'la_text_link', 15, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'EditorsPick', 0, 1, 'lu_fielddesc_link_editorspick', 'lu_field_editorspick', 'In-Link', 'la_text_link', 14, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Status', 0, 0, 'lu_fielddesc_link_status', 'lu_field_status', 'In-Link', 'la_text_link', 13, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Priority', 0, 0, 'lu_fielddesc_link_priority', 'lu_field_priority', 'In-Link', 'la_text_link', 12, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'ModifiedById', 0, 0, 'lu_fielddesc_link_modifiedbyid', 'lu_field_modifiedbyid', 'In-Link', 'la_text_link', 11, DEFAULT, 0, 'text', 'PortalUser.Login', '{ForeignTable}.PortalUserId={LocalTable}.ModifiedById', NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CreatedById', 0, 0, 'lu_fielddesc_link_createdbyid', 'lu_field_createdbyid', 'In-Link', 'la_text_link', 10, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedReviewsQty', 0, 0, 'lu_fielddesc_link_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Link', 'la_text_link', 9, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedVotesQty', 0, 0, 'lu_fielddesc_link_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Link', 'la_text_link', 8, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'LinkId', 0, 1, 'lu_fielddesc_link_linkid', 'lu_field_linkid', 'In-Link', 'la_text_link', 0, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Name', 1, 1, 'lu_fielddesc_link_name', 'lu_field_name', 'In-Link', 'la_text_link', 1, DEFAULT, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Description', 1, 1, 'lu_fielddesc_link_description', 'lu_field_description', 'In-Link', 'la_text_link', 2, DEFAULT, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Url', 1, 1, 'lu_fielddesc_link_url', 'lu_field_url', 'In-Link', 'la_text_link', 3, DEFAULT, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CreatedOn', 0, 1, 'lu_fielddesc_link_createdon', 'lu_field_createdon', 'In-Link', 'la_text_link', 4, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Modified', 0, 1, 'lu_fielddesc_link_modified', 'lu_field_modified', 'In-Link', 'la_text_link', 5, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Hits', 0, 1, 'lu_fielddesc_link_hits', 'lu_field_hits', 'In-Link', 'la_text_link', 6, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedRating', 0, 0, 'lu_fielddesc_link_cachedrating', 'lu_field_cachedrating', 'In-Link', 'la_text_link', 7, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); - -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) as LinkCount FROM <%prefix%>Link WHERE Status=1', NULL, 'la_prompt_ActiveLinks', 0, 1); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS TotalLinks FROM <%prefix%>Link', NULL, 'la_prompt_TotalLinks', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS ActiveLinks FROM <%prefix%>Link WHERE Status = 1', NULL, 'la_prompt_ActiveLinks', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS PendingLinks FROM <%prefix%>Link WHERE Status = 2', NULL, 'la_prompt_PendingLinks', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS DisabledLinks FROM <%prefix%>Link WHERE Status = 0', NULL, 'la_prompt_DisabledLinks', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS NewLinks FROM <%prefix%>Link WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Link_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewLinks', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>Link WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickLinks', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS HotLinks FROM <%prefix%>Link WHERE (HotItem = 1) OR (Hits >= <%m:config name="Link_MaxHotNumber"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotLinks', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) AS PopularLinks FROM <%prefix%>Link WHERE (PopItem = 1) OR ( (CachedRating >= <%link:hit_count type="top"%>) AND <%link:hit_count type="top"%> AND (PopItem = 2) )', NULL, 'la_prompt_PopularLinks', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Link WHERE CachedRating > 0', NULL, 'la_prompt_LinksAverageRating', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT MAX(Hits) AS MaxLinksHits FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksHits', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT MAX(CachedVotesQty) AS MaxLinksVotes FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksVotes', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_NewestLinkDate', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_LastLinkUpdate', 0, 2); -INSERT INTO StatItem VALUES (DEFAULT, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_LinkReviews', 0, 2); - -INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 14, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.VIEW', 14, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.VIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.ADD.PENDING', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.RATE', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.REVIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.MODIFY', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.MODIFY.PENDING', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.ADD', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.VIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.RATE', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.REVIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.MODIFY', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.MODIFY.PENDING', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.DELETE', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.ADD', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.DELETE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.MODIFY', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.ADD', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.VIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.MODIFY', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.DELETE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.RATE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.REVIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.ADD', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.VIEW', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.ADD.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.MODIFY', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.DELETE', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.RATE', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.REVIEW', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.REVIEW.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.MODIFY.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.MODIFY', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.MODIFY.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'LINK.OWNER.DELETE', 15, 0, 0, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:inlink_general.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:inlink_general.edit', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_output.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_output.edit', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_search.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_search.edit', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_email.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_email.edit', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_custom.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_custom.add', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_custom.edit', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:configuration_custom.delete', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:duplicate_checker.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:duplicate_checker.add', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:duplicate_checker.edit', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:duplicate_checker.delete', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:validation_list.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:validation_list.add', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:validation_list.edit', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:paid_listings.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:paid_listings.add', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:paid_listings.edit', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:paid_listings.delete', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:paid_listings.advanced:approve', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:paid_listings.advanced:decline', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:listing_types.view', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:listing_types.add', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:listing_types.edit', 11, 1, 1, 0); -INSERT INTO Permissions VALUES (DEFAULT, 'in-link:listing_types.delete', 11, 1, 1, 0); - -INSERT INTO ImportScripts VALUES (DEFAULT, 'In-Link', 'in-link', 'inlink_import', 'Intechnic In-Link 2.x', 'In-Link', 'link_image,user_admin,user_regular,init_cat', 1,'db'); -INSERT INTO ImportScripts VALUES (DEFAULT, 'In-Link', '', '', 'Gossamer Threads Links 2.x', '', '', 0,'db'); -INSERT INTO ImportScripts VALUES (DEFAULT, 'In-Link', '', '', 'Gossamer Threads Links 2.x SQL version', '', '', 0,'db'); -INSERT INTO ImportScripts VALUES (DEFAULT, 'In-Link', '', '', 'Sentraweb Indexu 3.x', '', '', 0,'db'); -INSERT INTO ImportScripts VALUES (DEFAULT, 'In-Link', '', '', 'Links from CSV file [In-Link]', '', '', 1, 'csv'); - -INSERT INTO CustomField VALUES (DEFAULT, 1, 'l_ItemTemplate', 'l_ItemTemplate', 'la_title_SystemCF', 'l_ItemTemplate', 'text', NULL, 0, 0, 1); - -INSERT INTO Modules VALUES ('In-Link', 'in-link/', 'l', '4.1.0', 1, 1, 'inlink/', 2, '1054738405'); Index: branches/unlabeled/unlabeled-1.11.28/in-link/admin/include/toolbar/advanced_view.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.11.28/in-link/admin/include/toolbar/advanced_view.php (revision 12746) +++ branches/unlabeled/unlabeled-1.11.28/in-link/admin/include/toolbar/advanced_view.php (revision 0) @@ -1,236 +0,0 @@ -Get("Link_View"); - -$Links_AllValue = 127; - -if(!is_numeric($LinkView)) -{ - $LinkView = 127; -} - -$Link_SortField = $objConfig->Get('Link_SortField'); -if( !strlen($Link_SortField) ) $Link_SortField = 'Priority'; - -$Link_SortOrder = $objConfig->Get('Link_SortOrder'); -if( !strlen($Link_SortOrder) ) $Link_SortOrder = 'desc'; - -$Perpage_Links = (int)$objConfig->Get("Perpage_Links"); -if(!$Perpage_Links) - $Perpage_Links="'all'"; - - -if($LinkView == $Links_AllValue) -{ - $Link_ShowAll = 1; - $LinkFilter = ""; -} -else -{ - // FILTERING CODE V. 1.2 - $where_clauses = Array(); $q = ''; - - // Group #1: Link Statuses (active,pending,disabled) - $Status = array(-1); - if($LinkView & $Bit_Pending) { - $Status[] = STATUS_PENDING; - $Status[] = -2; - } - if($LinkView & $Bit_Active) $Status[] = STATUS_ACTIVE; - if($LinkView & $Bit_Disabled) $Status[] = STATUS_DISABLED; - if( count($Status) ) $where_clauses[] = 'Status IN ('.implode(',', $Status).')'; - - // Group #2: Link Statistics (new,popular,hot,pick) - $Status = array(); - if(!($LinkView & $Bit_New)) - { - $cutoff = adodb_date("U") - ($objConfig->Get("Link_NewDays") * 86400); - if($cutoff > 0) $q = 'CreatedOn > '.$cutoff; - $q .= (!empty($q) ? ' OR ' : '').'NewItem = 1'; - $Status[] = "NOT ($q)"; - } - - if(!($LinkView & $Bit_Pop)) - { - $cutoff = $objLinkList->GetPopValue(); - if($cutoff > 0) $q = 'CachedRating >= '.$cutoff; - $q .= ' AND CachedVotesQty >= '.$objConfig->Get('Link_MinVotes'); - $q .= (!empty($q) ? ' OR ' : '').'PopItem = 1'; - $Status[] = "NOT ($q)"; - } - - if(!($LinkView & $Bit_Hot)) - { - $cutoff = $objLinkList->GetHotValue(); - if($cutoff > 0) $q = 'Hits >= '.$cutoff; - $q .= (!empty($q) ? ' OR ' : '').'HotItem = 1'; - $Status[] = "NOT ($q)"; - } - - if(!($LinkView & $Bit_Ed)) $Status[] = 'NOT (EditorsPick = 1)'; - if( count($Status) ) - $where_clauses[] = '('.implode(') AND (', $Status).')'; - - $LinkFilter = count($where_clauses) ? '('.implode(') AND (', $where_clauses).')' : ''; -} - -$list = $objSession->GetVariable("l_adv_view_search"); - -$objLinkList->Clear(); -$objLinkList->EnablePaging=TRUE; - -$lt = $objLinkList->SourceTable; -$catjoin = GetTablePrefix()."CategoryItems"; -$cattable = $objCatList->SourceTable; - -$order = "EditorsPick DESC, Priority DESC"; - -$sql = "SELECT * FROM $lt "; -//$sql .= "INNER JOIN $catjoin ON ($lt.ResourceId=$catjoin.ItemResourceId) "; - - - $lado = &GetADODBConnection(); - $tsql = $sql." WHERE OrgId IS NOT NULL AND OrgId>0 "; - $rs = $lado->Execute($tsql); - $OrgIds = array(); - while($rs && !$rs->EOF) - { - $OrgIds[] = $rs->fields["OrgId"]; - $rs->MoveNext(); - } - if(count($OrgIds)>0) - { - $LinkFilter .= ($LinkFilter ? ' AND ' : '')." (LinkId NOT IN (".implode(",",$OrgIds)."))"; - } - $order = $objLinkList->QueryOrderByClause(TRUE,TRUE,TRUE); - //echo "OBQ: $order
    "; - if(strlen($list)==0) - { - $where = $LinkFilter ? "WHERE ".$LinkFilter : ''; - $SearchQuery = ''; - } - else - { - $SearchQuery = $objLinkList->AdminSearchWhereClause($list); - if(strlen($SearchQuery)) - { - $SearchQuery = " (".$SearchQuery.")".($LinkFilter ? ' AND ('.$LinkFilter.')' : ''); - $where = 'WHERE '.$SearchQuery; - } - else - $where = $LinkFilter ? "WHERE ".$LinkFilter : ''; - } - $sql .= $where." ".$order; - - -//echo "Links SQL: $sql
    "; - $objLinkList->Query_Item($sql,false,'set_last'); - - $objLinkList->QueryItemCount = TableCount($objLinkList->SourceTable,($SearchQuery ? $SearchQuery : $LinkFilter),0); - $CatTotal = TableCount($objLinkList->SourceTable,null,0); - - $caption = language("la_ItemTab_Links"); - $ItemTabs->AddTab(language("la_ItemTab_Links"),"links",$objLinkList->QueryItemCount, $m_tab_Links_hide,$CatTotal); - -$lang_URL = language("la_prompt_URL"); -$lang_Links = language("la_Text_Links"); -$lang_Reviews = language("la_Text_Reviews"); - - -$TotalItemCount += $objLinkList->QueryItemCount; -$Link_Paste = "false"; -if($objLinkList->ItemsOnClipboard()>0) - $Link_Paste = "true"; - -print << -var Link_SortField = '$Link_SortField'; -var Link_SortOrder = '$Link_SortOrder'; -var Links_Perpage = $Perpage_Links; -var LinkView = $LinkView; -var LinkTitle = '$caption'; -var lang_URL = "$lang_URL"; -var lang_Links = "$lang_Links"; -var lang_Reviews = "$lang_Reviews"; -var Links_Paste = $Link_Paste; - -PasteButton = PasteButton || Links_Paste; - - \$fw_menus['l_view_menu'] = function() - { - // filtring menu - \$Menus['l_filtring_menu'] = new Menu(lang_View); - \$Menus['l_filtring_menu'].addMenuItem(lang_All,"config_val('Link_View', $Links_AllValue);",LinkView==$Links_AllValue); - \$Menus['l_filtring_menu'].addMenuItem(lang_None,"config_val('Link_View', 0);",LinkView==0); - \$Menus['l_filtring_menu'].addMenuSeparator(); - \$Menus['l_filtring_menu'].addMenuItem(lang_Active,"FlipBit('Link_View',LinkView,6);",BitStatus(LinkView,6)); - \$Menus['l_filtring_menu'].addMenuItem(lang_Pending,"FlipBit('Link_View',LinkView,5);", BitStatus(LinkView,5)); - \$Menus['l_filtring_menu'].addMenuItem(lang_Disabled,"FlipBit('Link_View',LinkView,4);",BitStatus(LinkView,4)); - \$Menus['l_filtring_menu'].addMenuSeparator(); - \$Menus['l_filtring_menu'].addMenuItem(lang_New,"FlipBit('Link_View',LinkView,3);",BitStatus(LinkView,3)); - \$Menus['l_filtring_menu'].addMenuItem(lang_Pop,"FlipBit('Link_View',LinkView,2);",BitStatus(LinkView,2)); - \$Menus['l_filtring_menu'].addMenuItem(lang_Hot,"FlipBit('Link_View',LinkView,1);",BitStatus(LinkView,1)); - \$Menus['l_filtring_menu'].addMenuItem(lang_EdPick,"FlipBit('Link_View',LinkView,0);",BitStatus(LinkView,0)); - - // sorting menu - \$Menus['l_sorting_menu'] = new Menu(lang_Sort); - \$Menus['l_sorting_menu'].addMenuItem(lang_Asc,"config_val('Link_SortOrder','asc');",RadioIsSelected(Link_SortOrder,'asc')); - \$Menus['l_sorting_menu'].addMenuItem(lang_Desc,"config_val('Link_SortOrder','desc');",RadioIsSelected(Link_SortOrder,'desc')); - \$Menus['l_sorting_menu'].addMenuSeparator(); - \$Menus['l_sorting_menu'].addMenuItem(lang_Default,"config_val('Link_SortField','Name');",""); - \$Menus['l_sorting_menu'].addMenuItem(lang_Name,"config_val('Link_SortField','Name');",RadioIsSelected(Link_SortField,'Name')); - \$Menus['l_sorting_menu'].addMenuItem(lang_URL,"config_val('Link_SortField','Url');",RadioIsSelected(Link_SortField,'Url')); - \$Menus['l_sorting_menu'].addMenuItem(lang_CreatedOn,"config_val('Link_SortField','CreatedOn');",RadioIsSelected(Link_SortField,'CreatedOn')); - \$Menus['l_sorting_menu'].addMenuItem(lang_Reviews,"config_val('Link_SortField','CachedReviewsQty');",RadioIsSelected(Link_SortField,'CachedReviewsQty')); - \$Menus['l_sorting_menu'].addMenuItem(lang_Rating,"config_val('Link_SortField','CachedRating');",RadioIsSelected(Link_SortField,'CachedRating')); - \$Menus['l_sorting_menu'].addMenuItem(lang_Votes,"config_val('Link_SortField','CachedVotesQty');",RadioIsSelected(Link_SortField,'CachedVotesQty')); - \$Menus['l_sorting_menu'].addMenuItem(lang_Hits,"config_val('Link_SortField','CachedHits');",RadioIsSelected(Link_SortField,'CachedHits')); - - // perpage menu - \$Menus['l_perpage_menu'] = new Menu(lang_PerPage); - \$Menus['l_perpage_menu'].addMenuItem("10","config_val('Perpage_Links', '10');",RadioIsSelected(Links_Perpage,10)); - \$Menus['l_perpage_menu'].addMenuItem("20","config_val('Perpage_Links', '20');",RadioIsSelected(Links_Perpage,20)); - \$Menus['l_perpage_menu'].addMenuItem("50","config_val('Perpage_Links', '50');",RadioIsSelected(Links_Perpage,50)); - \$Menus['l_perpage_menu'].addMenuItem("100","config_val('Perpage_Links', '100');",RadioIsSelected(Links_Perpage,100)); - \$Menus['l_perpage_menu'].addMenuItem("500","config_val('Perpage_Links', '500');",RadioIsSelected(Links_Perpage,500)); - - // select menu - \$Menus['l_select_menu'] = new Menu(lang_Select); - \$Menus['l_select_menu'].addMenuItem(lang_All,"javascript:selectAllC('"+activeTab.id+"');",""); - \$Menus['l_select_menu'].addMenuItem(lang_Unselect,"javascript:unselectAll('"+activeTab.id+"');",""); - \$Menus['l_select_menu'].addMenuItem(lang_Invert,"javascript:invert('"+activeTab.id+"');",""); - - // view menus - \$Menus['l_view_menu'] = new Menu(LinkTitle); - \$Menus['l_view_menu'].addMenuItem( \$Menus['l_filtring_menu'] ); - \$Menus['l_view_menu'].addMenuItem( \$Menus['l_sorting_menu'] ); - \$Menus['l_view_menu'].addMenuItem( \$Menus['l_perpage_menu'] ); - \$Menus['l_view_menu'].addMenuItem( \$Menus['l_select_menu'] ); - } - - function SubmitSearch(formname, action) - { - var f = document.getElementById(formname); - if(f) - { - f.Action.value = action; - f.submit(); - } - } - - -END; -?> Index: branches/unlabeled/unlabeled-1.2.8/in-link/admin_templates/import.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.2.8/in-link/admin_templates/import.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.2.8/in-link/admin_templates/import.tpl (revision 0) @@ -1,226 +0,0 @@ - - - - - - - - - - - - - - - -
    - -
    - - - - - - - "> - - - - - - - - - - - - - "> - - - - - - - - - - - - - - - - "> - - - - - - - - - - - "> - - - - - -
    - - - - - - - - - - - - - -
    - " id="_1" checked value="1" /> - - - - " id="" onclick="check_radio('_1');"> -
    - " id="_2" checked value="2" /> - - - - -
    -
     
    - - - - - - - - - - - -
    - " id="btn_move_up" onclick="move_options_up('', 1)" class="button"> - " id="btn_move_down" onclick="move_options_down('', 1)" class="button">
    -
    -

    :
    - - " value="" /> - - ', '')" class="button">
    -
    - ', ''); select_sort('');" class="button"> -
    - -
    -
     
    - - " value="" /> - ',null,null,null,'OnSaveSettings');"> -  
    - - - - - - - - - - -
    - checked name="" id="_1" value="1" /> - - -
    - checked name="" id="_2" value="2" /> - - - - - -
    -
     
    - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.7.2/themes/default/inlink/suggest_link/suggest_link_form.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.7.2/themes/default/inlink/suggest_link/suggest_link_form.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.7.2/themes/default/inlink/suggest_link/suggest_link_form.tpl (revision 0) @@ -1,116 +0,0 @@ - -"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - -
    (*)
    -


    >
    *
    *
    *


    *
    *
    *
    - - - - - - - - - - - - - -
    - " value="" checked> - - - - - ');"> - -
    - -
     
      - " class="button"> - " class="button" onClick="javascript:history.back();"> -



    - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.7.2/in-link/inlink_redirect.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.7.2/in-link/inlink_redirect.php (revision 12746) +++ branches/unlabeled/unlabeled-1.7.2/in-link/inlink_redirect.php (revision 0) @@ -1,47 +0,0 @@ -ApplicationDie('error: no link id specified'); - } - - $link = new clsLink($id); - - $link->debuglevel = 0; - $link->ClearCacheData(); - $link->Increment("hits", true); - $url = $link->Get("Url"); - -// $protocol = 'http'; - - if (preg_match('/^(http|ftp|mailto:)(.*)/U', $url)) { - header('Location: '.$url); - } - else { - header('Location: http://'.$url); - } - - exit; -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.7.2/in-link/admin_templates/import.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.7.2/in-link/admin_templates/import.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.7.2/in-link/admin_templates/import.tpl (revision 0) @@ -1,226 +0,0 @@ - - - - - - - - - - - - - - - -
    - -
    - - - - - - - "> - - - - - - - - - - - - - "> - - - - - - - - - - - - - - - - "> - - - - - - - - - - - "> - - - - - -
    - - - - - - - - - - - - - -
    - " id="_1" checked value="1" /> - - - - " id="" onclick="check_radio('_1');"> -
    - " id="_2" checked value="2" /> - - - - -
    -
     
    - - - - - - - - - - - -
    - " id="btn_move_up" onclick="move_options_up('', 1)" class="button"> - " id="btn_move_down" onclick="move_options_down('', 1)" class="button">
    -
    -

    :
    - - " value="" /> - - ', '')" class="button">
    -
    - ', ''); select_sort('');" class="button"> -
    - -
    -
     
    - - " value="" /> - ', 'ImportCategory', null, 'OnSaveSettings');"> -  
    - - - - - - - - - - -
    - checked name="" id="_1" value="1" /> - - -
    - checked name="" id="_2" value="2" /> - - - - - -
    -
     
    - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.7.2/in-link/units/listing_types/listing_types_event_handler.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.7.2/in-link/units/listing_types/listing_types_event_handler.php (revision 12746) +++ branches/unlabeled/unlabeled-1.7.2/in-link/units/listing_types/listing_types_event_handler.php (revision 0) @@ -1,59 +0,0 @@ -getObject(); - $selected_ids = $this->Application->GetVar('selected_ids'); - - $object->SetDBField($this->Application->RecallVar('dst_field'), $selected_ids['c']); - $this->RemoveRequiredFields($object); - $object->Update(); - - $this->finalizePopup($event); - } - - - function OnPreSaveListingType(&$event) - { - $event->redirect = false; - $object =& $event->getObject( Array('skip_autoload' => true) ); - $this->RemoveRequiredFields($object); - $event->CallSubEvent('OnPreSave'); - $this->Application->SetVar($event->getPrefixSpecial(true).'_id', $object->GetID()); - } - - function OnPreSave(&$event) - { - $object =& $event->getObject(); - $item_info = $this->Application->GetVar($event->Prefix); - if(is_array($item_info)) - { - $item_info = array_shift($item_info); - if( getArrayValue($item_info, 'EnableBuying') ) - { - $options = $object->GetFieldOptions('ShopCartName'); - $options['required'] = 1; - $object->SetFieldOptions('ShopCartName', $options); - } - } - parent::OnPreSave($event); - } - - function OnEdit(&$event) - { - if ($this->Application->prefixRegistred('p')) { - $this->Application->recallObject('p', null, Array('skip_autoload' => true)); - } - parent::OnEdit($event); - } -} - - -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.7.2/in-link/units/listings/listings_tag_processor.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.7.2/in-link/units/listings/listings_tag_processor.php (revision 12746) +++ branches/unlabeled/unlabeled-1.7.2/in-link/units/listings/listings_tag_processor.php (revision 0) @@ -1,92 +0,0 @@ -Application->recallObject($this->getPrefixSpecial(), $this->Prefix, $params); - - return $this->Application->HREF($params['edit_template'],'', Array( - 'm_opener' => 'd', - 'lst_mode' => 't', - 'lst_event' => 'OnEdit', - 'lst_id' => $object->GetDBField('ListingTypeId'), - 'pass' => 'all,lst' - ), 'index.php'); - } - - function LinkEditLink($params) - { - $object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params ); - - $sql = 'SELECT '.$this->Application->getUnitOption('l', 'IDField').' - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - - return $this->Application->HREF($params['edit_template'],'', Array( - 'm_opener' => 'd', - 'l_mode' => 't', - 'l_event' => 'OnEdit', - 'l_id' => $this->Conn->GetOne($sql), - 'pass' => 'all,l' - )); - } - - function ExpirationDate($params) - { - $object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params ); - $listing_type =& $this->Application->recallObject( 'lst', 'lst', $params ); - - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $listing_type->GetDBField('Duration'); - $duration_type = $listing_type->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $expiration_date = adodb_mktime() + $expiration_interval; - - $lang =& $this->Application->recallObject('lang.current'); - $format = $lang->GetDBField('DateFormat'); - $expiration_date = adodb_date($format, $expiration_date); - - return $expiration_date; - } - - function ExpirationTime($params) - { - $object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params ); - $listing_type =& $this->Application->recallObject( 'lst', 'lst', $params ); - - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $listing_type->GetDBField('Duration'); - $duration_type = $listing_type->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $expiration_date = adodb_mktime() + $expiration_interval; - - $lang =& $this->Application->recallObject('lang.current'); - $format = $lang->GetDBField('TimeFormat'); - $expiration_date = adodb_date($format, $expiration_date); - - return $expiration_date; - } -} - -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.16.8/in-link/admin/install/langpacks/english.lang =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.16.8/in-link/admin/install/langpacks/english.lang (revision 12746) +++ branches/unlabeled/unlabeled-1.16.8/in-link/admin/install/langpacks/english.lang (revision 0) @@ -1,139 +0,0 @@ - - m/d/Yg:i:s Am/d/Yg:i:s A.,iso-8859-12 - - QWN0aW9ucyBVcG9uIEV4cGlyYXRpb24= - QWN0aW9ucyBVcG9uIFB1cmNoYXNl - RXhwaXJlcyBPbg== - TGluaw== - SUQ= - SUQ= - TGlzdGluZyBUeXBl - TW9kaWZpZWQ= - UGVuZGluZyBSZW5ld2Fs - RW5hYmxlZCBPbg== - RGVjcmVhc2UgQnk= - RG9uJ3QgQ2hhbmdl - TGluayBlbmhhbmNlbWVudCBzdWJtaXR0ZWQ= - TGluayBlbmhhbmNlbWVudCBhcHByb3ZlZA== - TGluayBlbmhhbmNlbWVudCBkZW5pZWQ= - TGluayBlbmhhbmNlbWVudCBleHBpcmVk - TGluayBlbmhhbmNlbWVudCByZW5ld2FsIHN1Ym1pdHRlZA== - TGluayBlbmhhbmNlbWVudCBleHRlbmRlZA== - TGluayBlbmhhbmNlbWVudCBpcyBhYm91dCB0byBleHBpcmU= - TGluayBlbmhhbmNlbWVudCBjYW5jZWxsZWQ= - TGluayBlbmhhbmNlbWVudCByZW5ld2FsIGZhaWxlZA== - RW5hYmxlIFB1cmNoYXNpbmc= - RXhwaXJhdGlvbiBEYXRl - TGluayBJRA== - TGluayBPd25lcg== - SUQ= - TGlzdGluZyBUeXBl - RGVzY3JpcHRpb24= - SUQ= - TmFtZQ== - UGVuZGluZyBSZW5ld2Fs - UHVyY2hhc2UgRGF0ZQ== - UmVjdXJyaW5n - UmVuZXdhbCBSZW1pbmRlcg== - UHJvZHVjdCBOYW1l - VXNlcm5hbWU= - SW5jcmVhc2UgQnk= - SzQgTGlua3M= - QWxsb3cgRnJlZSBMaXN0aW5ncw== - RW5oYW5jZWQgTGlzdGluZ3M= - Tm8gQ2F0ZWdvcmllcw== - Tm8= - UGVuZGluZyBSZW5ld2Fs - TGluaw== - U2V0IEVxdWFsIFRv - TGlzdGluZ3M= - TGlzdGluZyBUeXBlcw== - UGFpZCBMaXN0aW5ncw== - U2hvcHBpbmcgQ2FydCBFbnRyeQ== - SzQgTGlua3M= - UGFpZCBMaXN0aW5n - TGlzdGluZyBUeXBl - U2hvcHBpbmcgQ2FydCBJdGVt - QWRkaW5nIExpbms= - QWRkaW5nIExpc3Rpbmc= - QWRkaW5nIExpc3RpbmcgVHlwZQ== - RWRpdGluZyBMaW5r - RWRpdGluZyBMaXN0aW5n - RWRpdGluZyBMaXN0aW5nIFR5cGU= - RXhwb3J0aW5nIExpbmtz - SW1wb3J0aW5nIExpbmtz - SW1wb3J0IExpbmtz - TGlua3M= - TGlua3MgRXhwb3J0 - TGlzdGluZyBUeXBlcw== - TmV3IExpbms= - TmV3IExpc3Rpbmc= - TmV3IExpc3RpbmcgVHlwZQ== - UGFpZCBMaXN0aW5ncw== - TGlzdGluZyBUeXBlcw== - U2hvcHBpbmcgQ2FydCBFbnRyeQ== - TmV3IEZpbGU= - TmV3IExpc3Rpbmc= - TmV3IExpc3RpbmcgVHlwZQ== - WW91IGFyZSBhYm91dCB0byBjYW5jZWwgeW91ciBsaW5rIGVuaGFuY2VtZW50Lg== - WW91IGFyZSBhYm91dCB0byBleHRlbmQgeW91ciBsaW5rIGVuaGFuY2VtZW50Lg== - Q2FuY2VsIExpbmsgRW5oYW5jZW1lbnQ= - QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGNhbmNlbCB5b3VyIGVuaGFuY2VkIGxpbms/IFRoZSBsaXN0aW5nIHR5cGUgd2lsbCBiZSByZXNldCB0byByZWd1bGFyLg== - Q2hvb3NlIExpc3RpbmcgVHlwZQ== - Q29uZmlybSBFbmhhbmNlbWVudCBDYW5jZWw= - Q29uZmlybSBFbmhhbmNlbWVudCBFeHRlbmQ= - RW5oYW5jZQ== - RW5oYW5jZSBMaW5r - VGhhbmsgeW91IGZvciBlbmhhbmNpbmcgeW91ciBsaW5rLiBZb3UgbGluayBlbmhhbmNlbWVudCBpcyBub3cgcGVuZGluZyBhZG1pbmlzdHJhdG9yIGFwcHJvdmFsLiBZb3Ugd2lsbCBiZSBub3RpZmllZCBieSBlbWFpbCB3aGVuIHlvdXIgbGluayBlbmhhbmNlbWVudCBpcyBhcHByb3ZlZC4= - RW5oYW5jZW1lbnQgc2V0IHRvIHJlbmV3IGF1dG9tYXRpY2FsbHkgb24= - RXh0ZW5kL0NhbmNlbCBFbmhhbmNlbWVudA== - RXh0ZW5kIExpbmsgRW5oYW5jZW1lbnQ= - QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGV4dGVuZCB5b3VyIGxpbmsgZW5oYW5jZW1lbnQ/ - Tm8gZGVzY3JpcHRpb24gZW50ZXJlZCE= - Tm8gbmFtZSBlbnRlcmVkIQ== - Tm8gVVJMIGVudGVyZWQh - RnJlZSBMaXN0aW5n - TGluayBFbmhhbmNlbWVudCBSZXN1bHRz - RXhwaXJhdGlvbiBEYXRl - TGlzdGluZyBUeXBl - TGlzdGluZyBUeXBl - QWZ0ZXIgc2VsZWN0aW5nIGxpc3RpbmcgdHlwZSBpdCB3aWxsIGJlIGFkZGVkIHRvIHlvdXIgc2hvcHBpbmcgY2FydC4gT25jZSB5b3UgY29tcGxldGUgY2hlY2tvdXQgYW5kIHlvdXIgb3JkZXIgaXMgYXBwcm92ZWQgeW91ciBsaW5rIHN0YXR1cyB3aWxsIGJlIHVwZ3JhZGVkLiBZb3Ugd2lsbCBiZSBub3RpZmllZCBieSBlbWFpbCB3aGVuIHRoaXMgaXMgZG9uZS4= - cGVuZGluZw== - TGlzdGluZyBUeXBl - dG8gY2FuY2VsIGxpbmsgZW5oYW5jZW1lbnQ= - - - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgYWRkZWQKCllvdXIgbGluayBoYXMgYmVlbiBhZGRlZC4NCjE= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBhZGRlZAoKQSBsaW5rIGhhcyBiZWVuIGFkZGVk - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBhcHByb3ZlZAoKWW91ciBsaW5rIGhhcyBiZWVuIGFwcHJvdmVk - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBkZW5pZWQKCllvdXIgbGluayBoYXMgYmVlbiBkZW5pZWQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQKCkRlYXIgPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJGaXJzdE5hbWUiIC8+IDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iTGFzdE5hbWUiIC8+LA0KDQpUaGFuayB5b3UgZm9yIHN1Ym1pdHRpbmcgbGluayBlbmhhbmNlbWVudCByZXF1ZXN0LiBZb3Ugd2lsbCBiZSBub3RpZmllZCB3aGVuIHlvdXIgbGluayBlbmhhbmNlbWVudCBpcyBwcm9jZXNzZWQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgRW5oYW5jZW1lbnQgc3VibWl0dGVkCgpBIHVzZXIgaGFzIHN1Ym1pdHRlZCBhIGxpbmsgZW5oYW5jZW1lbnQgcmVxdWVzdC4gUGxlYXNlIHByb2NlZWQgdG8gYWRtaW5pc3RyYXRpdmUgY29uc29sZSB0byByZXZpZXcgaXQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgYXBwcm92ZWQKCkRlYXIgPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJGaXJzdE5hbWUiIC8+IDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iTGFzdE5hbWUiIC8+LA0KDQpZb3VyIHJlY2VudCBsaW5rIGVuaGFuY2VtZW50IHJlcXVlc3QgaGFzIGJlZW4gYXBwcm92ZWQuIFRoYW5rIHlvdSENCg== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgYXBwcm92ZWQKCkxpbmsgZW5oYW5jZW1lbnQgaGFzIGJlZW4gYXBwcm92ZWQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgY2FuY2VsbGVkCgpEZWFyIDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iRmlyc3ROYW1lIiAvPiA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9Ikxhc3ROYW1lIiAvPiwNCg0KWW91ciBsaW5rIGVuaGFuY2VtZW50IG9uIDxpbnAyOmNvbmZfQ29uZmlnVmFsdWUgbmFtZT0iU2l0ZV9OYW1lIi8+IGhhcyBiZWVuIGNhbmNlbGxlZC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgY2FuY2VsbGVkCgpMaW5rIGVuaGFuY2VtZW50IGhhcyBiZWVuIGNhbmNlbGxlZC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZGVuaWVkCgpEZWFyIDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iRmlyc3ROYW1lIiAvPiA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9Ikxhc3ROYW1lIiAvPiwNCg0KU29ycnksIGJ1dCB5b3VyIHJlY2VudCBsaW5rIGVuaGFuY2VtZW50IHJlcXVlc3QgaGFzIGJlZW4gZGVuaWVkLg== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZGVuaWVkCgpMaW5rIGVuaGFuY2VtZW50IGhhcyBiZWVuIGRlbmllZC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZXhwaXJlZAoKRGVhciA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9IkZpcnN0TmFtZSIgLz4gPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJMYXN0TmFtZSIgLz4sDQoNCllvdXIgZW5oYW5jZWQgbGluayBhdCA8aW5wMjpjb25mX0NvbmZpZ1ZhbHVlIG5hbWU9IlNpdGVfTmFtZSIvPiBoYXMgZXhwaXJlZC4gSWYgeW91IHdhbnQgdG8gcmVuZXcgeW91ciBlbmhhbmNlZCBsaW5rLCBwbGVhc2UgcmUtc3VibWl0IGxpbmsgZW5oYW5jZW1lbnQgcmVxdWVzdC4gVGhhbmsgeW91IQ== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZXhwaXJlZAoKRW5oYW5jZWQgbGluayBoYXMgZXhwaXJlZC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgcmVuZXdhbAoKRGVhciA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9IkZpcnN0TmFtZSIgLz4gPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJMYXN0TmFtZSIgLz4sDQoNClRoYW5rIHlvdSBmb3Igc3VibWl0dGluZyBsaW5rIGVuaGFuY2VtZW50IHJlbmV3YWwgcmVxdWVzdC4gWW91IHdpbGwgYmUgbm90aWZpZWQgd2hlbiB5b3UgcmVxdWVzdCBpcyBwcm9jZXNzZWQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgcmVuZXdhbCBzdWJtaXRlZAoKTGluayBlbmhhbmNlbWVudCByZW5ld2FsIHJlcXVlc3QgaGFzIGJlZW4gc3VibWl0dGVkLCBwbGVhc2UgcHJvY2VlZCB0byBhZG1pbmlzdHJhdGl2ZSBjb25zb2xlIHRvIHJldmlldyBpdC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZXh0ZW5kZWQKCkRlYXIgPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJGaXJzdE5hbWUiIC8+IDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iTGFzdE5hbWUiIC8+LA0KDQpZb3UgbGluayBlbmhhbmNlbWVudCBvbiA8aW5wMjpjb25mX0NvbmZpZ1ZhbHVlIG5hbWU9IlNpdGVfTmFtZSIvPiBoYXMgYmVlbiBleHRlbmRlZC4gVGhhbmsgeW91IQ== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZXh0ZW5kZWQKCkxpbmsgZW5oYW5jZW1lbnQgaGFzIGJlZW4gZXh0ZW5kZWQ= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IEVuaGFuY2UgTGluayBSZW5ld2FsIEZhaWxlZAoKRW5oYW5jZSBMaW5rIFJlbmV3YWwgRmFpbGVk - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IEVuaGFuY2UgTGluayBSZW5ld2FsIEZhaWxlZAoKRW5oYW5jZSBMaW5rIFJlbmV3YWwgRmFpbGVk - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgcmVuZXdhbCBub3RpY2UKCkRlYXIgPGlucDI6dV9GaWVsZCBuYW1lPSJGaXJzdE5hbWUiIC8+IDxpbnAyOnVfRmllbGQgbmFtZT0iTGFzdE5hbWUiIC8+LA0KDQpZb3VyIGxpbmsgZW5oYW5jZW1lbnQgb24gPGlucDI6Y29uZl9Db25maWdWYWx1ZSBuYW1lPSJTaXRlX05hbWUiLz4gaXMgYWJvdXQgdG8gZXhwaXJlLiBQbGVhc2UgbG9naW4gdG8geW91ciBhY2NvdW50IHRvIHJlbmV3IHlvdXIgbGluayBlbmhhbmNlbWVudC4gVGhhbmsgeW91IQ== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgYWJvdXQgdG8gZXhwaXJlCgpMaW5rIGVuaGFuY2VtZW50IGlzIGFib3V0IHRvIGV4cGlyZS4= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBtb2RpZmVkCgpZb3VyIGxpbmsgaGFzIGJlZW4gbW9kaWZpZWQ= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBtb2RpZmllZAoKQSBsaW5rIGhhcyBiZWVuIG1vZGlmaWVkLg== - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBhcHByb3ZlZAoKWW91ciBsaW5rIG1vZGlmaWNhdGlvbiBoYXMgYmVlbiBhcHByb3ZlZA== - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBtb2RpZmljYXRpb24gZGVuaWVkCgpZb3VyIGxpbmsgbW9kaWZpY2F0aW9uIGhhcyBiZWVuIGRlbmllZC4= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYWRkZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gYWRkZWQ= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYWRkZWQKCkEgbGluayByZXZpZXcgaGFzIGJlZW4gYWRkZWQ= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYWRkZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gYWRkZWQgYW5kIGlzIHBlbmRpbmcgYXBwcm92YWwu - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYXBwcm92ZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gYXBwcm92ZWQ= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgZGVjbGluZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gZGVjbGluZWQ= - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.48.2/in-link/parser.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.48.2/in-link/parser.php (revision 12746) +++ branches/unlabeled/unlabeled-1.48.2/in-link/parser.php (revision 0) @@ -1,1412 +0,0 @@ -GetVariable("LinkListType"); - $LastShortType = $objSession->GetVariable("LinkShortList"); - $NoPaging = (getArrayValue($attribs,'_paging')=='0' || getArrayValue($attribs,'_paging')=='false'); - if(!$NoPaging && !strlen($PagingList)) - { - $PagingList=$ListType; - } - //echo "Last: $LastList, Short: $LastShortType Current: $ListType, Short:".$attribs["_shortlist"]." PageList: $PagingList
    \n"; - - if($ListType==$PagingList) - { - $objLinkList->EnablePaging = TRUE; - //echo "Last: $LastList, Short: $LastShortType Current: $ListType, Short:".$attribs["_shortlist"]."
    \n"; - if($LastList != $ListType || $LastShortType != $attribs["_shortlist"]) - { - //echo "Resetting Page..
    \n"; - $l_var_list_update["p"] = 1; - $l_var_list["p"] = 1; - $objSession->SetVariable("LinkListType",$ListType); - $objSession->SetVariable("LinkShortList",$attribs["_shortlist"]); - $objLinkList->Page = 1; - } - else - $objLinkList->Page=$l_var_list["p"]; - } - else - { - if(is_numeric(getArrayValue($attribs,'_maxcount'))) - { - $objLinkList->MaxListCount = $attribs["_maxcount"]; - } - else { - $objLinkList->MaxListCount = 10; - } - - $objLinkList->EnablePaging = FALSE; - } - $objLinkList->ListType=$ListType; - - switch($ListType) - { - case "category": - $objLinkList->LoadListCategory($attribs); - break; - case "myitems": - $objLinkList->LoadMyItems($attribs); - break; - case "hot": - $objLinkList->LoadHotItems($attribs); - break; - case "pop": - $objLinkList->LoadPopItems($attribs); - break; - case "pick": - $objLinkList->LoadPickItems($attribs); - break; - case "favorites": - $objLinkList->LoadFavorites($attribs); - break; - case "search": - $attribs['multiple'] = 'links'; - $objLinkList->LoadSearchItems($attribs); - break; - case "new": - $objLinkList->LoadNewItems($attribs); - break; - case "my_new": - $scope = $objSession->CurrentUser->Vars["LastLogin"]; - $attribs["_scope"] = $scope; - $attribs["_show_since_last"] = 1; - //print_pre($objSession->CurrentUser); - if (is_numeric($scope) && $scope > 0) { - $objLinkList->LoadNewItems($attribs); - } - break; - default: - $objLinkList->Clear(); - break; - } /* end of switch */ -} - - -function l_ParseEnv($str = NULL) -{ - global $l_var_list, $objSession, $orderByClause, $objConfig; - - if ($str != NULL) - { - if( substr($str,0,2) == 'l-' ) - { - $str = preg_replace('/^([a-zA-Z]+)-([0-9]+)-(.*)/','\\1\\2-\\3', $str); - } - - $str = substr($str,1); - $pieces = explode("-", $str); - $l_var_list["id"] = $pieces[0]; - $l_var_list["p"] = $pieces[1]; - $l_var_list["rp"] = $pieces[2]; -// $l_var_list['event'] = $pieces[3]; - ResetPage('l'); - } - else - { - $l_var_list["id"] = 0; - $l_var_list["p"] = 1; - $l_var_list["rp"] = 1; -// $l_var_list['event'] = ''; - } -} - -function l_LoadEnv() -{ - global $objSession, $l_var_list; - - $str = $objSession->GetVariable("Env_Link"); - l_ParseEnv($str); -} - -function l_SaveEnv($str="") -{ - global $objSession; - - $str = $objSession->SetVariable("Env_Link",$str); -} - -function l_BuildEnv() -{ - $module_vars = Array('id','p','rp','event'); - return GenerateModuleEnv('l', $module_vars); -} - -function l_BuildEnv_NEW() -{ - $module_vars = Array('id' => 'l_id', 'p' => 'l_Page', 'rp' => 'l_Reviews_Page', 'event' => 'l_event'); - return GenerateModuleEnv_NEW('l', $module_vars); -} - -/* - @description: returns the date of the last modification to the link table - @attrib: _Part:: part of the date to display - @attrib: _local:bool: If set, returns the modified date for the current category (and subcats) - @example: -*/ -function l_link_modified($attribs) -{ - global $objConfig, $objCatList; - $ret=''; - $CachedValue = GetTagCache("inlink","l_link_modified",$attribs,""); - if(strlen($CachedValue)) - { - return $CachedValue; - } - $ado = &GetADODBConnection(); - if(getArrayValue($attribs,'_local') && $objCatList->CurrentCategoryID() != 0) - { - $c = $objCatList->GetItem($objCatList->CurrentCategoryID()); - $catlist = $c->GetSubCatIds(); - - $catwhere = "CategoryId IN (".explode(",",$catlist).")"; - $sql = "SELECT MAX(Modified) as ModDate,MAX(CreatedOn) as NewDate FROM ".GetTablePrefix()."Link "; - $sql .= "INNER JOIN ".GetTablePrefix()."CategoryItems ON (".GetTablePrefix()."Link.ResourceId=".GetTablePrefix()."CategoryItems.ItemResourceId) "; - $sql .= "WHERE $catwhere LIMIT 1"; - } - else - { - $sql = "SELECT MAX(Modified) as ModDate, MAX(CreatedOn) As NewDate FROM ".GetTablePrefix()."Link LIMIT 1"; - } - $rs = $ado->Execute($sql); - if($rs && ! $rs->EOF) - { - $new = $rs->fields["NewDate"]; - $mod = $rs->fields["ModDate"]; - if($new>$mod) $mod = $new; - if($mod) - { - $part = strtolower(getArrayValue($attribs,'_part')); - $ret = $part?ExtractDatePart($part,$mod):LangDate($mod); - } - } - if($ret) SaveTagCache("inlink","l_link_modified",$attribs,"",$ret); - return $ret; -} - -/* - @description: returns the date of the last review for a link - @attrib: _Part:: part of the date to display - @attrib: _LinkId:int: if set, the link to display the review modified date - @example: -*/ -function l_review_modified($attribs) -{ - global $objConfig, $objLinkList; - - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link = $objLinkList->GetItem($LinkId); - } - else - $link = $objLinkList->GetCurrentItem(); - if(is_object($link)) - { - $ado = &GetADODBConnection(); - $ResId = $link->Get("ResourceId"); - $sql = "SELECT MAX(CreatedOn) as ModDate FROM ".GetTablePrefix()."ItemReview WHERE ItemId=$ResId AND Status=1 LIMIT 1"; - $rs = $ado->Execute($sql); - if($rs && ! $rs->EOF) - { - $mod = $rs->fields["ModDate"]; - if($mod) - { - $part = strtolower($attribs["_part"]); - if(strlen($part)) - { - $ret = ExtractDatePart($part,$mod); - } - else - { - $ret = LangDate($mod); - } - } - } - } - return $ret; -} - -/* - @description: returns a link to the link (directory) root category - @attrib: _Category:int: Override the In-Link root category - @attrib: _Template:tpl: The template to link to - @example: -*/ -function l_root_link($attribs = array()) -{ - global $objConfig, $l_var_list_update, $objModules; - - //$RootCat = (int)$objConfig->Get("Link_Root"); - $RootCat = $objModules->GetModuleRoot("In-Link"); - if($RootCat != -1) - $attribs["_category"] = $RootCat; - $l_var_list_update["p"] = ""; - $l_var_list_update["id"] = ""; - $l_var_list_update["cat"] = ""; - $l_var_list_update["rp"] = ""; - - unset($l_var_list_update["p"],$l_var_list_update["id"],$l_var_list_update["cat"],$l_var_list_update["rp"]); - $o = m_template_link($attribs); - unset($l_var_list_update["p"],$l_var_list_update["id"],$l_var_list_update["cat"],$l_var_list_update["rp"]); - - return $o; - -} - -function l_form_load_values($FormName,$IdValue) -{ - global $FormValues, $objLinkList; - - switch($FormName) - { - case "editlink": - $l =& $objLinkList->GetItem($IdValue); - $FormValues[$FormName]["name"] = stripslashes($l->Get("Name")); - $FormValues[$FormName]["url"] = stripslashes($l->Get("Url")); - $FormValues[$FormName]["description"] = stripslashes($l->Get("Description")); - $l->LoadCustomFields(); - if(is_array($l->CustomFields)) - { - foreach($l->CustomFields as $f=>$v) - { - if (is_array($v)) - { - $FormValues[$FormName][$f] = $v; - } - } - } - break; - } -} - -/* - @description: Generates the ACTION property for a FORM tag used by In-Link - @attrib: _Template:tpl: If set, this is the template the form submits to (default is the current template) - @attrib: _Form:: The form name
    Possible Values: -
      -
    • addlink: add a link to the database -
    • addlink_confirm: Confirm for addlink -
    • editlink: Modify an existing link -
    • editlink_confifirm: Confirmation for link modify -
    • l_rate: Form used to rate a link -
    • l_rate_confirm: Confirm for rate link -
    • l_addreview: add a review for a link -
    • l_review_confirm: Review confirmation -
    • l_delete_confirm: Form to confirm link delete (prior to delete) -
    • l_sort_links: Form to sort links and set number of results -
    • l_getting_rated: Form for external rating -
    - @example:
    "> -*/ -function l_form_action($attribs = array()) -{ - global $var_list_update, $var_list, $l_var_list, $l_var_list_update, $objSession, $objLinkList; - - $var_list_update['t'] = getArrayValue($attribs, '_template') ? $attribs['_template'] : $var_list['t']; - - if( is_object($objLinkList) && $objLinkList->CurrentItem ) $l_var_list_update['id'] = $objLinkList->CurrentItem; - - $ret = ''; - $form = strtolower( $attribs['_form'] ); - $url_params = Array(); - - switch($form) - { - case 'addlink': - /* add link needs to be passed in: _CompleteTemplate=... _PendingTemplate=... _DestinationTemplate=... */ - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_add_link', 'DestTemplate' => $attribs['_finishtemplate'] ); - if ( $objSession->HasCatPermission('LINK.ADD.PENDING') ) - { - $url_params['Confirm'] = $attribs[ getArrayValue($attribs, '_confirmpending') ? '_confirmpending' : '_confirm' ]; - $url_params['Action'] = 'l_add_link_confirm'; - } - - if ( $objSession->HasCatPermission('LINK.ADD') ) - { - $url_params['Confirm'] = $attribs['_confirm']; - $url_params['Action'] = 'l_add_link_confirm'; - } - if( !$url_params['Confirm'] ) unset($url_params['Confirm']); - } - break; - - case 'addlink_confirm': - $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t']; - break; - - case 'editlink': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_edit_link', 'DestTemplate' => $attribs['_finishtemplate'] ); - if ( $objSession->HasCatPermission('LINK.MODIFY.PENDING') ) - { - $url_params['Confirm'] = $attribs[ getArrayValue($attribs, '_confirmpending') ? '_confirmpending' : '_confirm' ]; - } - - if ( $objSession->HasCatPermission('LINK.MODIFY') ) - { - $url_params['Confirm'] = $attribs['_confirm']; - } - - if( !$url_params['Confirm'] ) unset($url_params['Confirm']); - l_form_load_values( $form, $l_var_list['id'] ); - } - break; - - case 'editlink_confirm': - $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t']; - break; - - - case 'l_rate': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_rate_link', 'DestTemplate' => $attribs['_finishtemplate'] ); - if ( $objSession->HasCatPermission('LINK.RATE') && getArrayValue($attribs, '_confirm') ) $url_params['Confirm'] = $attribs['_confirm']; - $l_var_list_update['id'] = $objLinkList->CurrentItem; - - if( getArrayValue($attribs, '_duplicate') ) $url_params['Duplicate'] = $attribs['_duplicate']; - } - break; - - case 'l_getting_rated': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_rate_link', 'DestTemplate' => $attribs['_finishtemplate'] ); - if ($objSession->HasCatPermission("LINK.RATE") && getArrayValue($attribs, '_confirm') ) $url_params['Confirm'] = $attribs['_confirm']; - $var_list_update['t'] = 'inlink/rate'; - $l_var_list_update['id'] = $objLinkList->CurrentItem; - if( getArrayValue($attribs, '_duplicate') ) $url_params['Duplicate'] = $attribs['_duplicate']; - } - break; - - case 'l_sort_links': - $url_params = Array('Action' => 'l_sort_links'); - break; - - case 'l_rate_confirm': - $l_var_list_update['id'] = $objLinkList->CurrentItem; - $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t']; - break; - - case 'l_addreview': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_add_review', 'DestTemplate' => $attribs['_finishtemplate'] ); - $l_var_list_update['id'] = $objLinkList->CurrentItem; - - if ( $objSession->HasCatPermission('LINK.REVIEW.PENDING') ) - { - $url_params['Confirm'] = $attribs[ getArrayValue($attribs, '_confirmpending') ? '_confirmpending' : '_confirm' ]; - } - - if ( $objSession->HasCatPermission('LINK.REVIEW') ) $url_params['Confirm'] = $attribs['_confirm']; - if( !$url_params['Confirm'] ) unset($url_params['Confirm']); - } - break; - - case 'l_review_confirm': - $l_var_list_update["id"] = $objLinkList->CurrentItem; - $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t']; - break; - - case 'l_delete_confirm': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - if( getArrayValue($attribs, '_accept_template') ) $url_params['DestYes'] = $attribs['_accepttemplate']; - if( getArrayValue($attribs, '_declinetemplate') ) $url_params['DestNo'] = $attribs['_declinetemplate']; - } - break; - } - - $ret = HREF_Wrapper('', $url_params); - unset($var_list_update['t']); - return $ret; -} - -/* - @description: returns a list of links - @attrib: _CatId:int: Override the current category - @attrib: _useroot:bool: If set, the current category is changed to In-Link's root category - @attrib: _ShortList:bool: If set, the Perpage_Links_Short setting is used instead of Perpage_links - @attrib: _Paging:bool: If set to 0 or false, paging will not be allowed for this list (only one paging list is allowed per item type per page load) - @attrib: _maxcount:int: If paging is not used on this list, this value determines how many items to load - @attrib: _ListType::Determines the type of list to generate
    - Possible values:
      -
    • Category: List links from the current category (default) -
    • Top: Most Popular & highest rated links -
    • Pop: Most Popular links -
    • New: List new links -
    • Hot: List links with the most click-throughs -
    • Pick: List editor's picks -
    • myitems: List topics created by the current user -
    • favorites: List topics marked as favorites by the current user -
    • search: List search results -
    - @attrib: _FirstItemTemplate:tpl: Template used for the first link listed - @attrib: _LastItemTemplate:tpl: Template used for the last link listed - @attrib: _EdItemTemplate:tpl: Editors Pick template used for link list items - @attrib: _ItemTemplate:tpl: default template used for link list items - @attrib: _notable:bool: if not 0, a table is used to contain the link list (any extra HTML attributes are used for the table tag) - @attrib: _Columns:int: the number of columns to use for table (defaults to 1) - @example: -*/ -function l_list_links($attribs = array()) -{ - global $objConfig, $objSession, $var_list, $l_var_list, $objLinkList, $objCatList, $content_set; - - if(strlen($attribs["_itemtemplate"])==0) - { - $content_set = 0; - return "ERROR -1"; - } - - $CatId = getArrayValue($attribs,'_catid'); - if (!is_numeric($CatId)) { - $CatId = $objCatList->CurrentCategoryID(); - } - - if ((int)getArrayValue($attribs,'_useroot')) { - $CatId = (int)$objConfig->Get("Link_Root"); - } - - $ListType = getArrayValue($attribs,'_listtype'); - - if (!$ListType) $ListType = 'category'; - - if ($ListType != "search") { - $evar = $evar = $_GET["env"]; //m_BuildEnv().$objSession->GetVariable("Env_Link"); - - $tagname = "l_list_links-".$ListType."-".(int)$attribs["_shortlist"]; - $CachedList = GetTagCache("inlink",$tagname,$attribs,$evar); - if($CachedList) return $CachedList; - } - - if ( ($attribs['_shortlist'] == 1) && $objConfig->Get('Perpage_Links_Short') ) { - $objLinkList->PerPageVar = 'Perpage_Links_Short'; - } - else { - $objLinkList->PerPageVar = 'Perpage_Links'; - } - - //echo "PerPage ".$objLinkList->PerPageVar."
    "; - //echo "ListType: ".$objLinkList->ListType." Passed: $ListType
    "; - if($objLinkList->ListType != $ListType) - { - LoadLinkList($attribs); - } - - $cols = (int)getArrayValue($attribs,'_columns'); - if (!$cols) $cols = 1; - - //echo "Items: ".$objLinkList->NumItems()."
    "; - - if ($objLinkList->NumItems() == 0) { - - $content_set = 0; - return language('lu_no_links'); - } - - $html_attribs = ExtraAttributes($attribs); - $o=""; - $notable = (getArrayValue($attribs,'_notable')!="0"); - - if(!$notable) - { - $max_links = $objConfig->Get($objLinkList->PerPageVar); - - $items_to_print = $objLinkList->NumItems()>$max_links ? $max_links : $objLinkList->NumItems(); - - if($cols==0) - $cols = 1; - $per_row = ceil($items_to_print/$cols); - $count = 0; - $row = 0; - $total = 1; - $o=""; - $o .= ""; - } - $o .= "\n
    "; - foreach($objLinkList->Items as $index => $link) - { - $parsed = 0; - $objLinkList->CurrentItem = $index; - if($count==$per_row) - { - $o .= ""; - $count=0; - } - if($row==0 && getArrayValue($attribs,'_firstitemtemplate') ) - { - $o .= $link->ParseTemplate($attribs['_firstitemtemplate']); - $parsed = 1; - } - if($row==$objLinkList->NumItems()-1 && !$parsed && getArrayValue($attribs,'_lastitemtemplate') ) - { - $o .= $link->ParseTemplate($attribs['_lastitemtemplate']); - $parsed = 1; - } - if(!$parsed) - { - if (getArrayValue($attribs, '_editemtemplate') && (int)$link->Get('EditorsPick')) - { - $o .= $link->ParseTemplate($attribs["_editemtemplate"]); - } - else - { - $o .= $link->ParseTemplate($attribs['_itemtemplate']); - } - } - $row++; - $count++; - $total++; - - if ($total>$max_links) break; - } - $objLinkList->SetCurrentItem(); - - if($count != $per_row) { - $o .= "
    \n"; - } - else - { - $keywords = $objSession->GetVariable("Search_Keywords"); - - $links_showed = 0; //nl - $max_links = $objConfig->Get($objLinkList->PerPageVar); //nl - //echo "MaxLinks: $max_links
    "; - foreach($objLinkList->Items as $index => $link) - { - //echo "
    "; print_r($link); echo "
    "; - $show = 1; - /* if ($keywords) { - if (strstr(strip_tags(strtolower($link->Data['Name'])), strtolower($keywords)) || strstr(strip_tags(strtolower($link->Data['Description'])), strtolower($keywords))) { - $show = 1; - } - } - else { - $show = 1; - }*/ - - if ($show == 1) { - - $parsed = 0; - $objLinkList->CurrentItem = $index; - if($row==0 && strlen($attribs["_firstitemtemplate"])) - { - $o .= $link->ParseTemplate($attribs["_firstitemtemplate"]); - $parsed = 1; - } - if($row==$objLinkList->NumItems()-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0) - { - $o .= $link->ParseTemplate($attribs["_lastitemtemplate"]); - $parsed = 1; - } - if(!$parsed) - { - if (getArrayValue($attribs, '_editemtemplate') && (int)$link->Get('EditorsPick')) - { - $o .= $link->ParseTemplate($attribs["_editemtemplate"]); - } - else - { - $o .= $link->ParseTemplate($attribs['_itemtemplate']); - } - } - - $links_showed++; // nl - if($links_showed == $max_links) break; //nl - } - } - $objLinkList->SetCurrentItem(); - } - $o.="\n"; - if(strlen($o)) - SaveTagCache("inlink",$tagname,$attribs,$evar,$o); - - global $l_var_list_update; - $l_var_list_update = array(); - return $o; -} - - -/* - @description: Used in conjuction with l_list_links. Returns the number if links in the list - @attrib: _CatId:int: Override the current category - @attrib: _useroot:bool: If set, the current category is changed to In-Link's root category - - @attrib: _ListType::Determines the type of list to generate
    - Possible values:
      -
    • Category: List links from the current category (default) -
    • Hot: Hot Links (Most Popular & highest rated links) -
    • Pop: Most Popular links -
    • New: List new links -
    • Hot: List links with the most click-throughs -
    • Pick: List editor's picks -
    • myitems: List topics created by the current user -
    • favorites: List topics marked as favorites by the current user -
    • search: List search results -
    - - @example: -*/ -function l_list_count($attribs = array()) -{ - global $objConfig, $objLinkList, $objCatList, $objSession; - - $CatId = getArrayValue($attribs,'_catid'); - if(!is_numeric($CatId)) - $CatId = $objCatList->CurrentCategoryID(); - - if((int)getArrayValue($attribs,'_useroot')) - $CatId = (int)$objConfig->Get("Link_Root"); - - $ListType = getArrayValue($attribs,'_listtype'); - if(!strlen($ListType)) - $ListType="category"; - - if ( ($attribs['_shortlist']) && $objConfig->Get('Perpage_Links_Short') ) { - $objLinkList->PerPageVar = 'Perpage_Links_Short'; - } - else { - $objLinkList->PerPageVar = 'Perpage_Links'; - } - - if(!getArrayValue($attribs,'_today')) - { - if($objLinkList->ListType != $ListType) - { - LoadLinkList($attribs); - } - $o = 0; - $keywords = $objSession->GetVariable("Search_Keywords"); - if ($keywords) { -// foreach ($objLinkList->Items as $cat) { - // if (strstr(strip_tags(strtolower($cat->Data['Name'])), strtolower($keywords)) || strstr(strip_tags(strtolower($cat->Data['Description'])), strtolower($keywords))) { - // $o++; - // } -// } -// echo "Counted: $o


    "; -// echo "Reasly: ".$objLinkList->QueryItemCount."


    "; -// } -// else { - $o = $objLinkList->QueryItemCount; - } - $o = $objLinkList->QueryItemCount; // only use when no highlighting issued - } - else - { - $o = $objLinkList->PerformItemCount($attribs); - } - - if ($o == '') { - $o = 0; - } - return $o; -} - - -/* - @description: Used in conjuction with l_list_links. This function generates the page navigation - for the list. If this tag is called before the list tag, this function will load - the links. For that reason, the _ListType attribute is required if the pagnav - tag preceeds the l_list_links tag in the template. Generally, it is good practice to - duplicate all attributes set for l_list_links. - @attrib: _PagesToList:int: Number of pages to list (default is 10) - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for links - @attrib: _label:lang: language tag to include in the output if there are pages to list. If there are no pages listed, this text will not be included (resulting in an empty output) - @attrib: _ListType::Determines the type of list to generate
    - Possible values:
      -
    • Category: List links from the current category (default) -
    • Hot: Hot Links (Most Popular & highest rated links) -
    • Pop: Most Popular links -
    • New: List new links -
    • Hot: List links with the most click-throughs -
    • Pick: List editor's picks -
    • myitems: List topics created by the current user -
    • favorites: List topics marked as favorites by the current user -
    • search: List search results -
    - -*/ -function l_link_pagenav($attribs = array()) -{ - global $objLinkList, $objCatList, $objSession, $objConfig; - - $DestTemplate = getArrayValue($attribs,'_template'); - $PagesToList = getArrayValue($attribs,'_pagestolist'); - $image = getArrayValue($attribs,'_PageIcon'); - if(!is_numeric($PagesToList)) - $PagesToList = 10; - - $CatId = getArrayValue($attribs,'_catid'); - if(!is_numeric($CatId)) - $CatId = $objCatList->CurrentCategoryID(); - - if ( ($attribs['_shortlist'] == 1) && $objConfig->Get('Perpage_Links_Short') ) { - $objLinkList->PerPageVar = 'Perpage_Links_Short'; - } - else { - $objLinkList->PerPageVar = 'Perpage_Links'; - } - - - $ListType = getArrayValue($attribs,'_listtype'); - if(!strlen($ListType)) - $ListType="category"; - - if($objLinkList->ListType != $ListType) { - LoadLinkList($attribs); - } - - $o = $objLinkList->GetPageLinkList($DestTemplate, '', 10, true, '', ExtraAttributes($attribs) ); - if (strlen($image)) { - $o_i = ' '; - } - else - { - $o_i=''; - } - if(strlen($o) && strlen($attribs["_label"])) - $o = $o_i.language($attribs["_label"]).' '.$o; - return $o; -} - -/* - @description: Used in conjuction with l_list_links. This function generates a navigation link which is - used to switch from a short list to a longer list. The page number is not changed. - If this tag is called before the list tag, this function will load the link list. - For that reason, the _ListType attribute is required if the pagnav - tag preceeds the l_list_links tag in the template. Generally, it is good practice to - duplicate all attributes set for l_list_links. - @attrib: _root:bool: If set, the current category is set to In-Link's root category - @attrib: _text:lang: language tag to include as text for the anchor tag - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for links - @attrib: _plaintext:: plain text to include as text for the anchor tag. The _text attribute takes presedence - if both are included. - @attrib: _image:: URL to an image to include inside the anchor tag. -*/ -function l_link_more($attribs = array()) -{ - global $objLinkList, $objConfig, $l_var_list_update, $objSession, $l_CachedList; - - $l_var_list_update['id'] = 0; - - $html_attribs = ExtraAttributes($attribs); - $DestTemplate = $attribs["_template"]; - - if ( ($attribs['_shortlist'] == 1) && $objConfig->Get('Perpage_Links_Short') ) { - $objLinkList->PerPageVar = 'Perpage_Links_Short'; - } - else { - $objLinkList->PerPageVar = 'Perpage_Links'; - } - - $ListType = $attribs["_listtype"]; - if(!strlen($ListType)) - $ListType="category"; - - if($ListType != "search") - { - $evar = $_GET["env"]; //m_BuildEnv().$objSession->GetVariable("Env_Link"); - $tagname = "l_list_links-".$ListType."-".(int)$attribs["_ShortList"]; - $CachedList = GetTagCache("inlink",$tagname,FALSE,$evar); - - if(strlen($CachedList)) - { - $moretag = "l_link_more-".$ListType."-".(int)$attribs["_ShortList"]; - $CachedPageNav = GetTagCache("inlink",$moretag,FALSE,$evar); - if(strlen($CachedPageNav)) - return $CachedPageNav; - } - } - if($objLinkList->ListType != $ListType) - LoadLinkList($attribs); - - if($objLinkList->QueryItemCount > $objConfig->Get($objLinkList->PerPageVar)) - { - if($attribs["_root"]) - { - $url = l_root_link($attribs); - } - else - { - $l_var_list_update["p"]=1; - $url = m_template_link($attribs); - unset($l_var_list_update["p"]); - } - $o = ""; - $text = $attribs["_text"]; - if(!strlen($text)) - { - $text = $attribs["_plaintext"]; - if(!strlen($text)) - { - } - $o .= $text.""; - } - else - $o .= language($text); - if(strlen($attribs["_image"])) - { - $o .= ""; - } - $o .= ""; - } - if(strlen($o) && strlen($CachedList)>0 && strlen($moretag)>0) - SaveTagCache("inlink",$moretag,FALSE,$evar,$o); - return $o; -} - -/* - @description: List items related to the current link - @attrib: _ItemId:int: the link to use (If not set, the current link is used) - @attrib: _ListItems:: List of item types to include (ie: _ListItems="Category,Topic") - @attrib: _*Template:none: For each item type lsted in _ListItems, an item type template must be included - (ie: _CategoryTemplate=".." _TopicTemplate="..") - @example: -*/ -function l_related_items($attribs) -{ - global $objItemTypes, $objLinkList, $objCatList, $content_set; - static $Related; - - global $LinkRelations; - - $id = getArrayValue($attribs,'_itemid'); - if(!is_numeric($id)) - { - $c =& $objLinkList->GetCurrentItem(); - } - else - $c =& $objLinkList->GetItem($id); - - $data_sent=0; - if(is_object($c)) - { - $ResourceId = $c->Get("ResourceId"); - $IncludeList = explode(",",trim(strtolower($attribs["_listitems"]))); - $o = ""; - - if(!is_object($LinkRelations)) - { - //echo "
    "; print_r($c); echo "
    "; - $LinkRelations = new clsMultiTypeList(); - LoadRelatedItems($Related, $LinkRelations,$c->Get("ResourceId")); - } - - if($LinkRelations->NumItems()>0) - { - for($inc=0;$incGetTypeByName($item_type); - if(is_object($objType)) - { - foreach($LinkRelations->Items as $item) - { - if(is_object($item)) - { - if(strtolower($objType->Get("ItemName")) == strtolower($item_type) && $item->type==$objType->Get("ItemType")) - { - if(strlen($item->BasePermissionName)) - { - $perm = $item->BasePermissionName.".VIEW"; - $haspem = $objSession->HasCatPermission($perm,$item->Get("CategoryId")); - } - else - $hasperm = 1; - - if($hasperm) - { - $data_sent =1; - $classname = $objType->Get("ClassName"); - if(strlen($classname)) - { - $l = new $classname; - $l->Data = $item->Data; - $o .= $l->ParseTemplate($t); - } - } - } - } - $item = NULL; - } - } - else - echo $item_type." not found
    \n"; - } - } - if($data_sent) - { - return $o; - } - else - { - $content_set=0; - return ""; - } - } - else - { - $content_set = 0; - return ""; - } - } - else - { - $content_set = 0; - return ""; - } -} - -/* - @description: Returns the number of items related to the current link - @attrib: _ItemId:int: the link to use (If not set, the current link is used) - @attrib: _ItemType:: Name of item to count (ie: _ItemType="Category") - @example: -*/ -function l_related_count($attribs) -{ - global $objItemTypes, $objLinkList, $content_set; - global $LinkRelations; - - $count = 0; - - $id = getArrayValue($attribs,'_itemid'); - if( !is_numeric($id) ) - { - $c =& $objLinkList->GetCurrentItem(); - } - else - { - $c =& $objLinkList->GetItem($id); - } - - if( is_object($c) ) - { - $ResourceId = $c->Get('ResourceId'); - if( !is_object($LinkRelations) ) - { - $LinkRelations = new clsMultiTypeList(); - LoadRelatedItems($Related, $LinkRelations,$c->Get('ResourceId')); - } - - if(strlen($attribs['_itemtype'])) - { - $objType = $objItemTypes->GetTypeByName($item_type); - $TargetType = is_object($objType) ? $objType->Get('ItemType') : ''; - } - - if( $LinkRelations->NumItems() > 0 ) - { - for($x=0;$x<$LinkRelations->NumItems();$x++) - { - $a = $LinkRelations->GetItemByIndex($x); - if($a->type == $TargetType || !strlen($TargetType)) $count++; - } - } - } - return $count; -} - -/* - @description: Returns a list of reviews for a link - @attrib: _LinkId:int: the link to use (If not set, the current link is used) - @attrib: _maxcount:int: Maximum number of reviews to list (defaults to all) - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for link reviews - @attrib: _ReviewTemplate:tpl: template used to display the reviews -*/ -function l_list_reviews($attribs = array()) -{ - global $objLinkList,$content_set, $l_var_list; - - $max = (int)$attribs["_maxcount"]; - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link =& $objLinkList->GetItem($LinkId); - } - else - $link =& $objLinkList->GetCurrentItem(); - - if(is_object($link)) - { - if($link->ReviewsLoaded()==0) - { - if($attribs["_shortlist"]) - { - $link->ReviewPerPageVar = "Perpage_LinkReviews_Short"; - } - else - { - $link->ReviewPerPageVar = "Perpage_LinkReviews"; - } - $ReviewList =& $link->GetItemReviews($l_var_list["rp"]); - } - else - $ReviewList =& $link->Reviews; - - $o = ""; - $t = $attribs["_reviewtemplate"]; - if($ReviewList->NumItems()>0 && strlen($t)) - { - foreach($ReviewList->Items as $r) - { - if($i >= $max && $max>0) - break; - - $o .= $r->ParseTemplate($t); - $i++; - } - } - } - if(!strlen($o)) - $content_set =0; - return $o; -} - -/* - @description: Used in conjuction with l_list_reviews. This function generates a navigation link which is - used to switch from a short list to a longer list. The page number is not changed. - If this tag is called before the list tag, this function will load the review list. - Any extra HTML attributes are passed to the anchor tag used to create the link. - @attrib: _LinkId:int: If set, the this value is used for a link ID (default to the current link) - @attrib: _root:bool: If set, the current category is set to In-Link's root category - @attrib: _text:lang: language tag to include as text for the anchor tag - @attrib: _Template:tpl: Destination template of More link - @attrib: _plaintext:: plain text to include as text for the anchor tag. The _text attribute takes presedence - if both are included. - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for link reviews - @attrib: _image:: URL to an image to include inside the anchor tag. -*/ -function l_review_more($attribs) -{ - global $objLinkList, $objConfig, $l_var_list_update, $l_var_list; - - $html_attribs = ExtraAttributes($attribs); - $DestTemplate = $attribs["_template"]; - - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link =& $objLinkList->GetItem($LinkId); - } - else - $link =& $objLinkList->GetCurrentItem(); - - if(is_object($link)) - { - if($link->ReviewsLoaded()==0) - { - if($attribs["_shortlist"]) - { - $link->ReviewPerPageVar = "Perpage_LinkReviews_Short"; - } - else - { - $link->ReviewPerPageVar = "Perpage_LinkReviews"; - } - $ReviewList =& $link->GetItemReviews($l_var_list["rp"]); - } - else - $ReviewList =& $link->Reviews; - - if($ReviewList->ItemCount() < $ReviewList->QueryItemCount) - { - if($attribs["_root"]) - { - $url = l_root_link($attribs); - } - else - { - $l_var_list_update['id'] = $l_var_list['id']; - $url = m_template_link($attribs); - } - $o = ""; - $text = $attribs["_text"]; - if(!strlen($text)) - { - $text = $attribs["_plaintext"]; - if(!strlen($text)) - { - } - $o .= $text.""; - } - else - $o .= language($text); - if(strlen($attribs["_image"])) - { - $o .= ""; - } - $o .= ""; - } - } - return $o; -} - -/* - @description: Used in conjuction with l_list_reviews. This function generates the page navigation - for the list of reviews. If this tag is called before the list tag, this function will load - the reviews. For that reason, the _ListType attribute is required if the pagnav - tag preceeds the l_list_reviews tag in the template. Generally, it is good practice to - duplicate all attributes set for l_list_reviews. - @attrib: _PagesToList:int: Number of pages to list (default is 10) - @attrib: _Template:tpl: destination template for page links (defaults to current template) - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for link reviews - @attrib: _LinkId:int: If set, the this value is used for a link ID (default to the current link) - @attrib: _label:lang: language tag to include in the output if there are pages to list. If there are no pages - listed, this text will not be included (resulting in an empty output) -*/ -function l_review_pagenav($attribs) -{ - global $l_var_list, $l_var_list_update, $objLinkList; - - $DestTemplate = $attribs["_template"]; - $PagesToList = $attribs["_pagestolist"]; - if(!is_numeric($PagesToList)) - $PagesToList = 10; - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link =& $objLinkList->GetItem($LinkId); - } - else - $link =& $objLinkList->GetCurrentItem(); - - if(is_object($link)) - { - if($link->ReviewsLoaded()==0) - { - if($attribs["_shortlist"]) - { - $link->ReviewPerPageVar = "Perpage_LinkReviews_Short"; - } - else - { - $link->ReviewPerPageVar = "Perpage_LinkReviews"; - } - $ReviewList =& $link->GetItemReviews($l_var_list["rp"]); - } - else - $ReviewList =& $link->Reviews; - $o = $ReviewList->GetPageLinkList($l_var_list_update,$DestTemplate); - } - if(strlen($o) && strlen($attribs["_label"])) - $o = language($attribs["_label"]).$o; - return $o; -} - -/* - @description: Parse a link item template - @attrib: _ItemTemplate:tpl: Link template to parse - @attrib: _LinkId:int: Link ID to parse (uses current link if not set) -*/ -function l_link_detail($attribs = array()) -{ - global $objLinkList; - - $t = $attribs["_itemtemplate"]; - if(strlen($t)) - { - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link = $objLinkList->GetItem($LinkId); - } - else - $link = $objLinkList->GetCurrentItem(); - if(is_object($link)) - { - $o = $link->ParseTemplate($t); - } - } - return $o; -} - - /* - @description: Parse a link field and return the value - @attrib: _Field:: Link field to parse - @attrib: _LinkId:int: Link ID to parse (uses current link if not set) - */ - function l_link_field($attribs = array()) - { - global $objLinkList; - - $o = ""; - $field = $attribs["_field"]; - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link = $objLinkList->GetItem($LinkId); - } - else - { - $link = $objLinkList->GetCurrentItem(); - } - - if(strlen($field)) - { - if(is_object($link)) - { - $element = new clsHtmlTag(); - $element->name = $link->TagPrefix; - $element->attributes = $attribs; - $o = $link->ParseObject($element); - } - else - $o = ""; - } - - if (substr($o, 0, 9) == "Undefined") { - $attrib = Array(); - $attrib['_template'] = "error_template"; - $attrib['_unsecure'] = 1; - $location = m_template_link($attrib); - Header("Location: $location"); - } - - return $o; - } - - function l_multiple_submit($params=Array()) - { - global $objCatList,$objConfig,$objModules; - $ret=''; - $root_cat_name=language($objConfig->Get('Root_Name')); - $selected_tpl=''.$root_cat_name.'>'."%2\$s".''; - if(getArrayValue($_POST,'cat_ids')) - { - foreach ($_POST['cat_ids'] as $cat_id) - { - $that_cat =& $objCatList->GetItem($cat_id); - $ret.=sprintf($selected_tpl,$cat_id,$that_cat->GetNavbar()); - } - } - - - $ret .= ''; - $suggest_cat_id=isset($_POST['suggest_cat_id'])?$_POST['suggest_cat_id']:$objCatList->CurrentCategoryID(); - $suggest_cat=$objCatList->GetItem($suggest_cat_id); - - $ret.=$root_cat_name.' > '.$suggest_cat->GetNavbar().'  - - - '; - - - - return $ret; - - } - - function l_home_cat() - { - global $objConfig; - return language($objConfig->Get('Root_Name')); - } - - function l_show_listings($params) - { - global $FormValues, $objConfig; - $html_attribs = ExtraAttributes($params); - $form = $params['_form']; - $field = strtolower($params['_field']); - - if (isset($_POST[$field])) { - $value = $_POST[$field]; - } - elseif ( getArrayValue($FormValues, $form, $field) ) { - $value = $FormValues[$form][$field]; - } - - $sql = 'SELECT Name, ListingTypeId FROM '.TABLE_PREFIX.'ListingTypes ORDER BY Name'; - - $application =& kApplication::Instance(); - $db =& $application->GetADODBConnection(); - $options = $db->GetCol($sql, 'ListingTypeId'); - - if ($objConfig->Get('Link_AllowFreeListings')) { - $options = array_merge_recursive2(Array('' => language('lu_free_listing') ), $options); - } - - if (!isset($value)) { - list($option_key, $option_title) = each($options); - $value = $option_key; - } - - $ret = ''; - $tag_params = Array('name' => $params['_render_as']); - foreach ($options as $option_key => $option_title) { - $tag_params['IsSelected'] = $option_key == $value; - $tag_params['ListingTypeId'] = $option_key; - $tag_params['ListingTypeName'] = $option_title; - $tag_params['IsFree'] = $option_key ? 0 : 1; - $tag_params['DetailsLink'] = $application->HREF($params['_moreinfotemplate'], '', Array('listing_type' => $option_key, 'pass' => 'm') ); - $ret .= $application->ParseBlock($tag_params); - } - return $ret; - } - -?> Index: branches/unlabeled/unlabeled-1.51.2/in-link/link.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.51.2/in-link/link.php (revision 12746) +++ branches/unlabeled/unlabeled-1.51.2/in-link/link.php (revision 0) @@ -1,1221 +0,0 @@ -clsCatItem(TRUE); //call parent constructor - - $this->tablename=GetTablePrefix()."Link"; - $this->type=TYPE_LINK; - $this->BasePermission ="LINK"; - $this->id_field = "LinkId"; - $this->TagPrefix = "link"; - $this->Prefix = 'l'; - $this->TitleField = 'Name'; - $this->ReviewSortOrder = trim($objConfig->Get("Link_ReviewsSort")." ".$objConfig->Get("Link_ReviewsOrder")); - $this->ReviewSortOrder .= trim(",".$objConfig->Get("Link_ReviewsSort2")." ".$objConfig->Get("Link_ReviewsOrder2")); - $this->Reviews->PerPage = $objConfig->Get("Perpage_LinkReviews"); - - /* keyword highlighting */ - $this->OpenTagVar = "Link_Highlight_OpenTag"; - $this->CloseTagVar = "Link_Highlight_CloseTag"; - - if(isset($LinkId)) - $this->LoadFromDatabase($LinkId); - if($objSession->HasSystemPermission("DEBUG.ITEM")) - { - $this->SetDebugLevel(1); - } - } - - function DetectChanges($name, $value) - { - global $objSession; - - if (!isset($this->Data[$name]) ) return false; - - //echo "class: ".get_class($this)."
    "; - if ($this->Data[$name] != $value && $value != '') { - //echo "$name Modified tt ".$this->Data[$name]." : $value
    "; - if ($objSession->GetVariable("HasChanges") != 1) { - $objSession->SetVariable("HasChanges", 2); - } - } - } - - - function ClearCacheData() - { - DeleteModuleTagCache('inlink'); - /*$cats = explode(",",$this->CategoryMemberList()); - if(is_array($cats)) - { - foreach($cats as $c) - { - if(is_numeric($c)) - { - $evar = "'%:m".$c."%'"; - DeleteTagCache("l_list_links","",$evar); - DeleteTagCache("l_link_more","",$evar); - } - } - } - DeleteTagCache("l_link_modified%",""); - DeleteTagCache("LinkPopValue","",""); - DeleteTagCache("LinkHotValue","",""); - DeleteTagCache("LinkNewValue","","");*/ - } - - - function Delete() - { - parent::Delete(); - if($this->tablename==GetTablePrefix()."Link") - { - $this->ClearCacheData(); - // DeleteTagCache("m_itemcount","Link%"); - } - } - - function Update($UpdatedBy = null) - { - parent::Update($UpdatedBy); - if($this->tablename == GetTablePrefix().'Link') $this->ClearCacheData(); - } - - function Create() - { - parent::Create(); - if($this->tablename == GetTablePrefix().'Link') $this->ClearCacheData(); - } - - function SetNewItem() - { - global $objConfig; - - $value = $this->Get("CreatedOn"); - - $cutoff = adodb_date("U") - ($objConfig->Get("Link_NewDays") * 86400); - $this->IsNew = FALSE; - if($value>$cutoff) - $this->IsNew = TRUE; - return $this->IsNew; - } - - function SetPopItem() - { - global $objConfig, $objLinkList; - - $cutoff = $objLinkList->GetPopValue(); - $this->IsPop = FALSE; - if($cutoff>0) - { - if($this->Get('CachedRating') >= $cutoff - && $this->Get('CachedVotesQty') >= $objConfig->Get('Link_MinPopVotes')) - { - $this->IsPop = TRUE; - } - } - return $this->IsPop; - } - - function SetHotItem() - { - global $objConfig, $objLinkList, $objSession; - - $this->IsHot = FALSE; - $cutoff = $objLinkList->GetHotValue(); - if($cutoff>0) - { - if($this->Get("Hits")>=$cutoff) { - $this->IsHot = TRUE; - } - } - return $this->IsHot; - } - - function Approve() - { - if($this->Get("Status")==-2) - { - $this->SendUserEventMail("LINK.MODIFY.APPROVE",$this->Get("CreatedById")); - $this->SendAdminEventMail("LINK.MODIFY.APPROVE"); - } - else - { - $this->SendUserEventMail("LINK.APPROVE",$this->Get("CreatedById")); - $this->SendAdminEventMail("LINK.APPROVE"); - } - $this->Set("Status", 1); - $this->Update(); - } - - function Deny() - { - if($this->Get("Status")==-2) - { - $this->SendUserEventMail("LINK.DENY.PENDING",$this->Get("CreatedById")); - $this->SendAdminEventMail("LINK.DENY.PENDING"); - $this->Delete(); - } - else - { - $this->SendUserEventMail("LINK.DENY",$this->Get("CreatedById")); - $this->SendAdminEventMail("LINK.DENY"); - $this->Set("Status", 0); - $this->Update(); - } - } - - function Validate() - { - global $objSession, $Errors; - - $dataValid = true; - if(!strlen($this->Get("Name"))) - { - $Errors->AddError("error.fieldIsRequired",'Name',"","",get_class($this),"Validate"); - $dataValid = false; - } - -// if(!isset($this->m_Url)) -// { -// $Errors->AddError("error.fieldIsRequired",'Url',"","",get_class($this),"Validate"); -// $dataValid = false; -// } - - if(!(int)$this->Get("CreatedOn")) - { - $Errors->AddError("error.fieldIsRequired",'CreatedOn',"","",get_class($this),"Validate"); - $dataValid = false; - } - - if(!(int)$this->Get("CreatedById")) - { - $Errors->AddError("error.fieldIsRequired",'CreatedBy',"","",get_class($this),"Validate"); - $dataValid = false; - } - return $dataValid; - } - - - function LoadFromDatabase($Id) - { - global $objSession,$Errors; - - if(!isset($Id)) - { - $Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromDatabase"); - return false; - } - - $sql = sprintf("SELECT * FROM ".$this->tablename." WHERE LinkId = '%s'",$Id); - $result = $this->adodbConnection->Execute($sql); - if ($result === false) - { - $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromDatabase"); - return false; - } - $data = $result->fields; - if(is_array($data)) - $this->SetFromArray($data); - $this->Clean(); - return TRUE; - } - - function LoadFromResourceId($Id) - { - global $objSession, $Errors; - if(!isset($Id)) - { - $Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromResourceId"); - return false; - } - $sql = sprintf("SELECT * FROM ".$this->tablename." WHERE ResourceId = '%s'",$Id); - $result = $this->adodbConnection->Execute($sql); - if ($result === false) - { - $Errors->AddError("error.DatabaseError",NULL,$adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromResourceId"); - return false; - } - $data = $result->fields; - if(is_array($data)) - { - $this->SetFromArray($data); - $this->Clean(); - } - return TRUE; - } - - function ReviewCount($TodayOnly = FALSE) - { - -// if($TodayOnly==FALSE && is_numeric($this->Get("CachedReviewsQty"))) -// return (int)$this->Get("CachedReviewsQty"); //this is a performance boost - - if(!is_object($this->Reviews)) - { - $this->Reviews= new clsItemReviewList($this->Get("ResourceId")); - } - else - { - $this->Reviews->itemID=$this->Get("ResourceId"); - } - return $this->Reviews->GetItemReviewCount($TodayOnly); - } - - function StatusIcon() - { - global $rootURL; - - $ret = $rootURL."/in-link/admin/images/"; - - switch(abs($this->Get("Status"))) - { - case STATUS_DISABLED: - $ret .= "icon16_link_disabled.gif"; - break; - case STATUS_PENDING: - $ret .= "icon16_link_pending.gif"; - break; - case STATUS_ACTIVE: - $img = "icon16_link.gif"; - if($this->IsPopItem()) - $img = "icon16_link_pop.gif"; - if($this->IsHotItem()) - $img = "icon16_link_hot.gif"; - if($this->IsNewItem()) - $img = "icon16_link_new.gif"; - if($this->Is("EditorsPick")) - $img = "icon16_link_pick.gif"; - $ret .= $img; - break; - } - return $ret; - } - - function ItemURL($Template=NULL,$SetCat=FALSE,$Action=NULL) - { - global $var_list_update,$var_list,$l_var_list_update,$m_var_list_update; - - $url_params = Array(); - $var_list_update['t'] = $Template ? $Template : $var_list['t']; - - //if($SetCat) - //{ - $cat = $this->Get("CategoryId"); - if( !is_numeric($cat) ) $cat = $this->GetPrimaryCategory(); - $m_var_list_update["cat"] = $cat; - //} - - $l_var_list_update["id"] = $this->Get("LinkId"); - - if( isset($Action) && $Action ) $url_params['Action'] = $Action; - $ret = HREF_Wrapper('', $url_params); - - unset($l_var_list_update["id"], $var_list_update["t"],$m_var_list_update["cat"]); - return $ret; - } - - function ParseObject($element) - { - /* when updating this function, update the comments at the top of the file */ - global $objConfig, $objCatList, $rootURL, $var_list, $var_list_update, - $l_var_list_update, $m_var_list_update, $objSession, $objUsers; - - $extra_attribs = ExtraAttributes($element->attributes); - if(strtolower($element->name)==$this->TagPrefix) - { - $field = strtolower($element->attributes["_field"]); - switch($field) - { - case 'pending_approval': - $ret = $this->isPending() ? true : ''; - if ($element->GetAttributeByName('_Not')) { - $ret = $ret ? '' : true; - } - break; - - /* - @field:link.url - @description:Returns link URL or default value if URL is empty - */ - case 'url': - $ret = $this->Get('Url'); - $default = $element->GetAttributeByName('_default'); - if( empty($ret) && !empty($default) ) - { - $ret = language($default); - } - break; - - case 'additional_params': - $ret = ''; - if( $objConfig->Get('Link_UrlStatus') ) - { - $link_url = addslashes( htmlspecialchars( $this->Get('Url') ) ); - $ret = ' onmouseover="window.status = \''.$link_url.'\'; return true;" onmouseout="window.status = \'\';"'; - } - break; - - case "name": - /* - @field:link.name - @description:Returns the link name - */ - //echo "test"; - $ret= $this->HighlightField("Name"); - break; - case "description": - /* - @field:link.description - @description:Link Description - @attrib:_maxlength:int:Maximum number of characters to return - @attrib:_wordchop:bool:If truncating the description, setting wordchop causes the result to be truncated at the last space before the split - */ - $ret = inp_unescape(($this->Get("Description"))); - $len = (int)$element->GetAttributeByName('_maxlength'); - if($len>0 && strlen($ret)>$len) - { - $ret = substr($ret,0,$len); - $wordchop = $element->GetAttributeByName('_wordchop'); - if(strlen($wordchop)==0 || $wordchop = "1") - { - if(substr($wordchop,-1)!=" ") - { - $pos = strrpos($ret," "); - $ret = substr($ret,0,$pos); - } - } - $ret .= " .."; - } - $ret = $this->HighlightText($ret); - break; - case "createdby": - /* - @field:link.createdby - @description:parse a user field of the user that created the link - @attrib:_usertag::User field to return (defaults to login ID) - */ - $field = $element->attributes["_usertag"]; - if(!strlen($field)) - { - $field = "user_login"; - } - - $userId = $this->Get("CreatedById"); - - if (!empty($userId) && ($userId > 0)) - { - $u =& $objUsers->GetItem($userId); - if (is_object($u)) - { - $ret = $u->parsetag($field); - } - } - else - $ret = " "; - - break; - case "date": - /* - @field:link.date - @description:Returns the date/time the link was created - @attrib:_tz:bool:Convert the date to the user's local time - @attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr - */ - $d = $this->Get("CreatedOn"); - $ret = $this->ParseTimeStamp($d,$element->attributes); - break; - case "modified": - /* - @field:link.modified - @description:Returns the date/time the link was last modified - @attrib:_tz:bool:Convert the date to the user's local time - @attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr - */ - $d = $this->Get("Modified"); - if($d<=0) - $d = $this->Get("CreatedOn"); - $ret = $this->ParseTimeStamp($d,$element->attributes); - break; - - case "expire": - /* - @field:link.expire - @description:Returns the date/time the link suppose to expire. - @attrib:_tz:bool:Convert the date to the user's local time - @attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr - @attrib:_dataexists:bool: Used with opeing/closing tags to exclude the whole block when expiration date is not set. - @attrib:_noexpirelabel:lang:Returns language tag when link is immortal (expire set to 0). - */ - $d = $this->Get("Expire"); - if($d == 0) - { - if($element->attributes['_datenotset'] == 1) - { - $ret = 1; - break; - } - - if(strlen($element->attributes['_noexpirelabel'])) - $ret = language($element->attributes['_noexpirelabel']); - else - $ret = ""; - } - elseif ($d > 0) - { - $ret = $this->ParseTimeStamp($d, $element->attributes); - } - else - $ret = ""; - - break; - - case "delete_link": - /* - @field:link.delete_link - @description:Returns a URL to delete the link - @attrib:_template:tpl:Template URL should point to - */ - $catid = $this->GetPrimaryCategory(); - if($objSession->HasCatPermission("LINK.DELETE",$catid) || - ($objSession->Get("PortalUserId")==$this->Get("CreatedById") && $objSession->HasCatPermission("LINK.OWNER.DELETE",$catid))) - { - $t = $element->attributes["_template"]; - if(!strlen($t)) - $t = $var_list["t"]; - $ret = $this->ItemURL($t); - } - - break; - - case "edit_link": - /* - @field:link.edit_link - @description:Returns a URL to edit the link - @attrib:_template:tpl:Template URL should point to - */ - - $catid = $this->GetPrimaryCategory(); - if(($objSession->HasCatPermission("LINK.MODIFY",$catid) || $objSession->HasCatPermission("LINK.MODIFY.PENDING",$catid)) || - (($objSession->Get("PortalUserId")==$this->Get("CreatedById") && $objSession->HasCatPermission("LINK.OWNER.MODIFY",$catid)) || ($objSession->Get("PortalUserId")==$this->Get("CreatedById") && $objSession->HasCatPermission("LINK.OWNER.MODIFY.PENDING",$catid)))) - { - $t = $element->attributes["_template"]; - if(!strlen($t)) - $t = $var_list["t"]; - $ret = $this->ItemURL($t); - } - - break; - - case 'is_enhanced': - - if (!class_exists('kApplication') || $this->isPending() ) { - return ''; - } - - $application =& kApplication::Instance(); - $l_tag_processor =& $application->recallObject('l_TagProcessor'); - $application->SetVar('l_id', $this->Get('LinkId')); - $res = $l_tag_processor->LinkIsEnhanced( Array() ); - - $ret = getArrayValue($element->attributes, '_not') ? !$res : $res; - return $ret ? 1 : ''; - break; - - case "redirect": - /* - @field:link.redirect - @description:Returns a URL to redirect the browser to the link's URL - */ - $ret = $rootURL."in-link/inlink_redirect.php?env=". BuildEnv()."&linkid=".$this->Get("LinkId"); - break; - case "add_favorite_link": - /* - @field:link.add_favorite_link - @description:Returns a URL to add this link to the user's favorites - @attrib:_template:tpl:Template URL should point to - */ - $t = $element->attributes["_template"]; - if(!strlen($t)) - $t = $var_list["t"]; - $ret = $this->ItemURL($t,FALSE,"l_add_favorite"); - break; - case "del_favorite_link": - /* - @field:link.del_favorite_link - @description:Returns a URL to remove this link from the user's favorites - @attrib:_template:tpl:Template URL should point to - */ - $t = $element->attributes["_template"]; - if(!strlen($t)) - $t = $var_list["t"]; - $ret = $this->ItemURL($t,FALSE,"l_del_favorite"); - break; - /* - @field:link.favorite_toggle - @description: Returns a link to set or reset the favorite flag for the current user - @attrib: _template:tpl:Template to link to if user has the FAVORITES permission (defaults to current template) - @attrib: _denytemplate:tpl: Template to link to if user does not have favorites permission (ie Guest) Defaults to current template - @attrib: _addlabel:lang:Language tag to display if link is to add favorite - @attrib: _addimage::Image url to include in link if adding favorite - @attrib: _dellabel:lang:Language tag to display if link is already a favorite - @attrib: _delimage::Image url to include in link if removing the favorite - */ - case "favorite_toggle": - - $catid = $this->GetPrimaryCategory(); - $unregister=false; - if($objSession->HasCatPermission("FAVORITES", $catid)) - { - $t = $element->GetAttributeByName('_template'); - } - else - { - $t = $element->GetAttributeByName('_denytemplate'); - RegisterEnv("dest", $element->GetAttributeByName('_denytemplate')); - $unregister = true; - } - -// echo "RES: ".$unregister; - - if(!strlen($t)) - $t = $var_list["t"]; - - if(!$this->IsFavorite($objSession->Get("PortalUserId"), $this->GetPrimaryCategory())) - { - $action = "l_add_favorite"; - if( $element->GetAttributeByName('_addlabel') ) - { - $label = language($element->attributes["_addlabel"]); - } - else - { - if(strlen($element->attributes["_addimage"])) - { - $result = MakeHTMLTag($element,'_img'); - $label = ''; - } - } - } - else - { - $action = "l_del_favorite"; - if(strlen($element->attributes["_dellabel"])) - { - $label = language($element->attributes["_dellabel"]); - } - else - { - if(strlen($element->attributes["_delimage"])) - { - $result = MakeHTMLTag($element,'_img'); - $label = ''; - } - } - } - - $action = $unregister? NULL : $action; - $ret = "ItemURL($t,FALSE,$action)."\">$label"; - - if ($unregister) - UnregisterEnv("dest"); - break; -/* - @field:link.hits - @description:Returns number of hits for item -*/ - case "hits": - $ret= round($this->Get("Hits")); - break; -/* - @field:link.votes - @description:Returns number of votes for item rating -*/ -/* - @field:link.cat_link - @description:Returns a URL setting the link to the current link and the link's category to the current category - @attrib:_template:tpl:Template URL should point to -*/ -/* - @field:link.link - @description:Returns a URL setting the link to the current link - @attrib:_template:tpl:Template URL should point to -*/ -/* - @field:link.rating - @description:Displays the links rating - @attrib:_displaymode:: How the rating should be displayed
    -
      -
    • "Numerical": Show the decimal value -
    • "Text": Show the text version -
    • "Graphical":Show images representing the rating -
    - @attrib:_onimage::on image tick shown in graphical display mode - @attrib:_offimage::off image tick shown in graphical display mode - @attrib:_separator::In graphical display mode, this html is placed between each tick image -*/ -/* - @field:link.reviews - @description:Return the number of reviews for think link - @attrib:_today:bool:Count reviews added today only -*/ -/* - @field:link.new - @description:returns text if link's status is "new" - @attrib:_label:lang: Text to return if status is new -*/ -/* - @field:link.pop - @description:returns text if link's status is "popular" - @attrib:_label:lang: Text to return if status is popular -*/ -/* - @field:link.hot - @description:returns text if link's status is "hot" - @attrib:_label:lang: Text to return if status is "hot" -*/ -/* - @field:link.pick - @description:returns text if link's status is "hot" - @attrib:_label:lang: Text to return if status is "hot" -*/ -/* - @field:link.custom - @description:Returns a custom field - @attrib:_customfield::field name to return - @attrib:_default::default value - @attrib:_listvalue::default value -*/ -/* - @field:link.category - @description:Return a category field from the link's category - @attrib:_cattag::Category field to parse -*/ -/* - @field:link.fullpath - @description:The full category path of the item -*/ -/* - @field:link.relevance - @description:Displays the link relevance in search results - @attrib:_displaymode:: How the relevance should be displayed
    -
      -
    • "Numerical": Show the decimal value -
    • "Bar": Show the HTML representing the relevance. Returns two HTML cells ≶td< with specified background colors -
    • "Graphical":Show image representing the relevance -
    - @attrib:_onimage::Zero relevance image shown in graphical display mode. Also used as prefix to build other images (i.e. prefix+"_"+percentage+".file_extension" - @attrib:_OffBackGroundColor::Off background color of HTML cell in bar display mode - @attrib:_OnBackGroundColor::On background color of HTML cell in bar display mode - -*/ - break; - - default: - unset($ret); - break; - } - - if(!isset($ret) || !strlen($ret) ) - { - $ret = parent::ParseObject($element); - } - } - else - $ret= "Undefined"; - return $ret; - } - - function parsetag($tag) - { - global $objConfig,$mytempdata, $rootURL, $var_list, $var_list_update, $l_var_list_update; - $ret=""; - //echo "test"; - switch($tag) - { - case "link_": - case "link_name": - $ret= $this->Get("Name"); - break; - case "link_desc": - $ret= $this->Get("Description"); - break; - case "link_url": - $ret = $this->Get("Url"); - break; - case "link_link": - $ret = $rootURL."in-link/inlink_redirect.php?env=". BuildEnv()."&linkid=".$this->Get("LinkId"); - break; - case "link_id": - $ret= $this->Get("LinkId"); - break; - case "link_date": - if($this->Get("CreatedOn")<=0) - return ""; - $ret = LangDate($this->Get('CreatedOn'), 0, true); - break; - - case "link_expire": - if($this->Get("Expire")<=0) - return ''; - $ret = LangDate($this->Get('Expire'), 0, true); - break; - - case "link_hits": - $ret=$this->Get("Hits"); - break; - case "link_hot": - if($this->IsHotItem()) - { - $ret="hot"; - } - else - $ret = ""; - break; - case "link_new": - if($this->IsNewItem()) - { - $ret="New"; - } - else - $ret = ""; - break; - case "link_pop": - if($this->IsPopItem()) - { - $ret = "pop"; - } - else - $ret = ""; - break; - case "link_pick": - if ($this->Get("EditorsPick")) - $ret="pick"; - break; - case "link_priority": - if($this->Get("Priority")!=0) - { - $ret = (int)$this->Get("Priority"); - } - else - $ret = ""; - break; - case "link_add_fav": - $var_list_update["t"] = "inlink/add_fav"; - $ret = HREF_Wrapper( Array('id' => $this->Get('LinkId') ) ); - unset($var_list_update["t"]); - break; - case "link_suggest_friend": - $var_list_update["t"] = "inlink/link_suggest"; - $ret= HREF_Wrapper( Array('id' => $this->Get('LinkId') ) ); - unset($var_list_update["t"]); - break; - - case "link_edit_link": - $l_var_list_update["id"]=$this->Get("LinkId"); - $var_list_update["t"] = "inlink/modify_link"; - $ret= HREF_Wrapper(); - unset($l_var_list_update["id"]); - unset($var_list_update["t"]); - break; - - case "link_rating_img": - $ret= "inlink/rating/".RatingImage($this->Get("CachedRating")).".gif"; - break; - case "link_votes": - $ret=$this->Get("CachedVotesQty"); - break; - case "link_reviews": - $ret= $this->Get("CachedReviewsQty"); - break; - case "link_rating": - $ret = round($this->Get("CachedRating"),1); - break; - case "link_resourceid": - $ret= $this->Get("ResourceId"); - break; - case "link_num_reviews": - $ret = $this->ReviewCount(); - break; - case "link_rating_txt": - return RatingText($this->Get("CachedRating")); - break; - default: - $ret= "Undefined:$tag"; - break; - } - return $ret; - } - - function isPending() - { - return $this->Get('Status') == -2 || $this->Get('Status') == 2; - } - -} /*clsLink*/ - -class _clsLinkList extends clsCatItemList -{ - function _clsLinkList() - { - global $l_var_list,$objSession; - - $this->clsCatItemList(); -// $this->clsItemCollection(); //call the parent constructor - $this->Prefix = 'l'; - $this->classname = "clsLink"; //class type for items - $this->SourceTable = GetTablePrefix()."Link"; - - $this->PageEnvarIndex = 'p'; - $this->PerPageVar = "Perpage_Links"; - $this->PageEnvar = "l_var_list_update"; - $this->Page = (int)$l_var_list["p"]; - - $this->AdminSearchFields = array("Name","Description","Url"); - $this->BasePermission = "LINK"; - - $this->PerPageVarLong = "Perpage_Links"; - $this->PerPageShortVar = "Perpage_Links_Short"; - $this->AddSortField("Link_SortField","Link_SortOrder"); - $this->AddSortField("Link_SortField2","Link_SortOrder2"); - - $this->ItemType = TYPE_LINK; - if( $objSession->HasSystemPermission("DEBUG.ITEM") ) $this->debuglevel = 1; - } - - function SqlMyItems($attribs= array()) - { - global $objSession; - - // pending modified links - $sql = 'SELECT OrgId, LinkId - FROM '.$this->SourceTable.' - WHERE (CreatedById = '.$objSession->Get('PortalUserId').') AND (OrgId > 0)'; - - $pending_modified = Array(); - $original_links = Array(); - $db =& GetADODBConnection(); - $rs = $db->Execute($sql); - while (!$rs->EOF) { - $pending_modified[] = $rs->fields['LinkId']; - $original_links[] = $rs->fields['OrgId']; - $rs->MoveNext(); - } - - $TableName = $this->SourceTable; - if ($pending_modified && $original_links) { - $where = " (".$TableName.".Status > -1 OR LinkId IN (".implode(',', $pending_modified).") ) AND (LinkId NOT IN (".implode(',', $original_links).")) AND ".$TableName.".CreatedById=".$objSession->Get("PortalUserId"); - } - else { - $where = " (".$TableName.".Status > -1) AND ".$TableName.".CreatedById=".$objSession->Get("PortalUserId"); - } - if(getArrayValue($attribs,'_today')) - { - $today = mktime(0,0,0,date("m"),date("d"),date("Y")); - $where .= " AND ($TableName.CreatedOn>=$today)"; - } - $CategoryTable = GetTablePrefix()."Category"; - $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); - $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.".$ml_formatter->LangFieldName('CachedNavbar')." AS CachedNavBar FROM $TableName "; - $p = $this->BasePermission.".VIEW"; - $sql .= $this->GetJoinedSQL($p,null,$where); // maybe null should be replaced by some CategoryId - - $OrderBy = $this->QueryOrderByClause(TRUE,TRUE,TRUE); - $sql .= " ".$OrderBy; - - return $sql; - } - - function SetCurrentItem() - { - global $l_var_list; - - $this->CurrentItem = $l_var_list["id"]; - } - - - function LoadLinks($where="",$orderClause=NULL,$JoinCats=TRUE,$SkipCount=FALSE) - { - global $objConfig; - - $this->Clear(); - - if(!$SkipCount) - $this->QueryItemCount=TableCount($this->SourceTable,$where,$JoinCats); - - return $this->Query_Link($where,$orderClause,$JoinCats); - } - - function CountPending() - { - return TableCount($this->SourceTable,"Status=".STATUS_PENDING,0); - } - - function Query_Link($whereClause,$orderByClause=NULL,$JoinCats=TRUE) - { - global $objSession, $Errors; - - if($JoinCats) - { - $cattable = GetTablePrefix()."CategoryItems"; - $t = $this->SourceTable; - $CategoryTable = GetTablePrefix()."Category"; - $ml_formatter =& $this->Application->recallObject('kMultiLanguage'); - $sql = "SELECT ".$this->SourceTable.".*,$CategoryTable.CategoryId as CategoryId, ".$ml_formatter->LangFieldName('CachedNavbar')." AS CachedNavBar FROM $t INNER JOIN $cattable ON $cattable.ItemResourceId=$t.ResourceId "; - $sql .= "INNER JOIN $CategoryTable ON ($CategoryTable.CategoryId=$cattable.CategoryId)"; - } - else - $sql = "SELECT * FROM ". $this->SourceTable; - if(trim($whereClause)!="") - { - if(isset($whereClause)) - $sql = sprintf('%s WHERE %s',$sql,$whereClause); - } - if (trim($orderByClause)!="") - { - if(isset($orderByClause)) - $sql = sprintf('%s ORDER BY %s',$sql,$orderByClause); - } - - if($objSession->HasSystemPermission("DEBUG.LIST")) - echo $sql."
    \n"; - return $this->Query_Item($sql,null); - } - - function SaveNewPage() - { - global $l_var_list; - $l_var_list["p"] = $this->Page; - } - - function ExpireItems() - { - $now = adodb_date("U"); - $sql = "UPDATE ".$this->SourceTable." SET Status=0 WHERE Expire<$now AND Expire != 0 AND Status=1"; - $this->adodbConnection->Execute($sql); - DeleteModuleTagCache('inlink'); - } - - function Delete_Item($Id, $DetectCategories = false) - { - $l = $this->GetItem($Id); - $link_id = $l->Get('LinkId'); - - $sql = "DELETE FROM ".GetTablePrefix()."LinkValidation WHERE LinkId = $link_id"; - $this->adodbConnection->Execute($sql); - - DeleteModuleTagCache('inlink'); - - return parent::Delete_Item($Id, $DetectCategories); - } - - function &Add_Link($CategoryId, $Name, $Description, $Url, $CreatedOn, $Expire, $Status, $EditorsPick, $NewItem, - $PopItem, $HotItem, $CreatedById, $Rating=0, $Votes=0, $Hits=0, $Priority=0, $auto_filename = 1, $filename = '') - { - global $objSession, $objConfig; - - $l = new clsLink(NULL); - $filename = $l->StripDisallowed($filename); - $l->BasePermission=$this->BasePermission; - $l->tablename = $this->SourceTable; - $l->Set(Array( 'Name', 'Description', 'Url', 'CreatedOn', 'Expire', 'Status', 'EditorsPick', 'NewItem', - 'PopItem', 'HotItem', 'CreatedById', 'CachedRating', 'CachedVotesQty', 'Hits', 'Priority', - 'AutomaticFilename', 'Filename'), - - Array( $Name, $Description, $Url, $CreatedOn, $Expire, $Status, $EditorsPick, $NewItem, - $PopItem, $HotItem, $CreatedById, $Rating, $Votes, $Hits, $Priority, $auto_filename, - $filename) ); - - $l->Create($Pending); - $ci_table = $objSession->GetEditTable( GetTablePrefix().'CategoryItems' ); - if ($l->TableExists($ci_table)) $l->AddToCategory($CategoryId, $ci_table, 1); - - $l->SendUserEventMail("LINK.ADD", $CreatedById); - $l->SendAdminEventMail("LINK.ADD"); - return $l; - } - - - function &Edit_Link($LinkId, $Name, $Description, $Url, $CreatedOn, $Expire, $Status, $EditorsPick, - $NewItem, $PopItem, $HotItem, $Rating, $Votes, $Hits, $Priority=0, $auto_filename = 1, $filename = '') - { - $l = $this->GetItem($LinkId); - $filename = $l->StripDisallowed($filename); - $l->BasePermission = $this->BasePermission; - if ( !$CreatedOn ) $CreatedOn = $l->Get('CreatedOn'); - if ( !is_numeric($Status) ) $Status = $l->Get('Status'); - - if( !is_numeric($EditorsPick) ) $EditorsPick = $l->Get('EditorsPick'); - - $l->Set(Array( 'Name', 'Description', 'Url', 'CreatedOn', 'Expire', 'Status', 'EditorsPick', 'NewItem', 'PopItem', - 'HotItem', 'CachedRating', 'CachedVotesQty', 'Hits', 'Priority', 'AutomaticFilename', 'Filename'), - Array( $Name, $Description, $Url, $CreatedOn, $Expire, $Status, $EditorsPick, $NewItem, $PopItem, - $HotItem, $Rating, $Votes, $Hits, $Priority, $auto_filename, $filename) ); - - $l->Update(); - $l->SendUserEventMail("LINK.MODIFY", $l->Get("ModifiedById")); - $l->SendAdminEventMail("LINK.MODIFY"); - return $l; - } - - function LoadListCategory($attribs=array()) - { - global $objCatList, $objSession, $objConfig, $content_set; - - $this->Clear(); - - $catid = (int)getArrayValue($attribs,'_catid'); - if(!$catid) - $catid = $objCatList->CurrentCategoryID(); - - if(!$catid && (int)$attribs["_useroot"]) - $catid = (int)$objConfig->Get("Link_Root"); - - if(!$objSession->HasCatPermission("LINK.VIEW", $catid)) - { - $content_set = 0; - $this->QueryItemCount = 0; - return 0; - } - - if($attribs["_shortlist"]) { - if ($objConfig->Get("Perpage_Links_Short") > 0) { - $this->PerPageVar = "Perpage_Links_Short"; - } - else { - $this->PerPageVar = "Perpage_Links"; - } - } - - $CatTable = GetTablePrefix()."CategoryItems"; - $t = $this->SourceTable; - $sql = "SELECT *,CategoryId FROM $t INNER JOIN $CatTable ON $CatTable.ItemResourceId=$t.ResourceId "; - - $where = "CategoryId=".$catid." AND Status=1"; - $sql .= "WHERE $where"; - - $OrderBy = $this->QueryOrderByClause($objConfig->Get("Link_ShowPick"), TRUE, TRUE); - $sql .= " ".$OrderBy; - - $this->QueryItemCount = TableCount($this->SourceTable,$where,TRUE); - - if($this->QueryItemCount>0) - { - return $this->Query_Item($sql); - } - else - return FALSE; - } - - function GetNewValue($CatId=NULL) - { - global $NewValues,$objConfig, $objSystemCache; - - if(is_numeric($NewValues["link"])) - { - return $NewValues["link"]; - } - else - { - $CachedValue = $objSystemCache->GetValue("LinkNewValue","inlink",""); - if(strlen($CachedValue)) - { - $NewValues["link"] = $CachedValue; - return $CachedValue; - } - - $ado = &GetADODBConnection(); - if ($CategoryId) - { - $days = (int)$objConfig->Get("Link_NewDays"); - $cutoffdate = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d")-$days,adodb_date("Y")); - $sql = "SELECT CreatedOn FROM ".GetTablePrefix()."Link INNER JOIN ".GetTablePrefix()."CategoryItems AS cat ON (".GetTablePrefix()."Link.ResourceId = cat.ItemResourceId) WHERE cat.CategoryId=$CategoryId AND CreatedOn>=$cutoffdate ORDER BY CreatedOn DESC "; - } - else - { - $days = (int)$objConfig->Get("Link_NewDays"); - $cutoffdate = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d")-$days,adodb_date("Y")); - $sql = "SELECT CreatedOn FROM ".GetTablePrefix()."Link WHERE CreatedOn>=$cutoffdate ORDER BY CreatedOn DESC "; - } - $rs = $ado->Execute($sql); - - $NewValues["link"] = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d")-$days,adodb_date("Y")); - - while($rs && !$rs->EOF) - { - $NewValues["link"] = $rs->fields["CreatedOn"]; - $rs->MoveNext(); - } - return $NewValues["link"]; - } - } - - function GetHotValue() - { - global $objConfig; - static $hot_val = null; - - if (!isset($hot_val)) { - $sql = 'SELECT Hits - FROM '.TABLE_PREFIX.'Link - ORDER BY Hits DESC LIMIT 0,'.$objConfig->Get('Link_MaxHotNumber'); - $hits = $this->Conn->GetCol($sql); - - $hot_val = 0; - foreach ($hits as $hit_value) { - if ($hit_value > 0) { - $hot_val = $hit_value; - } - } - } - return $hot_val; - } - - function GetPopValue() - { - global $PopValues,$objConfig, $objSystemCache; - - if(is_numeric($PopValues["link"]) && $PopValues["link"] > 0) - { - return $PopValues["link"]; - } - else - { - $CachedValue = $objSystemCache->GetValue('LinkPopValue','inlink',''); - if(strlen($CachedValue) && $CachedValue > 0) - { - $PopValues['link'] = $CachedValue; - return $CachedValue; - } - else - { - $PopValues['link'] = $objConfig->Get('Link_MinPopRating'); - } - /*$ado = &GetADODBConnection(); - $sql = "SELECT CachedRating FROM ".GetTablePrefix()."Link WHERE CachedRating >= ".(int)$objConfig->Get("Link_MinPopRating")." ORDER BY Hits DESC"; - - $rs = $ado->Execute($sql); - $PopValues["link"] = 0; - while($rs && !$rs->EOF) - { - //echo $rs->fields["CachedRating"]."
    "; - $PopValues["link"] = $rs->fields["CachedRating"]; // this works fine? next value overwrites previous - $rs->MoveNext(); - }*/ - $objSystemCache->EditCacheItem('LinkPopValue',$PopValues['link'],'inlink',adodb_mktime()+3600,''); - //echo "PopValues: ".$PopValues["link"]."
    "; - return $PopValues['link']; - } - } -} /*clsLinkList*/ - -?> Index: branches/unlabeled/unlabeled-1.3.66/in-link/admin/import/status.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.3.66/in-link/admin/import/status.php (revision 12746) +++ branches/unlabeled/unlabeled-1.3.66/in-link/admin/import/status.php (revision 0) @@ -1,201 +0,0 @@ -0) - $percent=round(($start/$total)*100); - else - $percent=0; - switch ($section) - { - case "users": - $section = "Users"; - $uservalue=$percent; - $catvalue=0; - $linksvalue=0; - $customvalue=0; - $relcatvalue=0; - break; - case "cats": - $section = "Categories"; - $uservalue=100; - $catvalue=$percent; - $linksvalue=0; - $customvalue=0; - $relcatvalue=0; - break; - case "links": - $section = "Links"; - $uservalue=100; - $catvalue=100; - $linksvalue=$percent; - $customvalue=0; - $relcatvalue=0; - break; - case "custom": - $section = "Custom Fields"; - $uservalue=100; - $catvalue=100; - $linksvalue=100; - $customvalue=$percent; - $relcatvalue=0; - break; - case "relcat": - $section = "Relative Categories"; - $uservalue=100; - $catvalue=100; - $linksvalue=100; - $customvalue=100; - $relcatvalue=$percent; - break; - case "terminate": - $section = "Complete"; - $uservalue=100; - $catvalue=100; - $linksvalue=100; - $customvalue=100; - $relcatvalue=100; - #callexit(); - break; - default: - $section = "Initializing"; - $uservalue=0; - $catvalue=0; - $linksvalue=0; - $customvalue=0; - $relcatvalue=0; - break; - } - displayheader(); - displaytablestart(); - displayrow1("Importing In-Link to In-Portal:"," "); - displayrow2("Users:",$uservalue."%"); - displayrow1("Categories:",$catvalue."%"); - displayrow2("Links (Including Reviews and Images):",$linksvalue."%"); - displayrow1("Custom Fields:",$customvalue."%"); - displayrow2("Category Relations:",$relcatvalue."%"); - displayrow1("Importing:",$section); - displaytableover(); - displaytablestart(); - displaybar($percent); - displaytableover(); - displayfooter(); - - if ($section == "Complete") { - $ado = &GetADODBConnection(); - $TablePrefix = "ses_".$objSession->GetSessionKey()."_".GetTablePrefix(); - - $query="DROP TABLE IF EXISTS ".$TablePrefix."import, ".$TablePrefix."importcat"; - $ado->Execute($query); - } - } - function callexit() #In case importing is over - { - /* global $pathtoroot; - require_once ($pathtoroot."admin/import/exit.php"); - displaytablestart(); - displayrow1("Importing In-Link to In-Portal:"," "); - displayrow2("Users:",$uservalue."%"); - displayrow1("Categories:",$catvalue."%"); - displayrow2("Links (Including Reviews and Images):",$linksvalue."%"); - displayrow1("Custom Fields:",$customvalue."%"); - displayrow2("Category Relations:",$relcatvalue."%"); - displayrow1("Importing:",$section); - displaytableover(); - displaytablestart(); - displaybar($percent); - displaytableover(); - displayfooter(); -*/ - } - function displayheader() - { - global $title; - - int_header(null,NULL,$title); - //echo ''; - //echo ''; - //echo 'Importing In-Link to In-Portal '; - //echo ''; - //echo ''; - //echo ''; - } - function displaytablestart() - { - echo ''; - - } - function displaytableover() - { - echo "
    "; - } - function displayfooter() - { - echo ""; - echo ""; - } - function displayrow1($name,$value) - { - echo ''; - echo $name; - echo ''; - echo $value; - echo ''; - } - function displayrow2($name,$value) - { - echo ''; - echo $name; - echo ''; - echo $value; - echo ''; - } - - function displaybar($percent) - { - global $rootURL, $title; - - $o = ""; - - echo "\n"; - $o .= int_subsection_title_ret(admin_language("la_performing_import")." - ".$percent."%"); - $o .= "

    "; - $o .= " "; - $o .=" "; - $comp_pct = 100-$percent; - $o .= " "; - $o .= "
     
    "; - //$o .= "
    "; - echo $o."\n"; - echo "
    "; - -/* if ($percent == 0) - { - echo ""; - echo "$percent"; - echo "%"; - } - else if ($percent < 60) - { - echo ""; - $row2 = 100-$percent; - echo " $percent"; - echo "%"; - } - else if ($percent == 100) - { - echo "$percent%"; - } - else - { - echo "$percent%"; - $row2 = 100-$percent; - echo " "; - }*/ - } -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.41.2/in-link/admin/install/inportal_data.sql =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.41.2/in-link/admin/install/inportal_data.sql (revision 12746) +++ branches/unlabeled/unlabeled-1.41.2/in-link/admin/install/inportal_data.sql (revision 0) @@ -1,265 +0,0 @@ -INSERT INTO ConfigurationAdmin VALUES ('Link_SortField', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 4) AND (IsSystem = 0)', 10.01, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.01, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortField2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 4) AND (IsSystem = 0)', 10.02, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.02, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links', 'la_Text_Links', 'la_link_perpage_prompt', 'text', '', '', 10.03, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_NewDays', 'la_Text_Links', 'la_link_newdays_prompt', 'text', '', '', 10.05, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MinPopRating', 'la_Text_Links', 'la_fld_Link_MinPopRating', 'text', '', '', 10.06, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MaxHotNumber', 'la_Text_Links', 'la_fld_Link_MaxHotNumber', 'text', '', '', 10.08, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_EnhancedLinks', 'la_Text_Links', 'la_link_EnhancedLinks', 'checkbox', '', '', 10.09, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_AllowFreeListings', 'la_Text_Links', 'la_link_AllowFreeListings', 'checkbox', '', '', 10.1, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ShowPick', 'la_Text_Links', 'la_link_editorspick_prompt', 'checkbox', '', '', 10.11, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_UrlStatus', 'la_Text_Links', 'la_link_urlstatus_prompt', 'checkbox', '', '', 10.12, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'ReviewText=la_common_ReviewText,CreatedOn=la_common_CreatedOn', 20.01, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 20.01, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'ReviewText=la_common_ReviewText,date=la_common_CreatedOn', 20.02, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 20.02, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('Link_MinPopVotes', 'la_Text_Links', 'la_fld_Link_MinPopVotes', 'text', '', '', 10.07, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_LinkReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 20.03, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links_Short', 'la_Text_Links', 'la_link_perpage_short_prompt', 'text', '', '', 10.04, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Name', 'la_Text_Link_Search', 'la_Link_Name', 'checkbox', '', '', 2, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Description', 'la_Text_Link_Search', 'la_Link_Description', 'checkbox', '', '', 1, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Url', 'la_Text_Link_Search', 'la_Link_Url', 'checkbox', '', '', 5, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CreatedOn', 'la_Text_Link_Search', 'la_Link_CreatedOn', 'checkbox', '', '', 5, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Hits', 'la_Text_Link_Search', 'la_Link_Hits', 'checkbox', '', '', 6, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedRating', 'la_Text_Link_Search', 'la_Link_CatchedRating', 'checkbox', '', '', 7, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedVotesQty', 'la_Text_Link_Search', 'la_Link_CatchedVotesQty', 'checkbox', '', '', 8, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedReviewsQty', 'la_Text_Link_Search', 'la_Link_CatchedReviewsQty', 'checkbox', '', '', 9, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Value', 'la_Text_Links', 'la_prompt_DupReviews', 'text', '', '', 10.13, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Interval', 'la_Text_Links', 'la_prompt_DupReviews', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.13, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Value', 'la_Text_Links', 'la_prompt_DupRating', 'text', '', '', 10.14, 1, 1); -INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Interval', 'la_Text_Links', 'la_prompt_DupRating', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.14, 2, 1); -INSERT INTO ConfigurationAdmin VALUES ('l_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 30.01, 0, 0); -INSERT INTO ConfigurationAdmin VALUES ('l_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 30.02, 0, 0); - -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_links', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_links', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_links', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_links', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_links', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 0, 1); - -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Links', '10', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortField', 'Name', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortOrder', 'asc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortField2', 'Description', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortOrder2', 'desc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_NewDays', '100', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_MinPopRating', '5', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_MaxHotNumber', '5', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_EnhancedLinks', '0', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_AllowFreeListings', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ShowPick', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_UrlStatus', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsSort', 'CreatedOn', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsOrder', 'desc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsSort2', 'ReviewText', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsOrder2', 'asc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_MinPopVotes', '20', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_LinkId', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Name', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Description', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Url', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CreatedOn', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Hits', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CatchedRating', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CatchedVotesQty', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CatchedReviewsQty', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_ReviewById', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Priority', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Status', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_EditorsPick', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_ResourceId', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_HotItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_PopItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_NewItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_ReviewDelay_Value', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_ReviewDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_RatingDelay_Value', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_RatingDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_Root', '{LinkCatId}', 'In-Portal', '') -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Links_Short', '3', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_Highlight_OpenTag', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_Highlight_CloseTag', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LinkReviews_Short', '3', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LinkReviews', '10', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'l_CategoryTemplate', 'inlink/index', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (NULL, 'l_ItemTemplate', 'inlink/detail', 'In-Link', 'in-link:configuration_output'); - -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Keyword_links', '90', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Pop_links', '5', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Rating_links', '5', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Increase_links', '30', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_ShowMultiple_links', '0', 'In-Link', 'in-link:configuration_search'); - -INSERT INTO ConfigurationValues VALUES (NULL, 'StartValidationTime', '0', 'In-Link', ''); -INSERT INTO ConfigurationValues VALUES (NULL, 'LastExpirationTime', '0', 'In-Link', ''); -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_RatingToPop', '5', 'In-Link', 'in-link:configuration_output'); - -INSERT INTO Events VALUES (7, 'LINK.ADD', 2, 0, 'In-Link', 'la_event_link.add', 1) -INSERT INTO Events VALUES (8, 'LINK.MODIFY', 2, 0, 'In-Link', 'la_event_link.modify', 1) -INSERT INTO Events VALUES (9, 'LINK.REVIEW.ADD', 2, 0, 'In-Link', 'la_event_link.review.add', 1) -INSERT INTO Events VALUES (10, 'LINK.ADD', 1, 0, 'In-Link', 'la_event_link.add', 0) -INSERT INTO Events VALUES (11, 'LINK.APPROVE', 1, 0, 'In-Link', 'la_event_link.approve', 0) -INSERT INTO Events VALUES (12, 'LINK.DENY', 1, 0, 'In-Link', 'la_event_link.deny', 0) -INSERT INTO Events VALUES (13, 'LINK.MODIFY', 1, 0, 'In-Link', 'la_event_link.modify', 0) -INSERT INTO Events VALUES (14, 'LINK.MODIFY.APPROVE', 1, 0, 'In-Link', 'la_event_link.modify.approve', 0) -INSERT INTO Events VALUES (15, 'LINK.REVIEW.ADD', 1, 0, 'In-Link', 'la_event_link.review.add', 0) -INSERT INTO Events VALUES (16, 'LINK.REVIEW.APPROVE', 1, 0, 'In-Link', 'la_event_link.review.approve', 0) -INSERT INTO Events VALUES (17, 'LINK.REVIEW.DENY', 1, 0, 'In-Link', 'la_event_link.review.deny', 0) -INSERT INTO Events VALUES (40, 'LINK.ADD.PENDING', 1, 0, 'In-Link', 'la_event_link.add.pending', 0) -INSERT INTO Events VALUES (42, 'LINK.MODIFY.PENDING', 1, 0, 'In-Link', 'la_event_link.modify.pending', 0) -INSERT INTO Events VALUES (43, 'LINK.REVIEW.ADD.PENDING', 1, 0, 'In-Link', 'la_event_link.review.add.pending', 0) -INSERT INTO Events VALUES (46, 'LINK.MODIFY.DENY', 1, 0, 'In-Link', 'la_event_link.modify.deny', 0) -INSERT INTO Events VALUES ('', 'LINK.ENHANCE', '1', '0', 'In-Link', 'la_event_link.link.enhance', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE', '1', '0', 'In-Link', 'la_event_link.link.enhance', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.APPROVE', '0', '0', 'In-Link', 'la_event_link.link.enhance.approve', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.APPROVE', '1', '0', 'In-Link', 'la_event_link.link.enhance.approve', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.DENY', '0', '0', 'In-Link', 'la_event_link.link.enhance.deny', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.DENY', '1', '0', 'In-Link', 'la_event_link.link.enhance.deny', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXPIRE', '1', '0', 'In-Link', 'la_event_link.link.enhance.expire', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXPIRE', '1', '0', 'In-Link', 'la_event_link.link.enhance.expire', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXTEND', '1', '0', 'In-Link', 'la_event_link.link.enhance.extend', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXTEND', '1', '0', 'In-Link', 'la_event_link.link.enhance.extend', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW', '0', '0', 'In-Link', 'la_event_link.link.enhance.renew', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW.FAILED', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_failed', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW.FAILED', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_failed', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.CANCEL', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_cancel', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.CANCEL', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_cancel', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEWAL.NOTICE', '1', '0', 'In-Link', 'la_event_link.link.enhance.renewal_notice', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEWAL.NOTICE', '1', '0', 'In-Link', 'la_event_link.link.enhance.renewal_notice', '0') - -INSERT INTO ItemTypes VALUES (4, 'In-Link', 'l', 'Link', 'Name', 'CreatedById', 'Hits', 'CachedRating', 'la_ItemTab_Links', 1, 'in-link/admin/addlink.php', 'clsLink', 'Link'); - -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.ADD', 'lu_PermName_Link.Add_desc', 'lu_PermName_Link.Add_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.VIEW', 'lu_PermName_Link.View_desc', 'lu_PermName_Link.View_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.ADD.PENDING', 'lu_PermName_Link.Add.Pending_desc', 'lu_PermName_Link.Add.Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.MODIFY', 'lu_PermName_Link.Modify_desc', 'lu_PermName_Link.Modify_desc', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.DELETE', 'lu_PermName_Link.Delete_desc', 'lu_PermName_Link.Delete_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.RATE', 'lu_PermName_Link.Rate_desc', 'lu_PermName_Link.Rate_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.REVIEW', 'lu_PermName_Link.Review_desc', 'lu_PermName_Link.Review_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.REVIEW.PENDING', 'lu_PermName_Link.Review_Pending_desc', ' lu_PermName_Link.Review_Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.MODIFY.PENDING', 'lu_PermName_Link.Modify.Pending_desc', 'lu_PermName_Link.Modify.Pending_desc', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.MODIFY', 'lu_PermName_Link.Owner.Modify_desc', 'lu_PermName_Link.Owner.Modify_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.MODIFY.PENDING', 'lu_PermName_Link.Owner.Modify.Pending_desc', 'lu_PermName_Link.Owner.Modify.Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.DELETE', 'lu_PermName_Link.Owner.Delete_desc', 'lu_PermName_Link.Owner.Delete_error', 'In-Link'); - -INSERT INTO SearchConfig VALUES ('Link', 'OrgId', 0, 0, 'lu_fielddesc_link_orgid', 'lu_field_orgid', 'In-Link', 'la_text_link', 19, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'NewItem', 0, 1, 'lu_fielddesc_link_newitem', 'lu_field_newitem', 'In-Link', 'la_text_link', 18, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'PopItem', 0, 1, 'lu_fielddesc_link_popitem', 'lu_field_popitem', 'In-Link', 'la_text_link', 17, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'HotItem', 0, 1, 'lu_fielddesc_link_hotitem', 'lu_field_hotitem', 'In-Link', 'la_text_link', 16, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'ResourceId', 0, 1, 'lu_fielddesc_link_resourceid', 'lu_field_resourceid', 'In-Link', 'la_text_link', 15, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'EditorsPick', 0, 1, 'lu_fielddesc_link_editorspick', 'lu_field_editorspick', 'In-Link', 'la_text_link', 14, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Status', 0, 0, 'lu_fielddesc_link_status', 'lu_field_status', 'In-Link', 'la_text_link', 13, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Priority', 0, 0, 'lu_fielddesc_link_priority', 'lu_field_priority', 'In-Link', 'la_text_link', 12, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'ModifiedById', 0, 0, 'lu_fielddesc_link_modifiedbyid', 'lu_field_modifiedbyid', 'In-Link', 'la_text_link', 11, 0, 0, 'text', 'PortalUser.Login', '{ForeignTable}.PortalUserId={LocalTable}.ModifiedById', NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CreatedById', 0, 0, 'lu_fielddesc_link_createdbyid', 'lu_field_createdbyid', 'In-Link', 'la_text_link', 10, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedReviewsQty', 0, 0, 'lu_fielddesc_link_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Link', 'la_text_link', 9, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedVotesQty', 0, 0, 'lu_fielddesc_link_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Link', 'la_text_link', 8, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'LinkId', 0, 1, 'lu_fielddesc_link_linkid', 'lu_field_linkid', 'In-Link', 'la_text_link', 0, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Name', 1, 1, 'lu_fielddesc_link_name', 'lu_field_name', 'In-Link', 'la_text_link', 1, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Description', 1, 1, 'lu_fielddesc_link_description', 'lu_field_description', 'In-Link', 'la_text_link', 2, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Url', 1, 1, 'lu_fielddesc_link_url', 'lu_field_url', 'In-Link', 'la_text_link', 3, 0, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CreatedOn', 0, 1, 'lu_fielddesc_link_createdon', 'lu_field_createdon', 'In-Link', 'la_text_link', 4, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Modified', 0, 1, 'lu_fielddesc_link_modified', 'lu_field_modified', 'In-Link', 'la_text_link', 5, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Hits', 0, 1, 'lu_fielddesc_link_hits', 'lu_field_hits', 'In-Link', 'la_text_link', 6, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedRating', 0, 0, 'lu_fielddesc_link_cachedrating', 'lu_field_cachedrating', 'In-Link', 'la_text_link', 7, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); - -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) as LinkCount FROM <%prefix%>Link WHERE Status=1', NULL, 'la_prompt_ActiveLinks', 0, 1); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS TotalLinks FROM <%prefix%>Link', NULL, 'la_prompt_TotalLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS ActiveLinks FROM <%prefix%>Link WHERE Status = 1', NULL, 'la_prompt_ActiveLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS PendingLinks FROM <%prefix%>Link WHERE Status = 2', NULL, 'la_prompt_PendingLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS DisabledLinks FROM <%prefix%>Link WHERE Status = 0', NULL, 'la_prompt_DisabledLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS NewLinks FROM <%prefix%>Link WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Link_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>Link WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS HotLinks FROM <%prefix%>Link WHERE (HotItem = 1) OR (Hits >= <%m:config name="Link_VotesToHot"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS PopularLinks FROM <%prefix%>Link WHERE (PopItem = 1) OR ( (CachedRating >= <%link:hit_count type="top"%>) AND <%link:hit_count type="top"%> AND (PopItem = 2) )', NULL, 'la_prompt_PopularLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Link WHERE CachedRating > 0', NULL, 'la_prompt_LinksAverageRating', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT MAX(Hits) AS MaxLinksHits FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksHits', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT MAX(CachedVotesQty) AS MaxLinksVotes FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksVotes', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_NewestLinkDate', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_LastLinkUpdate', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_LinkReviews', 0, 2); - -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 14, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 14, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD.PENDING', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.DELETE', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.DELETE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.MODIFY', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.DELETE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.DELETE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.DELETE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:inlink_general.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:inlink_general.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_output.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_output.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_search.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_search.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_email.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_email.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.advanced:approve', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.advanced:decline', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.delete', 11, 1, 1, 0); - -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('in-link', 'In-Link', 'inlink_import', 'Intechnic In-Link 2.x', 'In-Link', 'link_image,user_admin,user_regular,init_cat', 1,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Gossamer Threads Links 2.x', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Gossamer Threads Links 2.x SQL version', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Sentraweb Indexu 3.x', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Links from CSV file [In-Link]', '', '', 1, 'csv'); - -INSERT INTO CustomField (Type, FieldName, FieldLabel, Heading, Prompt, ElementType, ValueList, DisplayOrder, OnGeneralTab, IsSystem) VALUES (1, 'l_ItemTemplate', 'l_ItemTemplate', 'la_title_SystemCF', 'l_ItemTemplate', 'text', NULL, 0, 0, 1); - -INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('In-Link', 'in-link/', 'l', '3.2.2', 1, 1, 'inlink/', 2, '1054738405'); \ No newline at end of file Index: branches/unlabeled/unlabeled-1.15.2/in-link/admin_templates/catalog_tab.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.15.2/in-link/admin_templates/catalog_tab.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.15.2/in-link/admin_templates/catalog_tab.tpl (revision 0) @@ -1,74 +0,0 @@ - - - - a_toolbar.AddButton( new ToolBarButton('in-link:new_link', '', function() { - std_precreate_item('', 'in-link/links/links_edit'); - }, true - ) ); - - - - - - - - - - - - - $Catalog.setItemCount('', ''); - $Catalog.setCurrentCategory('', ); - - - - - Grids[''].AddAlternativeGrid('', true); - - Grids[''].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','sep3','cut','copy','move_up','move_down','sep6')); - $Catalog.reflectPasteButton(); - $Catalog.setViewMenu(''); - - Grids[''].RadioMode = true; - Grids[''].DblClick = function() {return false}; - - #separator# - - - _" sequence="" width="%"> - - checkboxradio" name="" id=""> - "> - - - - " target="_blank"> - - - -
    -
    - - [ID: / ] Filename: - -
    - - (Added: / - Hits: / - Rating: / - Votes: / - Reviews: ) - -
    -
    - - - - - - - - -
    - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.15.2/in-link/units/links/link_tag_processor.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.15.2/in-link/units/links/link_tag_processor.php (revision 12746) +++ branches/unlabeled/unlabeled-1.15.2/in-link/units/links/link_tag_processor.php (revision 0) @@ -1,200 +0,0 @@ -Application->recallObject($this->Prefix, null, Array('skip_autoload' => true)); - $object->Load( $this->Application->GetVar($this->Prefix.'_id') ); - $sql = 'SELECT ListingTypeId FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$object->GetDBField('ResourceId'); - $listtype_id = $this->Conn->GetOne($sql); - $this->Application->SetVar('lst_id', $listtype_id); - return $listtype_id ? 1 : 0; - } - - function EnhancementIsPending($params) - { - $object =& $this->Application->recallObject($this->Prefix, null, Array('skip_autoload' => true)); - $object->Load( $this->Application->GetVar($this->Prefix.'_id') ); - $sql = 'SELECT Status FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$object->GetDBField('ResourceId'); - $status = $this->Conn->GetOne($sql); - return ($status == 2) ? 1 : 0; - } - - function ListingTypeField($params) - { - $object =& $this->Application->recallObject('l', null, Array('skip_autoload' => true)); - $object->Load( $this->Application->GetVar($this->getPrefixSpecial().'_id') ); - $sql = 'SELECT ListingTypeId FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$object->GetDBField('ResourceId'); - $lst_id = $this->Conn->GetOne($sql); - - $lst_object =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $lst_object->Load($lst_id); - return $lst_object->GetField($this->SelectParam($params, 'name,field')); - } - - function EnhancementField($params) - { - $object =& $this->Application->recallObject('l', null, Array('skip_autoload' => true)); - $object->Load( $this->Application->GetVar($this->getPrefixSpecial().'_id') ); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$object->GetDBField('ResourceId'); - $listing_id = $this->Conn->GetOne($sql); - - $listing_object =& $this->Application->recallObject('ls', null, Array('skip_autoload' => true)); - $listing_object->Load($listing_id); - return $listing_object->GetField($this->SelectParam($params, 'name,field')); - } - - function IsRenewalPeriod($params) - { - $object =& $this->Application->recallObject($this->getPrefixSpecial()); - $sql = 'SELECT ExpiresOn, ListingTypeId FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$object->GetDBField('ResourceId'); - $ls_info = $this->Conn->GetRow($sql); - $expiration = $ls_info['ExpiresOn']; - $lst_id = $ls_info['ListingTypeId']; - $sql = 'SELECT RenewalReminder FROM '.$this->Application->getUnitOption('lst', 'TableName').' - WHERE ListingTypeId = '.$lst_id; - $renewal_interval = $this->Conn->GetOne($sql) * 3600 * 24; - return ($expiration - adodb_mktime() < $renewal_interval) ? 1 : 0; - } - - function FirstListingType($params) - { - static $first = true; - if($first) - { - $first = false; - return true; - } - else - { - return false; - } - } - - function IsReocurringEnhancement($params) - { - $params['name'] = 'Recurring'; - return $this->ListingTypeField($params); - } - - function EnhanceUsingInCommerce($params) - { - if (!$this->Application->isModuleEnabled('In-Commerce')) { - return 0; - } - - $object =& $this->Application->recallObject($this->Prefix, null, Array('skip_autoload' => true)); - $object->Load( $this->Application->GetVar($this->Prefix.'_id') ); - $sql = 'SELECT ListingTypeId FROM '.$this->Application->getUnitOption('ls', 'TableName').' - WHERE ItemResourceId = '.$object->GetDBField('ResourceId'); - $listtype_id = $this->Conn->GetOne($sql); - - $lst_object =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $lst_object->Load($listtype_id); - - return $lst_object->GetDBField('EnableBuying'); - } - - function ClickLink($params) - { - $object =& $this->Application->recallObject( $this->getPrefixSpecial(), $this->Prefix, $params ); - return $this->Application->HREF( $params['t'], '', Array('l_id' => $object->GetID(), 'pass'=>'all,l' ) ); - } - - function ListRelatedLinks($params) - { - return $this->PrintList2($params); - } - - function LinkLink($params) - { - $params = array_merge($params, Array('pass' => 'all,m,l') ); - - $item_id = getArrayValue($params, 'link_id'); - if (!$item_id) { - $item_id = $this->Application->GetVar($this->Prefix.'_id'); - } - $params[$this->Prefix.'_id'] = $item_id; - - $object =& $this->getObject($params); - $params['m_cat_id'] = $object->GetDBField('CategoryId'); - - $main_processor =& $this->Application->recallObject('m_TagProcessor'); - return $main_processor->T($params); - } - - function ListingDescription($params) - { - $listing =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing->Load( $this->Application->GetVar('listing_type') ); - - return $listing->GetDBField('Description'); - } - - function ListingTypeDetailsLink($params) - { - $listing =& $this->Application->recallObject('lst'); - $params['listing_type'] = $listing->GetID(); - - $main_processor =& $this->Application->recallObject('m_TagProcessor'); - return $main_processor->Link($params); - } - - function GroupTitle($params) - { - $object =& $this->getObject($params); - - $grouping = $this->Application->RecallVar($this->getPrefixSpecial().'_dupe_fields'); - $grouping = explode('|', substr($grouping, 1, -1)); - - $ret = ''; - foreach ($grouping as $group_field) { - $ret .= $object->GetField($group_field).', '; - } - return preg_replace('/(.*), $/', '\\1', $ret); - } - - /** - * Go to link url - * - * @param Array $params - */ - function FollowLocation($params) - { - $id = $this->Application->GetVar($this->getPrefixSpecial().'_id'); - - if (!$id) { - trigger_error('No Link ID for redirect', E_USER_ERROR); - } - - $id_field = $this->Application->getUnitOption($this->Prefix, 'IDField'); - $table_name = $this->Application->getUnitOption($this->Prefix, 'TableName'); - - $sql = 'UPDATE '.$table_name.' - SET Hits = Hits + 1 - WHERE '.$id_field.' = '.$id; - $this->Conn->Query($sql); - - $sql = 'SELECT '.$params['field'].' - FROM '.$table_name.' - WHERE '.$id_field.' = '.$id; - $url = $this->Conn->GetOne($sql); - - if (preg_match('/^(http|ftp|mailto:)(.*)/U', $url)) { - header('Location: '.$url); - } - else { - header('Location: http://'.$url); - } - - exit; - } -} - -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.36.2/in-link/action.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.36.2/in-link/action.php (revision 12746) +++ branches/unlabeled/unlabeled-1.36.2/in-link/action.php (revision 0) @@ -1,592 +0,0 @@ -HasSystemPermission("SYSTEM_ACCESS.READONLY"); - -// Session expiration related - -require_login( !admin_login() && $Action, 'expired=1', true ); - -// End session exipration related - - switch($Action) - { - case "m_cat_delete": - if($ro_perm) break; - if(isset($CatDeleteList)) - { - $objLinkLink->BasePermission=""; - $CatList = $CatDeleteList; - if(is_array($CatList)) - { - for($i=0;$iClearCategoryItems($c,"CategoryItems"); - } - } - else - { - if(is_numeric($CatList)) - { - $objLinkList->ClearCategoryItems($CatList,"CategoryItems"); - } - } - $objLinkLink->BasePermission="LINK"; - if(!is_array($CatList)) $CatList=Array($CatList); - UpdateCategoryCount("Link",$CatList, $objLinkList->GetListTypes() ); - } - break; - case "m_paste": /* category paste */ - if($ro_perm) break; - if($PastedCatIds) - { - $objLinkLink->BasePermission=""; - $cache_cat_ids=Array(); - foreach($PastedCatIds as $SourceCat => $DestCat) // for each pasted category paste links in it - { - $cache_cat_ids[$SourceCat]=1; - $cache_cat_ids[$DestCat]=1; - $objLinkList->Clear(); - $objLinkList->Query_Link(GetTablePrefix()."CategoryItems.CategoryId=$SourceCat"); // get cat links - if($objLinkList->NumItems()>0) - { - foreach($objLinkList->Items as $item) - { - /* fields from categoryitems table */ - $item->UnsetField("CategoryId"); - $item->UnsetField("ItemResourceId"); - $item->UnsetField("PrimaryCat"); - $item->UnsetField("CachedNavBar"); - $item->CopyToNewResource($DestCat); - $item->AddToCategory($DestCat); - } - } - } - $objLinkLink->BasePermission="LINK"; - UpdateCategoryCount("Link", array_keys($cache_cat_ids), $objLinkList->GetListTypes()); - } - break; - - // Used from JS - case "link_paste": - if($ro_perm) break; - if($objLinkList->ItemsOnClipboard()>0) - { - $objLinkList->PasteFromClipboard($objCatList->CurrentCategoryID(),"Name"); - UpdateCategoryCount('Link', 0); - } - break; - - case "l_add_category": - $objEditItems = new clsLinkList(); - $objEditItems->SourceTable = $objSession->GetEditTable("Link"); - $r = $_POST["ResourceId"]; - $l = $objEditItems->GetItemByField("ResourceId",$_POST["ResourceId"]); - if(is_object($l)) - { - $table = $objSession->GetEditTable("CategoryItems"); - $CatList = explode(",",$_POST["CatList"]); - - // Get List of currect categories link is in - $link_cats = $l->CategoryMemberList($table); - $link_cats_arr = explode(",", $link_cats); - $objSession->SetVariable("HasChanges", 1); - if (count($CatList)) - { - for($i=0;$iGetByResource($CatList[$i]); - $cat = $c->Get("CategoryId"); - if(($cat>0) && !in_array($cat, $link_cats_arr)) - { - $l->AddToCategory($cat,$table); - } - } - } - } - } - break; - case "l_cat_delete": - $objSession->SetVariable("HasChanges", 1); - $objEditItems = new clsLinkList(); - $objEditItems->SourceTable = $objSession->GetEditTable("Link"); - $table = $objSession->GetEditTable("CategoryItems"); - $r = $_POST["ResourceId"]; - $i = $objEditItems->GetItemByField("ResourceId",$_POST["ResourceId"]); - if(is_object($i)) - { - $CatCount = $i->CategoryMemberCount($table); - $Primary = $i->GetPrimaryCategory(); - if($CatCount==count($CatList)) - { - $sql = "DELETE FROM $table WHERE CategoryId=$cat AND ItemResourceId=$r AND PrimaryCat=0"; -// echo $sql; - } - else - { - $CatList = $_POST["itemlist"]; - $ado = &GetADODBConnection(); - for($x=0;$xExecute($sql); - $CatCount--; - } - } - } - - for($x=0;$x1) - { - $sql = "DELETE FROM $table WHERE CategoryId=$cat AND ItemResourceId=$r"; - $ado->Execute($sql); - $CatCount--; - } - } - } - } - } - break; - - case 'l_primary_cat': - // change primary category of the link - $objEditItems = new clsLinkList(); - $objEditItems->SourceTable = $objSession->GetEditTable("Link"); - $link = $objEditItems->GetItemByField('ResourceId', $_REQUEST['ResourceId']); - if( is_object($link) ) - { - $new_cat = array_shift($_REQUEST['itemlist']); - $ci_table = $objSession->GetEditTable('CategoryItems'); - $link->SetPrimaryCategory($new_cat, $ci_table); - } - break; - - case "l_link_delete": - if($ro_perm) break; - if (count($_POST["linklist"]) >0) - { - $objLinkList->FlushCache($_POST["linklist"]); - foreach($_POST["linklist"] as $linkid) - { - $objLinkList->Delete_Item($linkid); - } - } - break; - - case "l_link_add": - - if($_POST["LinkEditStatus"]!=2) - { - $CreatedOn = DateTimestamp($_POST['link_date'],GetDateFormat(0, true)); - $CreatedOn += adodb_date('H')*3600 + adodb_date('i')*60 + adodb_date('s'); - - if(strlen($_POST["link_expire"]) && ((int)$_POST["link_expire"]>0)) - $Expire = DateTimestamp($_POST["link_expire"],GetDateFormat(0, true)); - else - $Expire = 0; - - $link_pick = (int)$_POST["link_pick"]; - - $Status = (int)$_POST["status"]; - $Hot=(int)$_POST["itemhot"]; - $Pop = (int)$_POST["itempop"]; - $New = (int)$_POST["itemnew"]; - - $html = (int)$_POST["html_enable"]; - $Name = inp_escape($_POST["link_name"],$html); - $Desc = inp_escape($_POST["link_desc"],$html); - $Priority = (int)$_POST["link_priority"]; - - //echo "Category:".$objCatList->CurrentCategoryID()."
    "; - $objEditItems = new clsLinkList(); - $objEditItems->SourceTable = $objSession->GetEditTable("Link"); - - if(strlen($_POST["link_owner"])) - { - if($_POST["link_owner"] == "root") - { - $CreatedById = -1; - } - else - { - $u = $objUsers->GetItemByField("Login",$_POST["link_owner"]); - if(is_object($u)) - { - $CreatedById = $u->Get("PortalUserId"); - } - else - $CreatedById = $objSession->Get("PortalUserId"); - } - } - else - $CreatedById = $objSession->Get("PortalUserId"); - - $posted_hits = $_POST['link_hits_show']; - - $posted_hits_arr = explode('.', $_POST['link_hits']); - - - $save_hits = $_POST['link_hits']; - if ($posted_hits_arr[0] != $posted_hits) { - $save_hits = $posted_hits; - } - - $l = $objEditItems->Add_Link($objCatList->CurrentCategoryID(), $Name, $Desc, $_POST["link_url"], $CreatedOn, $Expire, $Status, $link_pick, $New, $Pop, $Hot, $CreatedById, (int)$_POST["link_rating"], (int)$_POST["link_votes"],$save_hits, $Priority, GetVar('auto_filename'), GetVar('filename') ); - - // Erasing tag cache - //ClearTagCache(); -/* // Erasing count cache - EraseCountCache();*/ - - $objCustomEdit = new clsCustomDataList($objSession->GetEditTable("CustomMetaData")); - $objCustomEdit->LoadResource($l->Get("ResourceId")); - $CustomFields = new clsCustomFieldList(4); - $DataChanged = FALSE; - foreach($_POST as $key=>$value) - { - if(substr($key,0,1)=="_") - { - $field = substr($key,1); - $cvalue = $CustomFields->GetItemByField("FieldName",$field,FALSE); - - if(is_object($cvalue)) - { - $objCustomEdit->SetFieldValue($cvalue->Get("CustomFieldId"),$l->Get("ResourceId"),$value); - $DataChanged = TRUE; - } - } - } - if($DataChanged) - $objCustomEdit->SaveData(); - } - break; - - case "l_edit_link": - if($_POST["LinkEditStatus"]!=2) - { - $CreatedOn = DateTimestamp($_POST["link_date"],GetDateFormat(0, true)); - - if(strlen($_POST["link_expire"]) && ((int)$_POST["link_expire"]>0)) - $Expire = DateTimestamp($_POST["link_expire"],GetDateFormat(0, true)); - else - $Expire = 0; - - $Status = (int)$_POST["status"]; - $Hot=(int)$_POST["itemhot"]; - $Pop = (int)$_POST["itempop"]; - $New = (int)$_POST["itemnew"]; - $link_pick = (int)$_POST["link_pick"]; - - $html = (int)$_POST["html_enable"]; - $Name = inp_escape($_POST["link_name"],$html); - $Desc = inp_escape($_POST["link_desc"],$html); - $Priority = (int)$_POST["link_priority"]; - - if(strlen($_POST["link_owner"])) - { - if($_POST["link_owner"] == "root") - { - $CreatedById = -1; - } - else - { - $u = $objUsers->GetItemByField("Login",$_POST["link_owner"]); - if(is_object($u)) - { - $CreatedById = $u->Get("PortalUserId"); - } - else - $CreatedById = $objSession->Get("PortalUserId"); - } - } - else - $CreatedById = $objSession->Get("PortalUserId"); - - $posted_hits = $_POST['link_hits_show']; - - $posted_hits_arr = explode('.', $_POST['link_hits']); - - - $save_hits = $_POST['link_hits']; - if ($posted_hits_arr[0] != $posted_hits) { - $save_hits = $posted_hits; - } - - $objEditItems = new clsLinkList(); - $objEditItems->SourceTable = $objSession->GetEditTable("Link"); - $l = $objEditItems->Edit_Link($_POST["LinkId"], - inp_escape($Name, $html), - inp_escape($Desc, $html), - inp_escape($_POST["link_url"], $html), - $CreatedOn, $Expire, $Status, $link_pick, $New, $Pop, $Hot, - $_POST["link_rating"],(int)$_POST["link_votes"], - $save_hits,$Priority, GetVar('auto_filename'), GetVar('filename') ); - $l->Set("CreatedById",$CreatedById); - $l->Update(); - $objCustomEdit = new clsCustomDataList($objSession->GetEditTable("CustomMetaData")); - $objCustomEdit->LoadResource($l->Get("ResourceId")); - $CustomFields = new clsCustomFieldList(4); - $DataChanged = FALSE; - foreach($_POST as $key=>$value) - { - if(substr($key,0,1)=="_") - { - $field = substr($key,1); - $cvalue = $CustomFields->GetItemByField("FieldName",$field,FALSE); - - if(is_object($cvalue)) - { - $objCustomEdit->SetFieldValue($cvalue->Get("CustomFieldId"),$l->Get("ResourceId"),$value); - $DataChanged = TRUE; - } - } - } - if($DataChanged) - $objCustomEdit->SaveData(); - } - break; - - case "l_link_cut": - if($ro_perm) break; - if(isset($_POST["linklist"])) - { - $objLinkList->CopyToClipboard("CUT","ResourceId",$_POST["linklist"]); - // UpdateCategoryCount("Link"); - } - break; - - case "l_link_copy": - if($ro_perm) break; - if(isset($_POST["linklist"])) - { - $objLinkList->CopyToClipboard("COPY","ResourceId",$_POST["linklist"]); - } - break; - - case "l_link_move_up": - if($ro_perm) break; - if(isset($_POST["linklist"])) - foreach($_POST["linklist"] as $linkid) - { - $link = $objLinkList->GetItem($linkid); - $link->MoveUp(); - } - break; - - case "l_link_move_down": - if($ro_perm) break; - if (isset($_POST["linklist"])) - { $linklist=array_reverse($_POST["linklist"]); - foreach($linklist as $linkid) - { - $link = $objLinkList->GetItem($linkid); - $link->MoveDown(); - } - } - break; - - case "l_link_approve": - if($ro_perm) break; - if (isset($_POST["linklist"])) - { - $cat_ids=Array(); - $db =& GetADODBConnection(); - $update_sql = 'UPDATE '.GetTablePrefix().'Listings SET ItemResourceId = %s WHERE ItemResourceId = %s'; - foreach($_POST["linklist"] as $id) - { - $l = $objLinkList->GetItem($id); - if($l->Get("Status")==-2) - { - $OrgId = $l->Get("OrgId"); - if($OrgId) - { - $org = $objLinkList->GetItem($OrgId); - $OldResId = $org->Get("ResourceId"); - $NewResId = $l->Get("ResourceId"); - - if ($OldResId) { - $db->Execute( sprintf($update_sql, $NewResId, $OldResId) ); - } - elseif(IsDebugMode()) { - - echo 'Invalid ResourceID of Original Link: '; - print_pre($org->Data); - } - - - $ExpireInterval = $objConfig->Get("link_ExpireMod_Value") * $objConfig->Get("link_ExpireMod_Interval"); - if($ExpireInterval>0) - $l->Set("Expire",adodb_date("U")+$ExpireInterval); - $l->Set("OrgId",0); - $l->Approve(); - $cat_ids[]=$org->GetPrimaryCategory(); - $org->DeleteCustomData(); - $org->Delete(TRUE); - } - /*else - { - $ExpireInterval = $objConfig->Get("link_Expire_Value") * $objConfig->Get("link_Expire_Interval"); - if($ExpireInterval>0) - $link->Set("Expire",adodb_date("U")+$ExpireInterval); - }*/ - } - else - { - $l->Approve(); - $cat_ids[]=$l->GetPrimaryCategory(); - } - } - if($cat_ids) UpdateCategoryCount("Link",$cat_ids,$objLinkList->GetListTypes() ); - } - break; - - case "l_link_decline": - if($ro_perm) break; - if (isset($_POST["linklist"])) - { - $cat_ids = Array(); - foreach($_POST["linklist"] as $id) - { - $l = $objLinkList->GetItem($id); - $cat_ids[] = $l->GetPrimaryCategory(); - if($l->Get("Status")==-2) - { - $l->Delete(); - } - else - { - $l->Deny(); - } - - } - UpdateCategoryCount("Link", $cat_ids, $objLinkList->GetListTypes()); - } - break; - - case "l_deny_val_link": // deny - if($ro_perm) break; - if (isset($_POST["itemlist"])) - { - $cat_ids = Array(); - foreach($_POST["itemlist"] as $id) - { - $l = $objLinkList->GetItem($id); - $cat_ids[] = $l->GetPrimaryCategory(); - $l->Deny(); - } - UpdateCategoryCount("Link", $cat_ids, $objLinkList->GetListTypes()); - } - - break; - - case "l_approve_val_link": // approve - if($ro_perm) break; - if (isset($_POST["itemlist"])) - { - $cat_ids = Array(); - foreach($_POST["itemlist"] as $id) - { - $l = $objLinkList->GetItem($id); - $cat_ids[] = $l->GetPrimaryCategory(); - $l->Approve(); - } - UpdateCategoryCount("Link", $cat_ids, $objLinkList->GetListTypes()); - } - break; - - case "l_delete_val_link": // delete - if($ro_perm) break; - if (count($_POST["itemlist"]) >0) - { - $cat_ids = Array(); - foreach($_POST["itemlist"] as $id) - { - $l = $objLinkList->GetItem($id); - $cat_ids[] = $l->GetPrimaryCategory(); - $objLinkList->Delete_Item($id, true); - } - } - UpdateCategoryCount("Link", $cat_ids, $objLinkList->GetListTypes()); - break; - - case "l_reset_val_status_sel": // reset validation status - if($ro_perm) break; - if (count($_POST["itemlist"]) >0) - { - foreach($_POST["itemlist"] as $id) - $linksToReset.= $id.", "; - - $linksToReset = ereg_replace(", $", "", $linksToReset); if (strlen($linksToReset)) - { - $sql = "DELETE FROM ".GetTablePrefix()."LinkValidation WHERE LinkId IN ($linksToReset)"; - $conn1 = &GetADODBConnection(); - $conn1->Execute($sql); - } - } - break; - - case "l_config_general": - if($ro_perm) break; - $init = $_POST["init_cat"]; - $newcat = (int)$_POST["rootcat"]; - -// echo "INIT: $init; NEW: $newcat"; - - if($init != $newcat) - { - if($newcat != 0) - { - $c = $objCatList->GetItemByField('ResourceId',$newcat); - $newcat = is_object($c) ? $c->UniqueId() : 0; - } - $objModules->SetModuleRoot("In-Link",$newcat); - } - break; - } - - -if( ! $objSession->HasSystemPermission("SYSTEM_ACCESS.READONLY") ) -{ - if( GetVar('LinkEditStatus') == 1 ) - { - $link_ids = $objLinkList->CopyFromEditTable("LinkId"); - if($link_ids) - { - $db =& GetADODBConnection(); - $sql = 'SELECT ResourceId FROM '.$objLinkList->SourceTable.' WHERE LinkId IN ('.implode(',', $link_ids).')'; - $rids = $db->GetCol($sql); - $objCustomDataList->CopyFromEditTable("CustomDataId", $rids); - } - - $objImages = new clsImageList(); - $objImages->CopyFromEditTable("ImageId"); - $objLinkList->Clear(); - - $objLinkList->FlushCache($link_ids); - } - - if( GetVar('LinkEditStatus') == 2 ) - { - $objLinkList->PurgeEditTable("LinkId"); - $objLinkList->PurgeCatListEditTable(); - - $objReviewList = new clsItemReviewList(); - $objReviewList->PurgeEditTable(); - - $objImages = new clsImageList(); - $objImages->PurgeEditTable("ImageId"); - $objCustomDataList->PurgeEditTable("CustomDataId"); - $objLinkList->Clear(); - } -} -?> Index: branches/unlabeled/unlabeled-1.36.2/in-link/admin/install/inportal_data.sql =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.36.2/in-link/admin/install/inportal_data.sql (revision 12746) +++ branches/unlabeled/unlabeled-1.36.2/in-link/admin/install/inportal_data.sql (revision 0) @@ -1,264 +0,0 @@ -INSERT INTO ConfigurationAdmin VALUES ('Link_SortField', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 4) AND (IsSystem = 0)', 0,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder', 'la_Text_Links', 'la_link_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 1,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_SortField2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'Name=la_Link_Name,Description=la_Link_Description,Url=la_Link_URL,CreatedOn=la_Link_Date,Hits=la_Link_Hits,CachedRating=la_Link_Rating,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 4) AND (IsSystem = 0)', 3,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_SortOrder2', 'la_Text_Links', 'la_link_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 4,1) -INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links', 'la_Text_Links', 'la_link_perpage_prompt', 'text', '', '', 5,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_NewDays', 'la_Text_Links', 'la_link_newdays_prompt', 'text', '', '', 6,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_TopCount', 'la_Text_Links', 'la_link_newstopminrating_prompt', 'text', '', '', 7,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_VotesToHot', 'la_Text_Links', 'la_link_votestohot_prompt', 'text', '', '', 8,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_EnhancedLinks', 'la_Text_Links', 'la_link_EnhancedLinks', 'checkbox', '', '', 9, 1) -INSERT INTO ConfigurationAdmin VALUES ('Link_AllowFreeListings', 'la_Text_Links', 'la_link_AllowFreeListings', 'checkbox', '', '', 9, 1) -INSERT INTO ConfigurationAdmin VALUES ('Link_ShowPick', 'la_Text_Links', 'la_link_editorspick_prompt', 'checkbox', '', '', 10,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_UrlStatus', 'la_Text_Links', 'la_link_urlstatus_prompt', 'checkbox', '', '', 11,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'ReviewText=la_common_ReviewText,CreatedOn=la_common_CreatedOn', 11,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder', 'la_Text_Reviews', 'la_link_sortreviews_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 11,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsSort2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'ReviewText=la_common_ReviewText,date=la_common_CreatedOn', 12,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_ReviewsOrder2', 'la_Text_Reviews', 'la_link_sortreviews2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 13,1) -INSERT INTO ConfigurationAdmin VALUES ('Link_MinVotes', 'la_Text_Links', 'la_link_MinVotes_prompt', 'text', '', '', 9,1) -INSERT INTO ConfigurationAdmin VALUES ('Perpage_LinkReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 5,1) -INSERT INTO ConfigurationAdmin VALUES ('Perpage_Links_Short', 'la_Text_Links', 'la_link_perpage_short_prompt', 'text', '', '', 5,1) -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Name', 'la_Text_Link_Search', 'la_Link_Name', 'checkbox', '', '', 2,1) -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Description', 'la_Text_Link_Search', 'la_Link_Description', 'checkbox', '', '', 1,1) -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Url', 'la_Text_Link_Search', 'la_Link_Url', 'checkbox', '', '', 5,1) -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CreatedOn', 'la_Text_Link_Search', 'la_Link_CreatedOn', 'checkbox', '', '', 5,1) -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_Hits', 'la_Text_Link_Search', 'la_Link_Hits', 'checkbox', '', '', 6,1) -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedRating', 'la_Text_Link_Search', 'la_Link_CatchedRating', 'checkbox', '', '', 7,1) -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedVotesQty', 'la_Text_Link_Search', 'la_Link_CatchedVotesQty', 'checkbox', '', '', 8,1) -INSERT INTO ConfigurationAdmin VALUES ('Search_Link_CatchedReviewsQty', 'la_Text_Link_Search', 'la_Link_CatchedReviewsQty', 'checkbox', '', '', 9,1) -INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Value', 'la_Text_Links', 'la_prompt_DupReviews', 'text', '', '', 14,1) -INSERT INTO ConfigurationAdmin VALUES ('link_ReviewDelay_Interval', 'la_Text_Links', 'la_prompt_DupReviews', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 15,1) -INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Value', 'la_Text_Links', 'la_prompt_DupRating', 'text', '', '', 16,1) -INSERT INTO ConfigurationAdmin VALUES ('link_RatingDelay_Interval', 'la_Text_Links', 'la_prompt_DupRating', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 17,1) -INSERT INTO ConfigurationAdmin VALUES ('l_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 1, 0); -INSERT INTO ConfigurationAdmin VALUES ('l_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 1, 0); - -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_links', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_links', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_links', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_links', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 1); -INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_links', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 1); - -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Links', '10', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortField', 'Name', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortOrder', 'asc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortField2', 'Description', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_SortOrder2', 'desc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_NewDays', '100', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_TopCount', '5', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_VotesToHot', '5', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_EnhancedLinks', '0', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_AllowFreeListings', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ShowPick', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_UrlStatus', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsSort', 'CreatedOn', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsOrder', 'desc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsSort2', 'ReviewText', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_ReviewsOrder2', 'asc', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_MinVotes', '20', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_LinkId', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Name', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Description', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Url', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CreatedOn', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Hits', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CatchedRating', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CatchedVotesQty', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_CatchedReviewsQty', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_ReviewById', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Priority', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_Status', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_EditorsPick', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_ResourceId', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_HotItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_PopItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_Link_NewItem', '1', 'In-Link', 'in-link:configuration_search') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_ReviewDelay_Value', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_ReviewDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_RatingDelay_Value', '1', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'link_RatingDelay_Interval', '2419200', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_Root', '{LinkCatId}', 'In-Portal', '') -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Links_Short', '3', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_Highlight_OpenTag', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_Highlight_CloseTag', '', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LinkReviews_Short', '3', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_LinkReviews', '10', 'In-Link', 'in-link:configuration_output') -INSERT INTO ConfigurationValues VALUES (NULL, 'l_CategoryTemplate', 'inlink/index', 'In-Link', 'in-link:configuration_output'); -INSERT INTO ConfigurationValues VALUES (NULL, 'l_ItemTemplate', 'inlink/detail', 'In-Link', 'in-link:configuration_output'); - -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Keyword_links', '90', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Pop_links', '5', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Rating_links', '5', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Increase_links', '30', 'In-Link', 'in-link:configuration_search'); -INSERT INTO ConfigurationValues VALUES (NULL, 'Search_ShowMultiple_links', '0', 'In-Link', 'in-link:configuration_search'); - -INSERT INTO ConfigurationValues VALUES (NULL, 'StartValidationTime', '0', 'In-Link', ''); -INSERT INTO ConfigurationValues VALUES (NULL, 'LastExpirationTime', '0', 'In-Link', ''); -INSERT INTO ConfigurationValues VALUES (NULL, 'Link_RatingToPop', '5', 'In-Link', 'in-link:configuration_output'); - -INSERT INTO Events VALUES (7, 'LINK.ADD', 2, 0, 'In-Link', 'la_event_link.add', 1) -INSERT INTO Events VALUES (8, 'LINK.MODIFY', 2, 0, 'In-Link', 'la_event_link.modify', 1) -INSERT INTO Events VALUES (9, 'LINK.REVIEW.ADD', 2, 0, 'In-Link', 'la_event_link.review.add', 1) -INSERT INTO Events VALUES (10, 'LINK.ADD', 1, 0, 'In-Link', 'la_event_link.add', 0) -INSERT INTO Events VALUES (11, 'LINK.APPROVE', 1, 0, 'In-Link', 'la_event_link.approve', 0) -INSERT INTO Events VALUES (12, 'LINK.DENY', 1, 0, 'In-Link', 'la_event_link.deny', 0) -INSERT INTO Events VALUES (13, 'LINK.MODIFY', 1, 0, 'In-Link', 'la_event_link.modify', 0) -INSERT INTO Events VALUES (14, 'LINK.MODIFY.APPROVE', 1, 0, 'In-Link', 'la_event_link.modify.approve', 0) -INSERT INTO Events VALUES (15, 'LINK.REVIEW.ADD', 1, 0, 'In-Link', 'la_event_link.review.add', 0) -INSERT INTO Events VALUES (16, 'LINK.REVIEW.APPROVE', 1, 0, 'In-Link', 'la_event_link.review.approve', 0) -INSERT INTO Events VALUES (17, 'LINK.REVIEW.DENY', 1, 0, 'In-Link', 'la_event_link.review.deny', 0) -INSERT INTO Events VALUES (40, 'LINK.ADD.PENDING', 1, 0, 'In-Link', 'la_event_link.add.pending', 0) -INSERT INTO Events VALUES (42, 'LINK.MODIFY.PENDING', 1, 0, 'In-Link', 'la_event_link.modify.pending', 0) -INSERT INTO Events VALUES (43, 'LINK.REVIEW.ADD.PENDING', 1, 0, 'In-Link', 'la_event_link.review.add.pending', 0) -INSERT INTO Events VALUES (46, 'LINK.MODIFY.DENY', 1, 0, 'In-Link', 'la_event_link.modify.deny', 0) -INSERT INTO Events VALUES ('', 'LINK.ENHANCE', '1', '0', 'In-Link', 'la_event_link.link.enhance', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE', '1', '0', 'In-Link', 'la_event_link.link.enhance', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.APPROVE', '0', '0', 'In-Link', 'la_event_link.link.enhance.approve', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.APPROVE', '1', '0', 'In-Link', 'la_event_link.link.enhance.approve', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.DENY', '0', '0', 'In-Link', 'la_event_link.link.enhance.deny', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.DENY', '1', '0', 'In-Link', 'la_event_link.link.enhance.deny', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXPIRE', '1', '0', 'In-Link', 'la_event_link.link.enhance.expire', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXPIRE', '1', '0', 'In-Link', 'la_event_link.link.enhance.expire', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXTEND', '1', '0', 'In-Link', 'la_event_link.link.enhance.extend', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.EXTEND', '1', '0', 'In-Link', 'la_event_link.link.enhance.extend', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW', '0', '0', 'In-Link', 'la_event_link.link.enhance.renew', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW.FAILED', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_failed', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEW.FAILED', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_failed', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.CANCEL', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_cancel', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.CANCEL', '1', '0', 'In-Link', 'la_event_link.link.enhance.renew_cancel', '0') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEWAL.NOTICE', '1', '0', 'In-Link', 'la_event_link.link.enhance.renewal_notice', '1') -INSERT INTO Events VALUES ('', 'LINK.ENHANCE.RENEWAL.NOTICE', '1', '0', 'In-Link', 'la_event_link.link.enhance.renewal_notice', '0') - - -INSERT INTO ItemTypes VALUES (4, 'In-Link', 'l', 'Link', 'Name', 'CreatedById', 'Hits', 'CachedRating', 'la_ItemTab_Links', 1, 'in-link/admin/addlink.php', 'clsLink', 'Link'); - -INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('In-Link', 'in-link/', 'l', '3.2.0', 1, 1, 'inlink/', 2, '1054738405'); - -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.ADD', 'lu_PermName_Link.Add_desc', 'lu_PermName_Link.Add_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.VIEW', 'lu_PermName_Link.View_desc', 'lu_PermName_Link.View_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.ADD.PENDING', 'lu_PermName_Link.Add.Pending_desc', 'lu_PermName_Link.Add.Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.MODIFY', 'lu_PermName_Link.Modify_desc', 'lu_PermName_Link.Modify_desc', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.DELETE', 'lu_PermName_Link.Delete_desc', 'lu_PermName_Link.Delete_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.RATE', 'lu_PermName_Link.Rate_desc', 'lu_PermName_Link.Rate_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.REVIEW', 'lu_PermName_Link.Review_desc', 'lu_PermName_Link.Review_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.REVIEW.PENDING', 'lu_PermName_Link.Review_Pending_desc', ' lu_PermName_Link.Review_Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.MODIFY.PENDING', 'lu_PermName_Link.Modify.Pending_desc', 'lu_PermName_Link.Modify.Pending_desc', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.MODIFY', 'lu_PermName_Link.Owner.Modify_desc', 'lu_PermName_Link.Owner.Modify_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.MODIFY.PENDING', 'lu_PermName_Link.Owner.Modify.Pending_desc', 'lu_PermName_Link.Owner.Modify.Pending_error', 'In-Link'); -INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('LINK.OWNER.DELETE', 'lu_PermName_Link.Owner.Delete_desc', 'lu_PermName_Link.Owner.Delete_error', 'In-Link'); - -INSERT INTO SearchConfig VALUES ('Link', 'OrgId', 0, 0, 'lu_fielddesc_link_orgid', 'lu_field_orgid', 'In-Link', 'la_text_link', 19, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'NewItem', 0, 1, 'lu_fielddesc_link_newitem', 'lu_field_newitem', 'In-Link', 'la_text_link', 18, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'PopItem', 0, 1, 'lu_fielddesc_link_popitem', 'lu_field_popitem', 'In-Link', 'la_text_link', 17, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'HotItem', 0, 1, 'lu_fielddesc_link_hotitem', 'lu_field_hotitem', 'In-Link', 'la_text_link', 16, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'ResourceId', 0, 1, 'lu_fielddesc_link_resourceid', 'lu_field_resourceid', 'In-Link', 'la_text_link', 15, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'EditorsPick', 0, 1, 'lu_fielddesc_link_editorspick', 'lu_field_editorspick', 'In-Link', 'la_text_link', 14, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Status', 0, 0, 'lu_fielddesc_link_status', 'lu_field_status', 'In-Link', 'la_text_link', 13, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Priority', 0, 0, 'lu_fielddesc_link_priority', 'lu_field_priority', 'In-Link', 'la_text_link', 12, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'ModifiedById', 0, 0, 'lu_fielddesc_link_modifiedbyid', 'lu_field_modifiedbyid', 'In-Link', 'la_text_link', 11, 0, 0, 'text', 'PortalUser.Login', '{ForeignTable}.PortalUserId={LocalTable}.ModifiedById', NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CreatedById', 0, 0, 'lu_fielddesc_link_createdbyid', 'lu_field_createdbyid', 'In-Link', 'la_text_link', 10, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedReviewsQty', 0, 0, 'lu_fielddesc_link_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Link', 'la_text_link', 9, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedVotesQty', 0, 0, 'lu_fielddesc_link_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Link', 'la_text_link', 8, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'LinkId', 0, 1, 'lu_fielddesc_link_linkid', 'lu_field_linkid', 'In-Link', 'la_text_link', 0, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Name', 1, 1, 'lu_fielddesc_link_name', 'lu_field_name', 'In-Link', 'la_text_link', 1, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Description', 1, 1, 'lu_fielddesc_link_description', 'lu_field_description', 'In-Link', 'la_text_link', 2, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Url', 1, 1, 'lu_fielddesc_link_url', 'lu_field_url', 'In-Link', 'la_text_link', 3, 0, 2, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CreatedOn', 0, 1, 'lu_fielddesc_link_createdon', 'lu_field_createdon', 'In-Link', 'la_text_link', 4, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Modified', 0, 1, 'lu_fielddesc_link_modified', 'lu_field_modified', 'In-Link', 'la_text_link', 5, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'Hits', 0, 1, 'lu_fielddesc_link_hits', 'lu_field_hits', 'In-Link', 'la_text_link', 6, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO SearchConfig VALUES ('Link', 'CachedRating', 0, 0, 'lu_fielddesc_link_cachedrating', 'lu_field_cachedrating', 'In-Link', 'la_text_link', 7, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL); - -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) as LinkCount FROM <%prefix%>Link WHERE Status=1', NULL, 'la_prompt_ActiveLinks', 0, 1); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS TotalLinks FROM <%prefix%>Link', NULL, 'la_prompt_TotalLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS ActiveLinks FROM <%prefix%>Link WHERE Status = 1', NULL, 'la_prompt_ActiveLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS PendingLinks FROM <%prefix%>Link WHERE Status = 2', NULL, 'la_prompt_PendingLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS DisabledLinks FROM <%prefix%>Link WHERE Status = 0', NULL, 'la_prompt_DisabledLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS NewLinks FROM <%prefix%>Link WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Link_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>Link WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS HotLinks FROM <%prefix%>Link WHERE (HotItem = 1) OR (Hits >= <%m:config name="Link_VotesToHot"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) AS PopularLinks FROM <%prefix%>Link WHERE (PopItem = 1) OR ( (CachedRating >= <%link:hit_count type="top"%>) AND <%link:hit_count type="top"%> AND (PopItem = 2) )', NULL, 'la_prompt_PopularLinks', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Link WHERE CachedRating > 0', NULL, 'la_prompt_LinksAverageRating', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT MAX(Hits) AS MaxLinksHits FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksHits', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT MAX(CachedVotesQty) AS MaxLinksVotes FROM <%prefix%>Link', NULL, 'la_prompt_MaxLinksVotes', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_NewestLinkDate', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Link', NULL, 'la_prompt_LastLinkUpdate', 0, 2); -INSERT INTO StatItem VALUES (0, 'In-Link', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_LinkReviews', 0, 2); - -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 14, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 14, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD.PENDING', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 12, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.DELETE', 13, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.DELETE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.MODIFY', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.DELETE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 11, 1, 0, {LinkCatId}); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.VIEW', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.ADD.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.DELETE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.RATE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.REVIEW.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.MODIFY.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.MODIFY.PENDING', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('LINK.OWNER.DELETE', 15, 0, 0, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:inlink_general.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:inlink_general.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_output.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_output.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_search.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_search.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_email.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_email.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:configuration_custom.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:duplicate_checker.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:validation_list.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.delete', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.advanced:approve', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:paid_listings.advanced:decline', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.view', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.add', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.edit', 11, 1, 1, 0); -INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-link:listing_types.delete', 11, 1, 1, 0); - -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('in-link', 'In-Link', 'inlink_import', 'Intechnic In-Link 2.x', 'In-Link', 'link_image,user_admin,user_regular,init_cat', 1,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Gossamer Threads Links 2.x', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Gossamer Threads Links 2.x SQL version', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Sentraweb Indexu 3.x', '', '', 0,'db'); -INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('', 'In-Link', '', 'Links from CSV file [In-Link]', '', '', 1, 'csv'); \ No newline at end of file Index: branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/export_progress.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/export_progress.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/export_progress.tpl (revision 0) @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
    - - 0% -
    -
    - - - - - -
     
    -
    - " name="events[l.export][OnExportCancel]" /> -
    - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/import_status_xml.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/import_status_xml.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/import_status_xml.tpl (revision 0) @@ -1,5 +0,0 @@ - - - -100 - Index: branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/import_progress.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/import_progress.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/import_progress.tpl (revision 0) @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
    - - 0% -
    -
    - - - - - -
     
    -
    - " name="events[l.import][OnExportCancel]" /> -
    - - - - Index: branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/export.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/export.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/export.tpl (revision 0) @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - - - - - - "> - - - - - - - "> - - - - - - - - - - -
    - - - - - - - - - - - -
    - " onclick="move_options_up('', 1)" class="button"> - " onclick="move_options_down('', 1)" class="button">
    -
    -

    :
    - - " value="" /> - - ', '')" class="button">
    -
    - ', ''); select_sort('');" class="button"> -
    - -
    -
     
    - - - - - - - - - - - - - -
    - checked name="" id="_1" value="1" /> - - -
    - error"> *: - " id="" value="" size="2" maxlength="1" />
    - (will look like "Category:Sub-category:Sub-sub-category") - -
    - checked name="" id="_2" value="2" /> - -
    - (the fields will be titled Category1..CategoryN accordingly) -
    -
     
    - - Index: branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/export_status_xml.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/export_status_xml.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/export_status_xml.tpl (revision 0) @@ -1,5 +0,0 @@ - - - -100 - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/links/links_custom.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/links/links_custom.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/links/links_custom.tpl (revision 0) @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/links/images_edit.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/links/images_edit.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/links/images_edit.tpl (revision 0) @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - - - - - - - - - - - -
    - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/links/links_relations.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/links/links_relations.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/links/links_relations.tpl (revision 0) @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - -
    - -
    - - - -"> -"> - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/links/links_reviews.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/links/links_reviews.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.3.2/in-link/admin_templates/links/links_reviews.tpl (revision 0) @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - -
    - -
    - - - - " id=""> - img/itemicons/">  - - - - - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.5.18/themes/default/inlink/detail/link.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.5.18/themes/default/inlink/detail/link.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.5.18/themes/default/inlink/detail/link.tpl (revision 0) @@ -1,62 +0,0 @@ - - - - - - - - - - - - -
    - - - - - - -

       
    -
    - - - - - - - - - - - - -
    ">" border="0" alt="jump to site" />

    - - - - -
    - " />')"><inp:m_language _Phrase=" />
    - " />')"> 
    -
    -

    - : ;
    - : , - : , - : , - : -

    - - -
    - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.18.2/in-link/admin/install/inportal_schema.sql =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.18.2/in-link/admin/install/inportal_schema.sql (revision 12746) +++ branches/unlabeled/unlabeled-1.18.2/in-link/admin/install/inportal_schema.sql (revision 0) @@ -1,103 +0,0 @@ -CREATE TABLE Link ( - LinkId int(11) NOT NULL auto_increment, - Name varchar(255) NOT NULL default '', - l1_Name varchar(255) NOT NULL default '', - l2_Name varchar(255) NOT NULL default '', - l3_Name varchar(255) NOT NULL default '', - l4_Name varchar(255) NOT NULL default '', - l5_Name varchar(255) NOT NULL default '', - Filename varchar(255) NOT NULL, - AutomaticFilename tinyint(3) unsigned NOT NULL default '0', - Description text, - Url varchar(255) NOT NULL default '', - CreatedOn double NOT NULL default '0', - Modified double NOT NULL default '0', - Expire double NOT NULL default '0', - Hits double(20, 6) NOT NULL default '0', - CachedRating varchar(10) default NULL, - CachedVotesQty int(11) NOT NULL default '0', - CachedReviewsQty int(11) default NULL, - CreatedById int(11) NOT NULL default '0', - ModifiedById int(11) NOT NULL default '0', - Priority int(11) NOT NULL default '0', - Status tinyint(4) NOT NULL default '2', - EditorsPick tinyint(4) NOT NULL default '0', - ResourceId int(11) default NULL, - HotItem tinyint(4) NOT NULL default '2', - PopItem tinyint(4) NOT NULL default '2', - NewItem tinyint(4) NOT NULL default '2', - OrgId int(11) default NULL, - PRIMARY KEY (LinkId), - UNIQUE KEY ResourceId (ResourceId), - KEY sorting (Priority,Name), - KEY Hits (Hits), - KEY Name (Name), - KEY EditorsPick (EditorsPick), - KEY CreatedOn (CreatedOn), - KEY Modified (Modified,CreatedOn), - KEY Status (Status), - KEY Filename (Filename(5)) -) -# -------------------------------------------------------- -CREATE TABLE LinkValidation ( - LinkValidationId int(11) NOT NULL auto_increment, - LinkId int(11) NOT NULL default '0', - ValidationTime double NOT NULL default '0', - ValidationCode varchar(50) default NULL, - ValidationStatus tinyint(4) NOT NULL default '0', - PRIMARY KEY (LinkValidationId), - UNIQUE KEY LinkId (LinkId) -) -# -------------------------------------------------------- -CREATE TABLE Listings ( - ListingId int(11) NOT NULL auto_increment, - ListingTypeId int(11) default '0', - ItemResourceId int(11) default NULL, - PurchasedOn int(11) default NULL, - ExpiresOn int(11) default NULL, - Status tinyint(4) default '0', - PendingRenewal tinyint(4) NOT NULL default '0', - RenewalReminderSent tinyint(4) NOT NULL default '0', - PRIMARY KEY (ListingId) -) -# -------------------------------------------------------- -CREATE TABLE ListingTypes ( - ListingTypeId int(11) NOT NULL auto_increment, - Name varchar(255) NOT NULL default '', - Description text NOT NULL, - Duration int(11) NOT NULL default '0', - DurationType int(11) NOT NULL default '0', - OnPurchaseEdPick tinyint(4) NOT NULL default '3', - OnPurchaseNew tinyint(4) NOT NULL default '3', - OnPurchasePop tinyint(4) NOT NULL default '3', - OnPurchaseHot tinyint(4) NOT NULL default '3', - OnPurchasePriorityAction tinyint(4) NOT NULL default '0', - OnPurchasePriorityValue tinyint(4) NOT NULL default '1', - OnPurchaseAddToCatEnabled tinyint(4) NOT NULL default '0', - OnPurchaseAddToCat int(11) NOT NULL default '0', - OnPurchaseStatus tinyint(4) NOT NULL default '3', - OnExpireEdPick tinyint(4) NOT NULL default '3', - OnExpireNew tinyint(4) NOT NULL default '3', - OnExpirePop tinyint(4) NOT NULL default '3', - OnExpireHot tinyint(4) NOT NULL default '3', - OnExpirePriorityAction tinyint(4) NOT NULL default '0', - OnExpirePriorityValue tinyint(4) NOT NULL default '1', - OnExpireRemoveFromCatEnabled tinyint(4) NOT NULL default '0', - OnExpireRemoveFromCat int(11) NOT NULL default '0', - OnExpireStatus tinyint(4) NOT NULL default '3', - RenewalReminder int(11) NOT NULL default '0', - EnableBuying tinyint(4) NOT NULL default '0', - ShopCartName varchar(255) default NULL, - Price double default NULL, - Recurring tinyint(4) NOT NULL default '0', - VirtualProductId int(11) NOT NULL default '0', - PRIMARY KEY (ListingTypeId) -) -# -------------------------------------------------------- -CREATE TABLE LinkCustomData ( - CustomDataId int(11) NOT NULL auto_increment, - ResourceId int(10) unsigned NOT NULL default '0', - KEY ResourceId (ResourceId), - PRIMARY KEY (CustomDataId) -) -# -------------------------------------------------------- \ No newline at end of file Index: branches/unlabeled/unlabeled-1.18.2/in-link/admin_templates/paid_listings/paid_listing_type_edit.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.18.2/in-link/admin_templates/paid_listings/paid_listing_type_edit.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.18.2/in-link/admin_templates/paid_listings/paid_listing_type_edit.tpl (revision 0) @@ -1,223 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - - - "> - - - - - - "> - - - - - - "> - - - - - - "> - - - - - - "> - - - - - - - "> - - - - - - "> - - - - - - "> - - - - - - "> - - - - - - - " value="" /> - - - - ', '', null, 'OnPreSaveListingType');"> - - - - - - - - - - - "> - - - - - -
    - " id="" value="" tabindex="" size="5"> - -  
    - " id="" value="" tabindex="" size="5"> - -  
     
    - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - " id="" value="" tabindex="" size="5"> - - - " id="" value="" tabindex="" size="5"> -
    - " name="" value=""> - " type="checkbox" id="_cb_" name="_cb_" onclick="update_checkbox(this, document.getElementById(''))"> - - - - - - - " name="" value=""> - " type="checkbox" id="_cb_" name="_cb_" onclick="update_checkbox(this, document.getElementById(''))"> - - - - - -
    - - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.59.2/in-link/units/links/links_config.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.59.2/in-link/units/links/links_config.php (revision 12746) +++ branches/unlabeled/unlabeled-1.59.2/in-link/units/links/links_config.php (revision 0) @@ -1,356 +0,0 @@ - 'l', - 'ItemClass' => Array('class'=>'kCatDBItem','file'=>'','build_event'=>'OnItemBuild'), - 'ListClass' => Array('class'=>'kCatDBList','file'=>'','build_event'=>'OnListBuild'), - 'EventHandlerClass' => Array('class' => 'LinksEventHandler', 'file' => 'links_event_handler.php', 'require_classes' => Array('kCatDBEventHandler'), 'build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'LinkTagProcessor','file'=>'link_tag_processor.php', 'require_classes' => Array('kCatDBTagProcessor'), 'build_event'=>'OnBuild'), - 'AutoLoad' => true, - 'Hooks' => Array(), - 'QueryString' => Array( - 1 => 'id', - 2 => 'Page', - 3 => 'Reviews_Page', // depricated (for old in-link) - 4 => 'event', - 5 => 'mode', - ), - 'CatalogItem' => true, - 'AdminTemplatePath' => 'links', - 'AdminTemplatePrefix' => 'links_', - 'IDField' => 'LinkId', - 'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events - - 'ItemType' => 4, - - 'StatisticsInfo' => Array( - 'pending' => Array( - 'icon' => 'icon16_link_pending.gif', - 'label' => 'la_Text_Links', - 'js_url' => "set_persistant_var('Link_View', 47, 'advanced_view', '#url#')", - 'url' => Array('t' => 'advanced_view', 'index_file' => 'advanced_view.php', 'SetTab' => 'links', 'pass' => 'm'), - 'status' => STATUS_PENDING, - ), - ), - - 'TitlePhrase' => 'la_Text_Link', // phrase used to specify item type in relationship list - - 'ViewMenuPhrase' => 'la_title_Links', - 'UsePendingEditing' => true, // item editing is controlled by LINK.ADD/EDIT, LINK.ADD/EDIT.PENDING permissions - - 'CatalogSelectorName' => 'linklist', // used in old catalog section - - 'ItemPropertyMappings' => Array( - 'NewDays' => 'Link_NewDays', // number of days item to be NEW - 'MinPopVotes' => 'Link_MinPopVotes', // minimum number of votes for an item to be POP - 'MinPopRating' => 'Link_MinPopRating', // minimum rating for an item to be POP - 'MaxHotNumber' => 'Link_MaxHotNumber', // maximum number of HOT items - - 'HotLimit' => 'Link_HotLimit', // variable name in inp_Cache table - 'ClickField' => 'Hits', // item click count is stored here (in item table) - ), - - 'TitleField' => 'Name', - - 'TitlePresets' => Array( - 'default' => Array( 'new_status_labels' => Array('l'=>'!la_title_AddingLink!'), - 'edit_status_labels' => Array('l'=>'!la_title_EditingLink!'), - 'new_titlefield' => Array('l'=>'!la_title_NewLink!'), - ), - - 'links_edit' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_General!"), - - 'link_list'=>Array( 'prefixes' => Array('c_List', 'l_List'), - 'format' => "!la_title_Categories! (#c_recordcount#) - !la_title_Links! (#l_recordcount#)", - ), - 'link_edit'=>Array( 'prefixes' => Array('l'), - 'new_titlefield' => Array('l'=>'!la_title_NewLink!'), - 'format' => "#l_status# '#l_titlefield#' - !la_title_General!", - ), - - 'links_categories'=>Array('prefixes' => Array('l','l-ci_List'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Categories!"), - 'links_relations'=> Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Relations!"), - 'links_images' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Images!"), - 'links_reviews' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Reviews!"), - 'links_custom' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Custom!"), - - 'images_edit' => Array( 'prefixes' => Array('l', 'l-img'), - 'new_status_labels' => Array('l-img'=>'!la_title_Adding_Image!'), - 'edit_status_labels' => Array('l-img'=>'!la_title_Editing_Image!'), - 'new_titlefield' => Array('l-img'=>'!la_title_New_Image!'), - 'format' => "#l_status# '#l_titlefield#' - #l-img_status# '#l-img_titlefield#'", - ), - - 'reviews_edit' => Array( 'prefixes' => Array('l', 'l-rev'), - 'new_status_labels' => Array('l-rev'=>"!la_title_Adding_Review! '!la_title_New_Review!'"), - 'edit_status_labels' => Array('l-rev'=>'!la_title_Editing_Review!'), - 'format' => "#l_status# '#l_titlefield#' - #l-rev_status#", - ), - - 'relations_edit' => Array( 'prefixes' => Array('l', 'l-rel'), - 'new_status_labels' => Array('l-rel'=>"!la_title_Adding_Relationship! '!la_title_New_Relationship!'"), - 'edit_status_labels' => Array('l-rel'=>'!la_title_Editing_Relationship!'), - 'format' => "#l_status# '#l_titlefield#' - #l-rel_status#", - ), - - 'links_export' => Array('format' => '!la_title_LinksExport!'), - - 'links_import' => Array('format' => '!la_title_ImportLinks!'), - - 'duplicate_links' => Array('prefixes' => Array('l.duplicates_List'), 'format' => "!la_title_DuplicateLinks! (#l.duplicates_recordcount#)"), - - 'tree_in-link' => Array('format' => '!la_Text_Version! '.$this->Application->findModule('Name', 'In-Link', 'Version')), - ), - - 'PermItemPrefix' => 'LINK', - - 'PermTabText' => 'In-Link', - 'PermSection' => Array('main' => 'CATEGORY:in-link:links_list', 'search' => 'in-link:configuration_search', 'email' => 'in-link:configuration_email', 'custom' => 'in-link:configuration_custom'), - - 'Sections' => Array( - 'in-link' => Array( - 'parent' => 'in-portal:root', - 'icon' => 'settings_in-link', - 'label' => 'la_title_In-Link', - 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view'), - 'priority' => 3.1, - 'type' => stTREE, - ), - - 'in-link:inlink_general' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_general', - 'label' => 'la_tab_GeneralSettings', - 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 1, - 'type' => stTREE, - ), - - 'in-link:configuration_output' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_output', - 'label' => 'la_tab_ConfigOutput', - 'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 2, - 'type' => stTREE, - ), - - 'in-link:configuration_search' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_search', - 'label' => 'la_tab_ConfigSearch', - 'url' => Array('t' => 'config/config_search', 'module_key' => 'links', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 3, - 'type' => stTREE, - ), - - 'in-link:configuration_email' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_email', - 'label' => 'la_tab_ConfigE-mail', - 'url' => Array('t' => 'config/config_email', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 4, - 'type' => stTREE, - ), - - 'in-link:configuration_custom' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_custom', - 'label' => 'la_tab_ConfigCustom', - 'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 4, 'pass_section' => true, 'pass' => 'm,cf'), - 'permissions' => Array('view', 'add', 'edit', 'delete'), - 'priority' => 5, - 'type' => stTREE, - ), - - 'in-link:duplicate_checker' => Array( - 'parent' => 'in-link', - 'icon' => 'duplicate_checker', - 'label' => 'la_tab_DuplicateChecker', - 'url' => Array('t' => 'in-link/duplicate_checker', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit', 'delete'), - 'priority' => 6, - 'type' => stTREE, - ), - - 'in-link:validation_list' => Array( - 'parent' => 'in-link', - 'icon' => 'validate', - 'label' => 'la_tab_LinkValidation', - 'url' => Array('index_file' => '../in-link/admin/validation.php', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit'), - 'priority' => 7, - 'type' => stTREE, - ), - ), - - 'FilterMenu' => Array( - 'Groups' => Array( - Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_new'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_hot'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_pop'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_pick'), 'type' => WHERE_FILTER), - ), - 'Filters' => Array( - 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), - 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ), - 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), - 's1' => Array(), - 'show_new' => Array('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ), - 'show_hot' => Array('label' => 'la_Text_Hot', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ), - 'show_pop' => Array('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ), - 'show_pick' => Array('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '`EditorsPick` != 1' ), - ) - ), - - 'TableName' => TABLE_PREFIX.'Link', - - 'CalculatedFields' => Array( - '' => Array ( - 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.CreatedById = -1, "root", IF (%1$s.CreatedById = -2, "Guest", "n/a")), u.Login)', - 'CategoryId' => TABLE_PREFIX.'%3$sCategoryItems.CategoryId', - 'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename', - 'CategoryFilename' => TABLE_PREFIX.'Category.NamedParentPath', - ), - ), - - 'CacheModRewrite' => true, - - 'AggregatedCalculatedFields' => Array( - - 'duplicates' => Array ( - 'DupeCount' => 'COUNT(*)', - ), - ), - - - 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId - LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'PermCache perm ON perm.CategoryId = '.TABLE_PREFIX.'CategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId - LEFT JOIN '.TABLE_PREFIX.'%3$sLinkCustomData cust ON %1$s.ResourceId = cust.ResourceId', - - ), // key - special, value - list select sql - - 'ListSortings' => Array( - '' => Array( - 'ForcedSorting' => Array('EditorsPick' => 'desc', 'Priority' => 'desc'), - 'Sorting' => Array('Name' => 'asc', 'Description' => 'desc'), - ) - ), - 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId - LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId - LEFT JOIN '.TABLE_PREFIX.'%3$sLinkCustomData cust ON %1$s.ResourceId = cust.ResourceId'), - - 'SubItems' => Array('l-rev', 'l-ci', 'l-rel', 'l-img', 'l-cdata'), - - 'Fields' => Array ( - 'LinkId' => Array(), - 'Name' => Array('type' => 'string', /*'formatter' => 'kMultiLanguage',*/ 'not_null' => 1, 'required' => 1, 'max_len' => 255), - 'AutomaticFilename' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1), - 'Description' => Array('type' => 'string', /*'formatter' => 'kMultiLanguage',*/ 'default' => ''), - 'Url' => Array('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''), - 'CreatedOn' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'default' => '#NOW#', 'not_null' => 1), - 'Modified' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'default' => '#NOW#', 'not_null' => 1), - 'Expire' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'not_null' => 1,'default' => ''), - 'Hits' => Array('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0), - 'CachedRating' => Array('type' => 'string', 'default' => '0'), - 'CachedVotesQty' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), - 'CachedReviewsQty' => Array('type' => 'int', 'default' => ''), - 'CreatedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => -1), - 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => -1), - 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => ''), - 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), - 'EditorsPick' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), - 'ResourceId' => Array('type' => 'int', 'default' => ''), - 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'OrgId' => Array('type' => 'int', 'default' => ''), - ), - - 'VirtualFields' => Array( - 'UserName' => Array('type' => 'string', 'default' => ''), - 'DupeCount' => Array('type' => 'string', 'default' => ''), - - // export related fields: begin - 'CategoryId' => Array('type' => 'int', 'default' => 0), - 'ExportFormat' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'CSV', /*2 => 'XML'*/), 'default' => 1), - 'ExportFilename' => Array('type' => 'string', 'default' => ''), - 'FieldsSeparatedBy' => Array('type' => 'string', 'default' => ','), - 'FieldsEnclosedBy' => Array('type' => 'string', 'default' => '"'), - 'LineEndings' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'Windows', 2 => 'UNIX'), 'default' => 1), - 'LineEndingsInside' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'CRLF', 2 => 'LF'), 'default' => 2), - 'IncludeFieldTitles' => Array('type' => 'int', 'default' => 1), - 'ExportColumns' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array()), - 'AvailableColumns' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array()), - 'CategoryFormat' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_MixedCategoryPath', 2 => 'la_SeparatedCategoryPath'), 'default' => 1), - 'CategorySeparator' => Array('type' => 'string', 'default' => ':'), - 'IsBaseCategory' => Array('type' => 'int', 'default' => 0), - // export related fields: end - - // import related fields: begin - 'FieldTitles' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Automatic', 2 => 'la_Manual'), 'default' => 1), - 'ImportSource' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Upload', 2 => 'la_Local'), 'default' => 2), - 'ImportFilename' => Array('type' => 'string', 'formatter' => 'kUploadFormatter', 'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => '/admin/export/'), - 'ImportLocalFilename' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'default' => ''), - 'CheckDuplicatesMethod' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_IDField', 2 => 'la_OtherFields'), 'default' => 1), - 'ReplaceDuplicates' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 0), - 'DuplicateCheckFields' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('Name' => 'NAME', 'Url' => 'URL'), 'default' => '|Name|Url|'), - 'SkipFirstRow' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'default' => 1), - // import related fields: end - - 'ThumbnailImage' => Array('type' => 'string', 'default' => ''), - 'FullImage' => Array('type' => 'string', 'default' => ''), - 'ImageAlt' => Array('type' => 'string', 'default' => ''), - - 'Filename' => Array('type' => 'string','not_null' => 1,'default' => ''), - 'CachedNavbar' => Array('type' => 'string', 'default' => ''), - ), - - 'Grids' => Array( - 'Default' => Array( - 'Icons' => Array(0 => 'icon16_link_disabled.gif', 1 => 'icon16_link.gif', 2 => 'icon16_link_pending.gif', -2 => 'icon16_link_pending.gif', 'HOT' => 'icon16_link_hot.gif', 'POP' => 'icon16_link_pop.gif', 'NEW' => 'icon16_link_new.gif', 'PICK' => 'icon16_link_pick.gif'), - 'Fields' => Array( - 'Name' => Array( 'title'=>'la_col_LinkName' , 'data_block' => 'grid_checkbox_td'), - 'Url' => Array( 'title'=>'la_col_LinkUrl' ), - 'Description' => Array( 'title'=>'la_col_Description' ), - 'Modified' => Array( 'title'=>'la_col_Modified' ), - ), - - ), - - - 'Duplicates' => Array( 'Icons' => Array('default' => 'icon16_link.gif'), - 'Fields' => Array( - 'Name' => Array( 'title'=>'la_col_LinkName' , 'data_block' => 'grid_checkbox_td'), - 'Url' => Array( 'title'=>'la_col_LinkUrl' ), - 'Description' => Array( 'title'=>'la_col_Description' ), - 'Modified' => Array( 'title'=>'la_col_Modified' ), - ), - - ), - ), - - - 'ConfigMapping' => Array( - 'PerPage' => 'Perpage_Links', - 'ShortListPerPage' => 'Perpage_Links_Short', - 'DefaultSorting1Field' => 'Link_SortField', - 'DefaultSorting2Field' => 'Link_SortField2', - 'DefaultSorting1Dir' => 'Link_SortOrder', - 'DefaultSorting2Dir' => 'Link_SortOrder2', - ), - ); -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.12.8/in-link/admin/addlink_reviews.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.12.8/in-link/admin/addlink_reviews.php (revision 12746) +++ branches/unlabeled/unlabeled-1.12.8/in-link/admin/addlink_reviews.php (revision 0) @@ -1,320 +0,0 @@ -SourceTable = $objSession->GetEditTable("Link"); -$objEditItems->EnablePaging = FALSE; -$objReviewList = new clsItemReviewList(); -$objReviewList->SourceTable = $objSession->GetEditTable("ItemReview"); - -$en = (int)GetVar('en'); -$objEditItems->Query_Item("SELECT * FROM ".$objEditItems->SourceTable); -$itemcount=$objEditItems->NumItems(); -$c = $objEditItems->GetItemByIndex($en); -if($itemcount>1) -{ - if ($en+1 == $itemcount) - $en_next = -1; - else - $en_next = $en+1; - if ($en == 0) - $en_prev = -1; - else - $en_prev = $en-1; -} - -//Set Section -$section = 'in-link:editlink_reviews'; -$saveURL = $admin."/".$objSession->GetVariable('ReturnScript'); -//Set Environment Variable -$envar = "env=" . BuildEnv() . "&en=$en"; - -$objListToolBar = new clsToolBar(); -$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('link','".$saveURL."',1);","tool_select.gif"); -$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_edit_save('link','".$saveURL."',2);","tool_cancel.gif"); -if($itemcount == 1) $objListToolBar->Add("divider"); - -$objListToolBar->Set("section",$section); -$objListToolBar->Set("load_menu_func",""); -$objListToolBar->Set("CheckClass","RevChecks"); -$objListToolBar->Set("CheckForm","link"); - -//Display header -$sec = $objSections->GetSection($section); -if ( isset($en_prev) || isset($en_next) ) -{ - $url = $RootUrl."/in-link/admin/addlink_reviews.php"; - $StatusField = "LinkEditStatus"; - $form = "link"; - MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,$StatusField,$url,$sec->Get("OnClick")); - $objListToolBar->Add("divider"); -} - -$listImages = array(); - //$img, $alt, $link, $onMouseOver, $onMouseOut, $onClick - -$objListToolBar->Add("new_review", "la_ToolTip_New_Review",$rootURL."in-link/admin/addreview.php?".$envar,"swap('new_review','toolbar/tool_new_review_f2.gif');", - "swap('new_review', 'toolbar/tool_new_review.gif');", - "","tool_new_review.gif"); - -$objListToolBar->Add("review_edit","la_ToolTip_Edit","#", "if (RevChecks.itemChecked()) swap('review_edit','toolbar/tool_edit_f2.gif');", - "if (RevChecks.itemChecked()) swap('review_edit', 'toolbar/tool_edit.gif');","if (RevChecks.itemChecked()) RevChecks.check_submit('addreview', '');", - "tool_edit.gif", true); -$listImages[] = "RevChecks.addImage('review_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); "; - -$objListToolBar->Add("review_del","la_ToolTip_Delete","#", "if (RevChecks.itemChecked()) swap('review_del','toolbar/tool_delete_f2.gif');", - "if (RevChecks.itemChecked()) swap('review_del', 'toolbar/tool_delete.gif');","if (RevChecks.itemChecked()) RevChecks.check_submit('addlink_reviews', 'm_review_delete');", - "tool_delete.gif"); -$listImages[] = "RevChecks.addImage('review_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); "; - -$objListToolBar->Add("divider"); - -$objListToolBar->Add("rev_app","la_ToolTip_Approve","#","if (RevChecks.itemChecked()) swap('rev_app','toolbar/tool_approve_f2.gif');", - "if (RevChecks.itemChecked()) swap('rev_app', 'toolbar/tool_approve.gif');","if (RevChecks.itemChecked()) RevChecks.check_submit('addlink_reviews', 'm_review_approve');", - "tool_approve.gif",FALSE,TRUE); -$listImages[] = "RevChecks.addImage('rev_app','$imagesURL/toolbar/tool_approve.gif','$imagesURL/toolbar/tool_approve_f3.gif',1); "; - -$objListToolBar->Add("rev_deny","la_ToolTip_Deny","#","if (RevChecks.itemChecked()) swap('rev_deny','toolbar/tool_decline_f2.gif');", - "if (RevChecks.itemChecked()) swap('rev_deny', 'toolbar/tool_decline.gif');","if (RevChecks.itemChecked()) RevChecks.check_submit('addlink_reviews', 'm_review_deny');", - "tool_deny.gif",FALSE,TRUE); -$listImages[] = "RevChecks.addImage('rev_deny','$imagesURL/toolbar/tool_decline.gif','$imagesURL/toolbar/tool_decline_f3.gif',1); "; - -$objListToolBar->Add("divider"); - -$objListToolBar->Add("rev_move_up","la_ToolTip_Move_Up","#", "if (RevChecks.itemChecked()) swap('rev_move_up','toolbar/tool_move_up_f2.gif');", - "if (RevChecks.itemChecked()) swap('rev_move_up', 'toolbar/tool_move_up.gif');","if (RevChecks.itemChecked()) RevChecks.check_submit('addlink_reviews', 'm_review_move_up');", - "tool_move_up.gif"); -$listImages[] = "RevChecks.addImage('rev_move_up','$imagesURL/toolbar/tool_move_up.gif','$imagesURL/toolbar/tool_move_up_f3.gif',1); "; - -$objListToolBar->Add("rev_move_down","la_ToolTip_Move_Down","#", "if (RevChecks.itemChecked()) swap('rev_move_down','toolbar/tool_move_down_f2.gif');", - "if (RevChecks.itemChecked()) swap('rev_move_down', 'toolbar/tool_move_down.gif');","if (RevChecks.itemChecked()) RevChecks.check_submit('addlink_reviews', 'm_review_move_down');", - "tool_move_down.gif"); -$listImages[] = "RevChecks.addImage('rev_move_down','$imagesURL/toolbar/tool_move_down.gif','$imagesURL/toolbar/tool_move_down_f3.gif',1); "; - -$objListToolBar->Add("divider"); -$objListToolBar->Add("viewmenubutton", "la_ToolTip_View","#","swap('viewmenubutton','toolbar/tool_view_f2.gif'); ", - "swap('viewmenubutton', 'toolbar/tool_view.gif');", - "ShowViewMenu();","tool_view.gif"); - -$objListToolBar->AddToInitScript($listImages); -$objListToolBar->AddToInitScript("fwLoadMenus(); \n"); - -// For filter warning -$Bit_Pending=4; -$Bit_Disabled=2; -$Bit_Valid=1; -$Bit_All = 7; - -/* determine current view menu settings */ -$UserView = $objConfig->Get("LinkRev_View"); - -if(!is_numeric($UserView)) -{ - $UserView = $Bit_All; //Set all bits ON - $UserFilter = ""; -} - -$filter = false; // always initialize variables before use -if($objSession->GetVariable("LinkRevSearchWord") != '') { - $filter = true; -} -else { - if ($UserView != $Bit_All) { - $filter = true; - } -} - -$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Link")." '".$c->Get("Name")."' - ".prompt_language("la_tab_Reviews"); - -int_header($objListToolBar,NULL, $title); -if ($objSession->GetVariable("HasChanges") == 1) { -?> - - - - -
    - -
    - - - - - - -
    - -
    - - - -itemID=$c->Get("ResourceId"); - -$pre = GetTablePrefix(); -$time = is12HourMode() ? '%r' : '%T'; - -$sql = "SELECT r.ReviewText as ReviewText, r.CreatedOn as CreatedOn,"; -$sql .=" ELT(r.Status+1,'".admin_language("la_Text_Disabled")."','".admin_language("la_Text_Enabled")."','"; -$sql .= admin_language("la_Text_Pending")."') as ReviewStatus, r.Priority as Priority, r.ReviewId as ReviewId, r.CreatedById as ReviewerId, "; -$sql .= "FROM_UNIXTIME(r.CreatedOn,'%m-%d-%Y $time') as DatePosted, pu.Login as Reviewer, r.Status FROM ".$objReviewList->SourceTable." as r "; -$sql .= "LEFT JOIN ".$pre."PortalUser as pu ON (pu.PortalUserId = r.CreatedById) "; -$sql .= "WHERE r.ItemId=".$c->Get("ResourceId"); - -if(strlen($RevFilter)) -{ - $sql .= " AND (".$RevFilter.")"; -} - -$SearchWords = $objSession->GetVariable("LinkRevSearchWord"); - -if(strlen($SearchWords)) -{ - $where = $objReviewList->AdminSearchWhereClause($SearchWords); -} -else - $where = ""; - -if(strlen($where)) - $sql .= " AND ($where) "; - -if(strlen(trim($objConfig->Get("LinkReview_LV_Sortfield")))) -{ - $order = " ORDER BY Priority DESC, ".$objConfig->Get("LinkReview_LV_Sortfield")." ".$objConfig->Get("LinkReview_LV_Sortorder"); -} -else -{ - $order = " ORDER BY Priority DESC, CreatedOn DESC"; -} - -$total_records = QueryCount('SELECT * FROM '.$objReviewList->SourceTable.' WHERE ItemId='.$c->Get('ResourceId') ); -$objReviewList->RefreshPage('Page_Reviews', $total_records); - -$sql .= $order." ".$objReviewList->GetLimitSQL(); - -if($objSession->HasSystemPermission("DEBUG.LIST")) - echo htmlentities($sql,ENT_NOQUOTES)."
    \n"; - -$objListView = new clsListView($objListToolBar); -$objListView->CurrentPageVar = "Page_Reviews"; -$objListView->PerPageVar = "Perpage_Reviews"; - -$objReviewList->Query_Item($sql); // , $objListView->GetLimitSQL() - -$SortOrder = $objConfig->Get("LinkReview_LV_Sortorder"); -if(!strlen($SortOrder)) - $SortOrder = "desc"; - -$SortField = $objConfig->Get("LinkReview_LV_Sortfield"); -if(!strlen($SortField)) - $SortField = "CreatedOn"; - -for($i=0;$iItems); $i++) -{ - if($objReviewList->Items[$i]->Get("ReviewerId")==-1) - { - $objReviewList->Items[$i]->Set("Reviewer","root"); - } - $rt = $objReviewList->Items[$i]->Get("ReviewText"); -// $rt = stripslashes($rt); - if(strlen($rt)>100) - { - $rt = substr($rt,0,100); - $rt .= " ..."; - } - $objReviewList->Items[$i]->Set("ReviewText",$rt); - - /* Do review Icons */ - $img = &$objReviewList->GetItemRefByIndex($i); - if(is_numeric($img->Get('Status'))) - { - $img_map=Array(0=>'icon16_review_disabled.gif',1=>'icon16_review.gif',2=>'icon16_review_pending.gif'); - $img->Set('Icon',$rootURL.'admin/images/itemicons/'.$img_map[ $img->Get('Status') ]); - } - -} - -$objListView->SetListItems(&$objReviewList); -$objListView->IdField = "ReviewId"; -$objListView->PageLinkTemplate = $pathtoroot.$admin."/templates/user_page_link.tpl"; - - -for($i=0;$iItems);$i++) - { - $img = &$objReviewList->GetItemRefByIndex($i); - $objListView->RowIcons[] = $img->Get("Icon"); - } - -$objListView->ColumnHeaders->Add("ReviewText",admin_language("la_prompt_ReviewText"),1,0,$order,"width=\"50%\"","LinkReview_LV_Sortfield","LinkReview_LV_Sortorder","ReviewText"); -$objListView->ColumnHeaders->Add("Reviewer",admin_language("la_Prompt_ReviewedBy"),1,0,$order,"width=\"20%\"","LinkReview_LV_Sortfield","LinkReview_LV_Sortorder","Reviewer"); -$objListView->ColumnHeaders->Add("DatePosted",admin_language("la_prompt_CreatedOn"),1,0,$order,"width=\"20%\"","LinkReview_LV_Sortfield","LinkReview_LV_Sortorder","CreatedOn"); -$objListView->ColumnHeaders->Add("ReviewStatus",admin_language("la_prompt_Status"),1,0,$order,"width=\"10%\"","LinkReview_LV_Sortfield","LinkReview_LV_Sortorder","ReviewStatus"); -$objListView->ColumnHeaders->SetSort($objConfig->Get("LinkReview_LV_Sortfield"), $objConfig->Get("LinkReview_LV_Sortorder")); - -$objListView->PrintToolBar = FALSE; -$objListView->SearchBar = TRUE; -$objListView->SearchKeywords = $SearchWords; -$objListView->SearchAction="l_review_search"; -$objListView->CheckboxName = "itemlist[]"; -$objListView->TotalItemCount = $total_records; -$objListView->extra_env = 'en='.(int)GetVar('en'); - - print $objListView->PrintList(); - -?> - "> - - - - -
    - -
    " name="viewmenu"> - - - - -
    -
    - - - -
    - - - - - Index: branches/unlabeled/unlabeled-1.1.4/in-link/admin/install/upgrades/changelog_3_3_0.txt =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.1.4/in-link/admin/install/upgrades/changelog_3_3_0.txt (revision 12746) +++ branches/unlabeled/unlabeled-1.1.4/in-link/admin/install/upgrades/changelog_3_3_0.txt (revision 0) @@ -1 +0,0 @@ \ No newline at end of file Index: branches/unlabeled/unlabeled-1.11.2/in-link/admin_templates/paid_listings/paid_listing_edit.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.11.2/in-link/admin_templates/paid_listings/paid_listing_edit.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.11.2/in-link/admin_templates/paid_listings/paid_listing_edit.tpl (revision 0) @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - "> - - - - - - - - - -
    Link Name: - - -  
    - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.11.2/in-link/admin_templates/duplicate_checker.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.11.2/in-link/admin_templates/duplicate_checker.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.11.2/in-link/admin_templates/duplicate_checker.tpl (revision 0) @@ -1,155 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - nobottomnotop"> - - - -
    - -
    -
    - - - - nobottomnotop"> - - - -
    - -
    - - - - - - - - - - - - " id="_" sequence=""> - - - - - - - - - - - - - - -
    "> - Link: (Duplicates: ) -
    - - - _Sort1" name="_Sort1" value=""> - _Sort1_Dir" name="_Sort1_Dir" value="asc"> -
    - - - - - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.11.2/in-link/admin_templates/links/links_edit.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.11.2/in-link/admin_templates/links/links_edit.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.11.2/in-link/admin_templates/links/links_edit.tpl (revision 0) @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - -
    - -
    - - - - - - - - - - - - - - - "> - - - - - - - - - - - - - - - - - - - - " /> - - - - - -
    - -
    - - - Index: branches/unlabeled/unlabeled-1.7.18/themes/default/inlink/edit_link/edit_link_form.tpl =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.7.18/themes/default/inlink/edit_link/edit_link_form.tpl (revision 12746) +++ branches/unlabeled/unlabeled-1.7.18/themes/default/inlink/edit_link/edit_link_form.tpl (revision 0) @@ -1,84 +0,0 @@ - -
    "> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - -


    (*)
    -


    *
    *
    *
    *
    *
    - - - - () - - "> - - "> - -
    -
     
      - " class="button"> - " class="button" onClick="javascript:history.back();"> -

    -
    - Index: branches/unlabeled/unlabeled-1.6.8/in-link/inlink_redirect.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.6.8/in-link/inlink_redirect.php (revision 12746) +++ branches/unlabeled/unlabeled-1.6.8/in-link/inlink_redirect.php (revision 0) @@ -1,46 +0,0 @@ -ApplicationDie('error: no link id specified'); - } - - $link = new clsLink($id); - - $link->debuglevel = 0; - $link->ClearCacheData(); - $link->Increment("hits", true); - $url = $link->Get("Url"); - -// $protocol = 'http'; - - if (preg_match('/^(http|ftp|mailto:)(.*)/U', $url)) { - header('Location: '.$url); - } - else { - header('Location: http://'.$url); - } - - exit; -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.50.2/in-link/parser.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.50.2/in-link/parser.php (revision 12746) +++ branches/unlabeled/unlabeled-1.50.2/in-link/parser.php (revision 0) @@ -1,1409 +0,0 @@ -GetVariable("LinkListType"); - $LastShortType = $objSession->GetVariable("LinkShortList"); - $NoPaging = (getArrayValue($attribs,'_paging')=='0' || getArrayValue($attribs,'_paging')=='false'); - if(!$NoPaging && !strlen($PagingList)) - { - $PagingList=$ListType; - } - //echo "Last: $LastList, Short: $LastShortType Current: $ListType, Short:".$attribs["_shortlist"]." PageList: $PagingList
    \n"; - - if($ListType==$PagingList) - { - $objLinkList->EnablePaging = TRUE; - //echo "Last: $LastList, Short: $LastShortType Current: $ListType, Short:".$attribs["_shortlist"]."
    \n"; - if($LastList != $ListType || $LastShortType != $attribs["_shortlist"]) - { - //echo "Resetting Page..
    \n"; - $l_var_list_update["p"] = 1; - $l_var_list["p"] = 1; - $objSession->SetVariable("LinkListType",$ListType); - $objSession->SetVariable("LinkShortList",$attribs["_shortlist"]); - $objLinkList->Page = 1; - } - else - $objLinkList->Page=$l_var_list["p"]; - } - else - { - if(is_numeric(getArrayValue($attribs,'_maxcount'))) - { - $objLinkList->MaxListCount = $attribs["_maxcount"]; - } - else { - $objLinkList->MaxListCount = 10; - } - - $objLinkList->EnablePaging = FALSE; - } - $objLinkList->ListType=$ListType; - - switch($ListType) - { - case "category": - $objLinkList->LoadListCategory($attribs); - break; - case "myitems": - $objLinkList->LoadMyItems($attribs); - break; - case "hot": - $objLinkList->LoadHotItems($attribs); - break; - case "pop": - $objLinkList->LoadPopItems($attribs); - break; - case "pick": - $objLinkList->LoadPickItems($attribs); - break; - case "favorites": - $objLinkList->LoadFavorites($attribs); - break; - case "search": - $attribs['multiple'] = 'links'; - $objLinkList->LoadSearchItems($attribs); - break; - case "new": - $objLinkList->LoadNewItems($attribs); - break; - case "my_new": - $scope = $objSession->CurrentUser->Vars["LastLogin"]; - $attribs["_scope"] = $scope; - $attribs["_show_since_last"] = 1; - //print_pre($objSession->CurrentUser); - if (is_numeric($scope) && $scope > 0) { - $objLinkList->LoadNewItems($attribs); - } - break; - default: - $objLinkList->Clear(); - break; - } /* end of switch */ -} - - -function l_ParseEnv($str = NULL) -{ - global $l_var_list, $objSession, $orderByClause, $objConfig; - - if ($str != NULL) - { - if( substr($str,0,2) == 'l-' ) - { - $str = preg_replace('/^([a-zA-Z]+)-([0-9]+)-(.*)/','\\1\\2-\\3', $str); - } - - $str = substr($str,1); - $pieces = explode("-", $str); - $l_var_list["id"] = $pieces[0]; - $l_var_list["p"] = $pieces[1]; - $l_var_list["rp"] = $pieces[2]; -// $l_var_list['event'] = $pieces[3]; - ResetPage('l'); - } - else - { - $l_var_list["id"] = 0; - $l_var_list["p"] = 1; - $l_var_list["rp"] = 1; -// $l_var_list['event'] = ''; - } -} - -function l_LoadEnv() -{ - global $objSession, $l_var_list; - - $str = $objSession->GetVariable("Env_Link"); - l_ParseEnv($str); -} - -function l_SaveEnv($str="") -{ - global $objSession; - - $str = $objSession->SetVariable("Env_Link",$str); -} - -function l_BuildEnv() -{ - $module_vars = Array('id','p','rp','event'); - return GenerateModuleEnv('l', $module_vars); -} - -function l_BuildEnv_NEW() -{ - $module_vars = Array('id' => 'l_id', 'p' => 'l_Page', 'rp' => 'l_Reviews_Page', 'event' => 'l_event'); - return GenerateModuleEnv_NEW('l', $module_vars); -} - -/* - @description: returns the date of the last modification to the link table - @attrib: _Part:: part of the date to display - @attrib: _local:bool: If set, returns the modified date for the current category (and subcats) - @example: -*/ -function l_link_modified($attribs) -{ - global $objConfig, $objCatList; - $ret=''; - $CachedValue = GetTagCache("inlink","l_link_modified",$attribs,""); - if(strlen($CachedValue)) - { - return $CachedValue; - } - $ado = &GetADODBConnection(); - if(getArrayValue($attribs,'_local') && $objCatList->CurrentCategoryID() != 0) - { - $c = $objCatList->GetItem($objCatList->CurrentCategoryID()); - $catlist = $c->GetSubCatIds(); - - $catwhere = "CategoryId IN (".explode(",",$catlist).")"; - $sql = "SELECT MAX(Modified) as ModDate,MAX(CreatedOn) as NewDate FROM ".GetTablePrefix()."Link "; - $sql .= "INNER JOIN ".GetTablePrefix()."CategoryItems ON (".GetTablePrefix()."Link.ResourceId=".GetTablePrefix()."CategoryItems.ItemResourceId) "; - $sql .= "WHERE $catwhere LIMIT 1"; - } - else - { - $sql = "SELECT MAX(Modified) as ModDate, MAX(CreatedOn) As NewDate FROM ".GetTablePrefix()."Link LIMIT 1"; - } - $rs = $ado->Execute($sql); - if($rs && ! $rs->EOF) - { - $new = $rs->fields["NewDate"]; - $mod = $rs->fields["ModDate"]; - if($new>$mod) $mod = $new; - if($mod) - { - $part = strtolower(getArrayValue($attribs,'_part')); - $ret = $part?ExtractDatePart($part,$mod):LangDate($mod); - } - } - if($ret) SaveTagCache("inlink","l_link_modified",$attribs,"",$ret); - return $ret; -} - -/* - @description: returns the date of the last review for a link - @attrib: _Part:: part of the date to display - @attrib: _LinkId:int: if set, the link to display the review modified date - @example: -*/ -function l_review_modified($attribs) -{ - global $objConfig, $objLinkList; - - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link = $objLinkList->GetItem($LinkId); - } - else - $link = $objLinkList->GetCurrentItem(); - if(is_object($link)) - { - $ado = &GetADODBConnection(); - $ResId = $link->Get("ResourceId"); - $sql = "SELECT MAX(CreatedOn) as ModDate FROM ".GetTablePrefix()."ItemReview WHERE ItemId=$ResId AND Status=1 LIMIT 1"; - $rs = $ado->Execute($sql); - if($rs && ! $rs->EOF) - { - $mod = $rs->fields["ModDate"]; - if($mod) - { - $part = strtolower($attribs["_part"]); - if(strlen($part)) - { - $ret = ExtractDatePart($part,$mod); - } - else - { - $ret = LangDate($mod); - } - } - } - } - return $ret; -} - -/* - @description: returns a link to the link (directory) root category - @attrib: _Category:int: Override the In-Link root category - @attrib: _Template:tpl: The template to link to - @example: -*/ -function l_root_link($attribs = array()) -{ - global $objConfig, $l_var_list_update, $objModules; - - //$RootCat = (int)$objConfig->Get("Link_Root"); - $RootCat = $objModules->GetModuleRoot("In-Link"); - if($RootCat != -1) - $attribs["_category"] = $RootCat; - $l_var_list_update["p"] = ""; - $l_var_list_update["id"] = ""; - $l_var_list_update["cat"] = ""; - $l_var_list_update["rp"] = ""; - - unset($l_var_list_update["p"],$l_var_list_update["id"],$l_var_list_update["cat"],$l_var_list_update["rp"]); - $o = m_template_link($attribs); - unset($l_var_list_update["p"],$l_var_list_update["id"],$l_var_list_update["cat"],$l_var_list_update["rp"]); - - return $o; - -} - -function l_form_load_values($FormName,$IdValue) -{ - global $FormValues, $objLinkList; - - switch ($FormName) { - case 'editlink': - $l =& $objLinkList->GetItem($IdValue); - $FormValues[$FormName]['name'] = stripslashes($l->Get('Name')); - $FormValues[$FormName]['url'] = stripslashes($l->Get('Url')); - $FormValues[$FormName]['description'] = stripslashes($l->Get('Description')); - $l->LoadCustomFields(); - if (is_array($l->CustomFields)) { - foreach ($l->CustomFields as $f => $v) { - if (is_array($v)) { - $FormValues[$FormName][$f] = $v; - $FormValues[$FormName][strtolower($f)] = $v; - } - } - } - break; - } -} - -/* - @description: Generates the ACTION property for a FORM tag used by In-Link - @attrib: _Template:tpl: If set, this is the template the form submits to (default is the current template) - @attrib: _Form:: The form name
    Possible Values: -
      -
    • addlink: add a link to the database -
    • addlink_confirm: Confirm for addlink -
    • editlink: Modify an existing link -
    • editlink_confifirm: Confirmation for link modify -
    • l_rate: Form used to rate a link -
    • l_rate_confirm: Confirm for rate link -
    • l_addreview: add a review for a link -
    • l_review_confirm: Review confirmation -
    • l_delete_confirm: Form to confirm link delete (prior to delete) -
    • l_sort_links: Form to sort links and set number of results -
    • l_getting_rated: Form for external rating -
    - @example:
    "> -*/ -function l_form_action($attribs = array()) -{ - global $var_list_update, $var_list, $l_var_list, $l_var_list_update, $objSession, $objLinkList; - - $var_list_update['t'] = getArrayValue($attribs, '_template') ? $attribs['_template'] : $var_list['t']; - - if( is_object($objLinkList) && $objLinkList->CurrentItem ) $l_var_list_update['id'] = $objLinkList->CurrentItem; - - $ret = ''; - $form = strtolower( $attribs['_form'] ); - $url_params = Array(); - - switch($form) - { - case 'addlink': - /* add link needs to be passed in: _CompleteTemplate=... _PendingTemplate=... _DestinationTemplate=... */ - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_add_link', 'DestTemplate' => $attribs['_finishtemplate'] ); - if ( $objSession->HasCatPermission('LINK.ADD.PENDING') ) - { - $url_params['Confirm'] = $attribs[ getArrayValue($attribs, '_confirmpending') ? '_confirmpending' : '_confirm' ]; - $url_params['Action'] = 'l_add_link_confirm'; - } - - if ( $objSession->HasCatPermission('LINK.ADD') ) - { - $url_params['Confirm'] = $attribs['_confirm']; - $url_params['Action'] = 'l_add_link_confirm'; - } - if( !$url_params['Confirm'] ) unset($url_params['Confirm']); - } - break; - - case 'addlink_confirm': - $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t']; - break; - - case 'editlink': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_edit_link', 'DestTemplate' => $attribs['_finishtemplate'] ); - if ( $objSession->HasCatPermission('LINK.MODIFY.PENDING') ) - { - $url_params['Confirm'] = $attribs[ getArrayValue($attribs, '_confirmpending') ? '_confirmpending' : '_confirm' ]; - } - - if ( $objSession->HasCatPermission('LINK.MODIFY') ) - { - $url_params['Confirm'] = $attribs['_confirm']; - } - - if( !$url_params['Confirm'] ) unset($url_params['Confirm']); - l_form_load_values( $form, $l_var_list['id'] ); - } - break; - - case 'editlink_confirm': - $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t']; - break; - - - case 'l_rate': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_rate_link', 'DestTemplate' => $attribs['_finishtemplate'] ); - if ( $objSession->HasCatPermission('LINK.RATE') && getArrayValue($attribs, '_confirm') ) $url_params['Confirm'] = $attribs['_confirm']; - $l_var_list_update['id'] = $objLinkList->CurrentItem; - - if( getArrayValue($attribs, '_duplicate') ) $url_params['Duplicate'] = $attribs['_duplicate']; - } - break; - - case 'l_getting_rated': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_rate_link', 'DestTemplate' => $attribs['_finishtemplate'] ); - if ($objSession->HasCatPermission("LINK.RATE") && getArrayValue($attribs, '_confirm') ) $url_params['Confirm'] = $attribs['_confirm']; - $var_list_update['t'] = 'inlink/rate'; - $l_var_list_update['id'] = $objLinkList->CurrentItem; - if( getArrayValue($attribs, '_duplicate') ) $url_params['Duplicate'] = $attribs['_duplicate']; - } - break; - - case 'l_sort_links': - $url_params = Array('Action' => 'l_sort_links'); - break; - - case 'l_rate_confirm': - $l_var_list_update['id'] = $objLinkList->CurrentItem; - $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t']; - break; - - case 'l_addreview': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - $url_params = Array( 'Action' => 'l_add_review', 'DestTemplate' => $attribs['_finishtemplate'] ); - $l_var_list_update['id'] = $objLinkList->CurrentItem; - - if ( $objSession->HasCatPermission('LINK.REVIEW.PENDING') ) - { - $url_params['Confirm'] = $attribs[ getArrayValue($attribs, '_confirmpending') ? '_confirmpending' : '_confirm' ]; - } - - if ( $objSession->HasCatPermission('LINK.REVIEW') ) $url_params['Confirm'] = $attribs['_confirm']; - if( !$url_params['Confirm'] ) unset($url_params['Confirm']); - } - break; - - case 'l_review_confirm': - $l_var_list_update["id"] = $objLinkList->CurrentItem; - $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t']; - break; - - case 'l_delete_confirm': - if( !$objSession->SessionEnabled() ) - { - $var_list_update['t'] = 'error_session'; - } - else - { - if( getArrayValue($attribs, '_accept_template') ) $url_params['DestYes'] = $attribs['_accepttemplate']; - if( getArrayValue($attribs, '_declinetemplate') ) $url_params['DestNo'] = $attribs['_declinetemplate']; - } - break; - } - - $ret = HREF_Wrapper('', $url_params); - unset($var_list_update['t']); - return $ret; -} - -/* - @description: returns a list of links - @attrib: _CatId:int: Override the current category - @attrib: _useroot:bool: If set, the current category is changed to In-Link's root category - @attrib: _ShortList:bool: If set, the Perpage_Links_Short setting is used instead of Perpage_links - @attrib: _Paging:bool: If set to 0 or false, paging will not be allowed for this list (only one paging list is allowed per item type per page load) - @attrib: _maxcount:int: If paging is not used on this list, this value determines how many items to load - @attrib: _ListType::Determines the type of list to generate
    - Possible values:
      -
    • Category: List links from the current category (default) -
    • Top: Most Popular & highest rated links -
    • Pop: Most Popular links -
    • New: List new links -
    • Hot: List links with the most click-throughs -
    • Pick: List editor's picks -
    • myitems: List topics created by the current user -
    • favorites: List topics marked as favorites by the current user -
    • search: List search results -
    - @attrib: _FirstItemTemplate:tpl: Template used for the first link listed - @attrib: _LastItemTemplate:tpl: Template used for the last link listed - @attrib: _EdItemTemplate:tpl: Editors Pick template used for link list items - @attrib: _ItemTemplate:tpl: default template used for link list items - @attrib: _notable:bool: if not 0, a table is used to contain the link list (any extra HTML attributes are used for the table tag) - @attrib: _Columns:int: the number of columns to use for table (defaults to 1) - @example: -*/ -function l_list_links($attribs = array()) -{ - global $objConfig, $objSession, $var_list, $l_var_list, $objLinkList, $objCatList, $content_set; - - if(strlen($attribs["_itemtemplate"])==0) - { - $content_set = 0; - return "ERROR -1"; - } - - $CatId = getArrayValue($attribs,'_catid'); - if (!is_numeric($CatId)) { - $CatId = $objCatList->CurrentCategoryID(); - } - - if ((int)getArrayValue($attribs,'_useroot')) { - $CatId = (int)$objConfig->Get("Link_Root"); - } - - $ListType = getArrayValue($attribs,'_listtype'); - - if (!$ListType) $ListType = 'category'; - - if ($ListType != "search") { - $evar = $evar = $_GET["env"]; //m_BuildEnv().$objSession->GetVariable("Env_Link"); - - $tagname = "l_list_links-".$ListType."-".(int)$attribs["_shortlist"]; - $CachedList = GetTagCache("inlink",$tagname,$attribs,$evar); - if($CachedList) return $CachedList; - } - - if ( ($attribs['_shortlist'] == 1) && $objConfig->Get('Perpage_Links_Short') ) { - $objLinkList->PerPageVar = 'Perpage_Links_Short'; - } - else { - $objLinkList->PerPageVar = 'Perpage_Links'; - } - - //echo "PerPage ".$objLinkList->PerPageVar."
    "; - //echo "ListType: ".$objLinkList->ListType." Passed: $ListType
    "; - if($objLinkList->ListType != $ListType) - { - LoadLinkList($attribs); - } - - $cols = (int)getArrayValue($attribs,'_columns'); - if (!$cols) $cols = 1; - - //echo "Items: ".$objLinkList->NumItems()."
    "; - - if ($objLinkList->NumItems() == 0) { - - $content_set = 0; - return language('lu_no_links'); - } - - $html_attribs = ExtraAttributes($attribs); - $o=""; - $notable = (getArrayValue($attribs,'_notable')!="0"); - - if(!$notable) - { - $max_links = $objConfig->Get($objLinkList->PerPageVar); - - $items_to_print = $objLinkList->NumItems()>$max_links ? $max_links : $objLinkList->NumItems(); - - if($cols==0) - $cols = 1; - $per_row = ceil($items_to_print/$cols); - $count = 0; - $row = 0; - $total = 1; - $o=""; - $o .= ""; - } - $o .= "\n
    "; - foreach($objLinkList->Items as $index => $link) - { - $parsed = 0; - $objLinkList->CurrentItem = $index; - if($count==$per_row) - { - $o .= ""; - $count=0; - } - if($row==0 && getArrayValue($attribs,'_firstitemtemplate') ) - { - $o .= $link->ParseTemplate($attribs['_firstitemtemplate']); - $parsed = 1; - } - if($row==$objLinkList->NumItems()-1 && !$parsed && getArrayValue($attribs,'_lastitemtemplate') ) - { - $o .= $link->ParseTemplate($attribs['_lastitemtemplate']); - $parsed = 1; - } - if(!$parsed) - { - if (getArrayValue($attribs, '_editemtemplate') && (int)$link->Get('EditorsPick')) - { - $o .= $link->ParseTemplate($attribs["_editemtemplate"]); - } - else - { - $o .= $link->ParseTemplate($attribs['_itemtemplate']); - } - } - $row++; - $count++; - $total++; - - if ($total>$max_links) break; - } - $objLinkList->SetCurrentItem(); - - if($count != $per_row) { - $o .= "
    \n"; - } - else - { - $keywords = $objSession->GetVariable("Search_Keywords"); - - $links_showed = 0; //nl - $max_links = $objConfig->Get($objLinkList->PerPageVar); //nl - //echo "MaxLinks: $max_links
    "; - foreach($objLinkList->Items as $index => $link) - { - //echo "
    "; print_r($link); echo "
    "; - $show = 1; - /* if ($keywords) { - if (strstr(strip_tags(strtolower($link->Data['Name'])), strtolower($keywords)) || strstr(strip_tags(strtolower($link->Data['Description'])), strtolower($keywords))) { - $show = 1; - } - } - else { - $show = 1; - }*/ - - if ($show == 1) { - - $parsed = 0; - $objLinkList->CurrentItem = $index; - if($row==0 && strlen($attribs["_firstitemtemplate"])) - { - $o .= $link->ParseTemplate($attribs["_firstitemtemplate"]); - $parsed = 1; - } - if($row==$objLinkList->NumItems()-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0) - { - $o .= $link->ParseTemplate($attribs["_lastitemtemplate"]); - $parsed = 1; - } - if(!$parsed) - { - if (getArrayValue($attribs, '_editemtemplate') && (int)$link->Get('EditorsPick')) - { - $o .= $link->ParseTemplate($attribs["_editemtemplate"]); - } - else - { - $o .= $link->ParseTemplate($attribs['_itemtemplate']); - } - } - - $links_showed++; // nl - if($links_showed == $max_links) break; //nl - } - } - $objLinkList->SetCurrentItem(); - } - $o.="\n"; - if(strlen($o)) - SaveTagCache("inlink",$tagname,$attribs,$evar,$o); - - global $l_var_list_update; - $l_var_list_update = array(); - return $o; -} - - -/* - @description: Used in conjuction with l_list_links. Returns the number if links in the list - @attrib: _CatId:int: Override the current category - @attrib: _useroot:bool: If set, the current category is changed to In-Link's root category - - @attrib: _ListType::Determines the type of list to generate
    - Possible values:
      -
    • Category: List links from the current category (default) -
    • Hot: Hot Links (Most Popular & highest rated links) -
    • Pop: Most Popular links -
    • New: List new links -
    • Hot: List links with the most click-throughs -
    • Pick: List editor's picks -
    • myitems: List topics created by the current user -
    • favorites: List topics marked as favorites by the current user -
    • search: List search results -
    - - @example: -*/ -function l_list_count($attribs = array()) -{ - global $objConfig, $objLinkList, $objCatList, $objSession; - - $CatId = getArrayValue($attribs,'_catid'); - if(!is_numeric($CatId)) - $CatId = $objCatList->CurrentCategoryID(); - - if((int)getArrayValue($attribs,'_useroot')) - $CatId = (int)$objConfig->Get("Link_Root"); - - $ListType = getArrayValue($attribs,'_listtype'); - if(!strlen($ListType)) - $ListType="category"; - - if ( ($attribs['_shortlist']) && $objConfig->Get('Perpage_Links_Short') ) { - $objLinkList->PerPageVar = 'Perpage_Links_Short'; - } - else { - $objLinkList->PerPageVar = 'Perpage_Links'; - } - - if(!getArrayValue($attribs,'_today')) - { - if($objLinkList->ListType != $ListType) - { - LoadLinkList($attribs); - } - $o = 0; - $keywords = $objSession->GetVariable("Search_Keywords"); - if ($keywords) { -// foreach ($objLinkList->Items as $cat) { - // if (strstr(strip_tags(strtolower($cat->Data['Name'])), strtolower($keywords)) || strstr(strip_tags(strtolower($cat->Data['Description'])), strtolower($keywords))) { - // $o++; - // } -// } -// echo "Counted: $o


    "; -// echo "Reasly: ".$objLinkList->QueryItemCount."


    "; -// } -// else { - $o = $objLinkList->QueryItemCount; - } - $o = $objLinkList->QueryItemCount; // only use when no highlighting issued - } - else - { - $o = $objLinkList->PerformItemCount($attribs); - } - - if ($o == '') { - $o = 0; - } - return $o; -} - - -/* - @description: Used in conjuction with l_list_links. This function generates the page navigation - for the list. If this tag is called before the list tag, this function will load - the links. For that reason, the _ListType attribute is required if the pagnav - tag preceeds the l_list_links tag in the template. Generally, it is good practice to - duplicate all attributes set for l_list_links. - @attrib: _PagesToList:int: Number of pages to list (default is 10) - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for links - @attrib: _label:lang: language tag to include in the output if there are pages to list. If there are no pages listed, this text will not be included (resulting in an empty output) - @attrib: _ListType::Determines the type of list to generate
    - Possible values:
      -
    • Category: List links from the current category (default) -
    • Hot: Hot Links (Most Popular & highest rated links) -
    • Pop: Most Popular links -
    • New: List new links -
    • Hot: List links with the most click-throughs -
    • Pick: List editor's picks -
    • myitems: List topics created by the current user -
    • favorites: List topics marked as favorites by the current user -
    • search: List search results -
    - -*/ -function l_link_pagenav($attribs = array()) -{ - global $objLinkList, $objCatList, $objSession, $objConfig; - - $DestTemplate = getArrayValue($attribs,'_template'); - $PagesToList = getArrayValue($attribs,'_pagestolist'); - $image = getArrayValue($attribs,'_PageIcon'); - if(!is_numeric($PagesToList)) - $PagesToList = 10; - - $CatId = getArrayValue($attribs,'_catid'); - if(!is_numeric($CatId)) - $CatId = $objCatList->CurrentCategoryID(); - - if ( ($attribs['_shortlist'] == 1) && $objConfig->Get('Perpage_Links_Short') ) { - $objLinkList->PerPageVar = 'Perpage_Links_Short'; - } - else { - $objLinkList->PerPageVar = 'Perpage_Links'; - } - - - $ListType = getArrayValue($attribs,'_listtype'); - if(!strlen($ListType)) - $ListType="category"; - - if($objLinkList->ListType != $ListType) { - LoadLinkList($attribs); - } - - $o = $objLinkList->GetPageLinkList($DestTemplate, '', 10, true, '', ExtraAttributes($attribs) ); - if (strlen($image)) { - $o_i = ' '; - } - else - { - $o_i=''; - } - if(strlen($o) && strlen($attribs["_label"])) - $o = $o_i.language($attribs["_label"]).' '.$o; - return $o; -} - -/* - @description: Used in conjuction with l_list_links. This function generates a navigation link which is - used to switch from a short list to a longer list. The page number is not changed. - If this tag is called before the list tag, this function will load the link list. - For that reason, the _ListType attribute is required if the pagnav - tag preceeds the l_list_links tag in the template. Generally, it is good practice to - duplicate all attributes set for l_list_links. - @attrib: _root:bool: If set, the current category is set to In-Link's root category - @attrib: _text:lang: language tag to include as text for the anchor tag - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for links - @attrib: _plaintext:: plain text to include as text for the anchor tag. The _text attribute takes presedence - if both are included. - @attrib: _image:: URL to an image to include inside the anchor tag. -*/ -function l_link_more($attribs = array()) -{ - global $objLinkList, $objConfig, $l_var_list_update, $objSession, $l_CachedList; - - $l_var_list_update['id'] = 0; - - $html_attribs = ExtraAttributes($attribs); - $DestTemplate = $attribs["_template"]; - - if ( ($attribs['_shortlist'] == 1) && $objConfig->Get('Perpage_Links_Short') ) { - $objLinkList->PerPageVar = 'Perpage_Links_Short'; - } - else { - $objLinkList->PerPageVar = 'Perpage_Links'; - } - - $ListType = $attribs["_listtype"]; - if(!strlen($ListType)) - $ListType="category"; - - if($ListType != "search") - { - $evar = $_GET["env"]; //m_BuildEnv().$objSession->GetVariable("Env_Link"); - $tagname = "l_list_links-".$ListType."-".(int)$attribs["_ShortList"]; - $CachedList = GetTagCache("inlink",$tagname,FALSE,$evar); - - if(strlen($CachedList)) - { - $moretag = "l_link_more-".$ListType."-".(int)$attribs["_ShortList"]; - $CachedPageNav = GetTagCache("inlink",$moretag,FALSE,$evar); - if(strlen($CachedPageNav)) - return $CachedPageNav; - } - } - if($objLinkList->ListType != $ListType) - LoadLinkList($attribs); - - if($objLinkList->QueryItemCount > $objConfig->Get($objLinkList->PerPageVar)) - { - if($attribs["_root"]) - { - $url = l_root_link($attribs); - } - else - { - $l_var_list_update["p"]=1; - $url = m_template_link($attribs); - unset($l_var_list_update["p"]); - } - $o = ""; - $text = $attribs["_text"]; - if(!strlen($text)) - { - $text = $attribs["_plaintext"]; - if(!strlen($text)) - { - } - $o .= $text.""; - } - else - $o .= language($text); - if(strlen($attribs["_image"])) - { - $o .= ""; - } - $o .= ""; - } - if(strlen($o) && strlen($CachedList)>0 && strlen($moretag)>0) - SaveTagCache("inlink",$moretag,FALSE,$evar,$o); - return $o; -} - -/* - @description: List items related to the current link - @attrib: _ItemId:int: the link to use (If not set, the current link is used) - @attrib: _ListItems:: List of item types to include (ie: _ListItems="Category,Topic") - @attrib: _*Template:none: For each item type lsted in _ListItems, an item type template must be included - (ie: _CategoryTemplate=".." _TopicTemplate="..") - @example: -*/ -function l_related_items($attribs) -{ - global $objItemTypes, $objLinkList, $objCatList, $content_set; - static $Related; - - global $LinkRelations; - - $id = getArrayValue($attribs,'_itemid'); - if(!is_numeric($id)) - { - $c =& $objLinkList->GetCurrentItem(); - } - else - $c =& $objLinkList->GetItem($id); - - $data_sent=0; - if(is_object($c)) - { - $ResourceId = $c->Get("ResourceId"); - $IncludeList = explode(",",trim(strtolower($attribs["_listitems"]))); - $o = ""; - - if(!is_object($LinkRelations)) - { - //echo "
    "; print_r($c); echo "
    "; - $LinkRelations = new clsMultiTypeList(); - LoadRelatedItems($Related, $LinkRelations,$c->Get("ResourceId")); - } - - if($LinkRelations->NumItems()>0) - { - for($inc=0;$incGetTypeByName($item_type); - if(is_object($objType)) - { - foreach($LinkRelations->Items as $item) - { - if(is_object($item)) - { - if(strtolower($objType->Get("ItemName")) == strtolower($item_type) && $item->type==$objType->Get("ItemType")) - { - if(strlen($item->BasePermissionName)) - { - $perm = $item->BasePermissionName.".VIEW"; - $haspem = $objSession->HasCatPermission($perm,$item->Get("CategoryId")); - } - else - $hasperm = 1; - - if($hasperm) - { - $data_sent =1; - $classname = $objType->Get("ClassName"); - if(strlen($classname)) - { - $l = new $classname; - $l->Data = $item->Data; - $o .= $l->ParseTemplate($t); - } - } - } - } - $item = NULL; - } - } - else - echo $item_type." not found
    \n"; - } - } - if($data_sent) - { - return $o; - } - else - { - $content_set=0; - return ""; - } - } - else - { - $content_set = 0; - return ""; - } - } - else - { - $content_set = 0; - return ""; - } -} - -/* - @description: Returns the number of items related to the current link - @attrib: _ItemId:int: the link to use (If not set, the current link is used) - @attrib: _ItemType:: Name of item to count (ie: _ItemType="Category") - @example: -*/ -function l_related_count($attribs) -{ - global $objItemTypes, $objLinkList, $content_set; - global $LinkRelations; - - $count = 0; - - $id = getArrayValue($attribs,'_itemid'); - if( !is_numeric($id) ) - { - $c =& $objLinkList->GetCurrentItem(); - } - else - { - $c =& $objLinkList->GetItem($id); - } - - if( is_object($c) ) - { - $ResourceId = $c->Get('ResourceId'); - if( !is_object($LinkRelations) ) - { - $LinkRelations = new clsMultiTypeList(); - LoadRelatedItems($Related, $LinkRelations,$c->Get('ResourceId')); - } - - if(strlen($attribs['_itemtype'])) - { - $objType = $objItemTypes->GetTypeByName($item_type); - $TargetType = is_object($objType) ? $objType->Get('ItemType') : ''; - } - - if( $LinkRelations->NumItems() > 0 ) - { - for($x=0;$x<$LinkRelations->NumItems();$x++) - { - $a = $LinkRelations->GetItemByIndex($x); - if($a->type == $TargetType || !strlen($TargetType)) $count++; - } - } - } - return $count; -} - -/* - @description: Returns a list of reviews for a link - @attrib: _LinkId:int: the link to use (If not set, the current link is used) - @attrib: _maxcount:int: Maximum number of reviews to list (defaults to all) - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for link reviews - @attrib: _ReviewTemplate:tpl: template used to display the reviews -*/ -function l_list_reviews($attribs = array()) -{ - global $objLinkList,$content_set, $l_var_list; - - $max = (int)$attribs["_maxcount"]; - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link =& $objLinkList->GetItem($LinkId); - } - else - $link =& $objLinkList->GetCurrentItem(); - - if(is_object($link)) - { - if($link->ReviewsLoaded()==0) - { - if($attribs["_shortlist"]) - { - $link->ReviewPerPageVar = "Perpage_LinkReviews_Short"; - } - else - { - $link->ReviewPerPageVar = "Perpage_LinkReviews"; - } - $ReviewList =& $link->GetItemReviews($l_var_list["rp"]); - } - else - $ReviewList =& $link->Reviews; - - $o = ""; - $t = $attribs["_reviewtemplate"]; - if($ReviewList->NumItems()>0 && strlen($t)) - { - foreach($ReviewList->Items as $r) - { - if($i >= $max && $max>0) - break; - - $o .= $r->ParseTemplate($t); - $i++; - } - } - } - if(!strlen($o)) - $content_set =0; - return $o; -} - -/* - @description: Used in conjuction with l_list_reviews. This function generates a navigation link which is - used to switch from a short list to a longer list. The page number is not changed. - If this tag is called before the list tag, this function will load the review list. - Any extra HTML attributes are passed to the anchor tag used to create the link. - @attrib: _LinkId:int: If set, the this value is used for a link ID (default to the current link) - @attrib: _root:bool: If set, the current category is set to In-Link's root category - @attrib: _text:lang: language tag to include as text for the anchor tag - @attrib: _Template:tpl: Destination template of More link - @attrib: _plaintext:: plain text to include as text for the anchor tag. The _text attribute takes presedence - if both are included. - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for link reviews - @attrib: _image:: URL to an image to include inside the anchor tag. -*/ -function l_review_more($attribs) -{ - global $objLinkList, $objConfig, $l_var_list_update, $l_var_list; - - $html_attribs = ExtraAttributes($attribs); - $DestTemplate = $attribs["_template"]; - - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link =& $objLinkList->GetItem($LinkId); - } - else - $link =& $objLinkList->GetCurrentItem(); - - if(is_object($link)) - { - if($link->ReviewsLoaded()==0) - { - if($attribs["_shortlist"]) - { - $link->ReviewPerPageVar = "Perpage_LinkReviews_Short"; - } - else - { - $link->ReviewPerPageVar = "Perpage_LinkReviews"; - } - $ReviewList =& $link->GetItemReviews($l_var_list["rp"]); - } - else - $ReviewList =& $link->Reviews; - - if($ReviewList->ItemCount() < $ReviewList->QueryItemCount) - { - if($attribs["_root"]) - { - $url = l_root_link($attribs); - } - else - { - $l_var_list_update['id'] = $l_var_list['id']; - $url = m_template_link($attribs); - } - $o = ""; - $text = $attribs["_text"]; - if(!strlen($text)) - { - $text = $attribs["_plaintext"]; - if(!strlen($text)) - { - } - $o .= $text.""; - } - else - $o .= language($text); - if(strlen($attribs["_image"])) - { - $o .= ""; - } - $o .= ""; - } - } - return $o; -} - -/* - @description: Used in conjuction with l_list_reviews. This function generates the page navigation - for the list of reviews. If this tag is called before the list tag, this function will load - the reviews. For that reason, the _ListType attribute is required if the pagnav - tag preceeds the l_list_reviews tag in the template. Generally, it is good practice to - duplicate all attributes set for l_list_reviews. - @attrib: _PagesToList:int: Number of pages to list (default is 10) - @attrib: _Template:tpl: destination template for page links (defaults to current template) - @attrib: _ShortList:bool: If set, uses the shortlist configuration value for link reviews - @attrib: _LinkId:int: If set, the this value is used for a link ID (default to the current link) - @attrib: _label:lang: language tag to include in the output if there are pages to list. If there are no pages - listed, this text will not be included (resulting in an empty output) -*/ -function l_review_pagenav($attribs) -{ - global $l_var_list, $l_var_list_update, $objLinkList; - - $DestTemplate = $attribs["_template"]; - $PagesToList = $attribs["_pagestolist"]; - if(!is_numeric($PagesToList)) - $PagesToList = 10; - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link =& $objLinkList->GetItem($LinkId); - } - else - $link =& $objLinkList->GetCurrentItem(); - - if(is_object($link)) - { - if($link->ReviewsLoaded()==0) - { - if($attribs["_shortlist"]) - { - $link->ReviewPerPageVar = "Perpage_LinkReviews_Short"; - } - else - { - $link->ReviewPerPageVar = "Perpage_LinkReviews"; - } - $ReviewList =& $link->GetItemReviews($l_var_list["rp"]); - } - else - $ReviewList =& $link->Reviews; - $o = $ReviewList->GetPageLinkList($l_var_list_update,$DestTemplate); - } - if(strlen($o) && strlen($attribs["_label"])) - $o = language($attribs["_label"]).$o; - return $o; -} - -/* - @description: Parse a link item template - @attrib: _ItemTemplate:tpl: Link template to parse - @attrib: _LinkId:int: Link ID to parse (uses current link if not set) -*/ -function l_link_detail($attribs = array()) -{ - global $objLinkList; - - $t = $attribs["_itemtemplate"]; - if(strlen($t)) - { - $LinkId = (int)$attribs["_linkid"]; - if($LinkId) - { - $link = $objLinkList->GetItem($LinkId); - } - else - $link = $objLinkList->GetCurrentItem(); - if(is_object($link)) - { - $o = $link->ParseTemplate($t); - } - } - return $o; -} - - /* - @description: Parse a link field and return the value - @attrib: _Field:: Link field to parse - @attrib: _LinkId:int: Link ID to parse (uses current link if not set) - */ - function l_link_field($attribs = array()) - { - global $objLinkList; - - $o = ""; - $field = $attribs["_field"]; - $LinkId = isset($attribs['_linkid']) ? (int)$attribs['_linkid'] : false; - if($LinkId) - { - $link = $objLinkList->GetItem($LinkId); - } - else - { - $link = $objLinkList->GetCurrentItem(); - } - - if(strlen($field)) - { - if(is_object($link)) - { - $element = new clsHtmlTag(); - $element->name = $link->TagPrefix; - $element->attributes = $attribs; - $o = $link->ParseObject($element); - } - else - $o = ""; - } - - if (substr($o, 0, 9) == "Undefined") { - $attrib = Array(); - $attrib['_template'] = "error_template"; - $attrib['_unsecure'] = 1; - $location = m_template_link($attrib); - Header("Location: $location"); - } - - return $o; - } - - function l_multiple_submit($params=Array()) - { - global $objCatList,$objConfig,$objModules; - $ret=''; - $root_cat_name=language($objConfig->Get('Root_Name')); - $selected_tpl=''.$root_cat_name.'>'."%2\$s".''; - if(getArrayValue($_POST,'cat_ids')) - { - foreach ($_POST['cat_ids'] as $cat_id) - { - $that_cat =& $objCatList->GetItem($cat_id); - $ret.=sprintf($selected_tpl,$cat_id,$that_cat->GetNavbar()); - } - } - - - $ret .= ''; - $suggest_cat_id=isset($_POST['suggest_cat_id'])?$_POST['suggest_cat_id']:$objCatList->CurrentCategoryID(); - $suggest_cat=$objCatList->GetItem($suggest_cat_id); - - $ret.=$root_cat_name.' > '.$suggest_cat->GetNavbar().'  - - - '; - - - - return $ret; - - } - - function l_home_cat() - { - global $objConfig; - return language($objConfig->Get('Root_Name')); - } - - function l_show_listings($params) - { - global $FormValues, $objConfig; - $html_attribs = ExtraAttributes($params); - $form = $params['_form']; - $field = strtolower($params['_field']); - - if (isset($_POST[$field])) { - $value = $_POST[$field]; - } - elseif ( getArrayValue($FormValues, $form, $field) ) { - $value = $FormValues[$form][$field]; - } - - $sql = 'SELECT Name, ListingTypeId FROM '.TABLE_PREFIX.'ListingTypes ORDER BY Name'; - - $application =& kApplication::Instance(); - $db =& $application->GetADODBConnection(); - $options = $db->GetCol($sql, 'ListingTypeId'); - - if ($objConfig->Get('Link_AllowFreeListings')) { - $options = array_merge_recursive2(Array('' => language('lu_free_listing') ), $options); - } - - if (!isset($value)) { - list($option_key, $option_title) = each($options); - $value = $option_key; - } - - $ret = ''; - $tag_params = Array('name' => $params['_render_as']); - foreach ($options as $option_key => $option_title) { - $tag_params['IsSelected'] = $option_key == $value; - $tag_params['ListingTypeId'] = $option_key; - $tag_params['ListingTypeName'] = $option_title; - $tag_params['IsFree'] = $option_key ? 0 : 1; - $tag_params['DetailsLink'] = $application->HREF($params['_moreinfotemplate'], '', Array('listing_type' => $option_key, 'pass' => 'm') ); - $ret .= $application->ParseBlock($tag_params); - } - return $ret; - } - -?> Index: branches/unlabeled/unlabeled-1.28.2/in-link/admin/install/langpacks/english.lang =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.28.2/in-link/admin/install/langpacks/english.lang (revision 12746) +++ branches/unlabeled/unlabeled-1.28.2/in-link/admin/install/langpacks/english.lang (revision 0) @@ -1,151 +0,0 @@ - - m/d/Yg:i:s Am/d/Yg:i:s A.,iso-8859-12 - - QWN0aW9ucyBVcG9uIEV4cGlyYXRpb24= - QWN0aW9ucyBVcG9uIFB1cmNoYXNl - RXhwaXJlcyBPbg== - TGluaw== - T3duZXI= - TGlzdGluZyBUeXBl - TW9kaWZpZWQ= - UGVuZGluZyBSZW5ld2Fs - RW5hYmxlZCBPbg== - RGVjcmVhc2UgQnk= - VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgZHVwbGljYXRlIGxpbmtz - VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgcGFpZCBsaXN0aW5ncw== - VGhpcyBzZWN0aW9uIGFsbG93cyB0byBtYW5hZ2UgcGFpZCBsaXN0aW5ncw== - RG9uJ3QgQ2hhbmdl - TGluayBlbmhhbmNlbWVudCBzdWJtaXR0ZWQ= - TGluayBlbmhhbmNlbWVudCBhcHByb3ZlZA== - TGluayBlbmhhbmNlbWVudCBkZW5pZWQ= - TGluayBlbmhhbmNlbWVudCBleHBpcmVk - TGluayBlbmhhbmNlbWVudCByZW5ld2FsIHN1Ym1pdHRlZA== - TGluayBlbmhhbmNlbWVudCBleHRlbmRlZA== - TGluayBlbmhhbmNlbWVudCBpcyBhYm91dCB0byBleHBpcmU= - TGluayBlbmhhbmNlbWVudCBjYW5jZWxsZWQ= - TGluayBlbmhhbmNlbWVudCByZW5ld2FsIGZhaWxlZA== - TGluayBJdGVtIFRlbXBsYXRl - RW5hYmxlIFB1cmNoYXNpbmc= - RXhwaXJhdGlvbiBEYXRl - TGluayBPd25lcg== - TWF4aW11bSBudW1iZXIgb2YgSE9UIGxpbmtz - TWluaW11bSByYXRpbmcgdG8gY29uc2lkZXIgbGluayBQT1A= - TWluaW11bSBudW1iZXIgb2Ygdm90ZXMgdG8gY29uc2lkZXIgbGluayBQT1A= - SUQ= - TGlzdGluZyBUeXBl - RGVzY3JpcHRpb24= - SUQ= - TmFtZQ== - UGVuZGluZyBSZW5ld2Fs - UHVyY2hhc2UgRGF0ZQ== - UmVjdXJyaW5n - UmVuZXdhbCBSZW1pbmRlcg== - UHJvZHVjdCBOYW1l - VXNlcm5hbWU= - SW4tbGluaw== - SW5jcmVhc2UgQnk= - SzQgTGlua3M= - QWxsb3cgRnJlZSBMaXN0aW5ncw== - RW5oYW5jZWQgTGlzdGluZ3M= - R3JvdXBpbmcgQnk= - TXVsdGlwbGUgbGlua3MgZnJvbSBvbmUgZ3JvdXAgY291bGQgbm90IGJlIHNlbGVjdGVkIGF0IG9uY2UuIFBsZWFzZSBzZWxlY3Qgb25seSBvbmUgbGluayBmcm9tIGdyb3VwLg== - Tm8gQ2F0ZWdvcmllcw== - Tm8= - UGVuZGluZyBSZW5ld2Fs - TGluaw== - T3JpZ2luYWwgVmFsdWVz - U2V0IEVxdWFsIFRv - RHVwbGljYXRlIENoZWNrZXI= - TGlzdGluZ3M= - TGlzdGluZyBUeXBlcw== - UGFpZCBMaXN0aW5ncw== - U2hvcHBpbmcgQ2FydCBFbnRyeQ== - SzQgTGlua3M= - UGFpZCBMaXN0aW5n - TGlzdGluZyBUeXBl - U2hvcHBpbmcgQ2FydCBJdGVt - QWRkaW5nIExpbms= - QWRkaW5nIExpc3Rpbmc= - QWRkaW5nIExpc3RpbmcgVHlwZQ== - RHVwbGljYXRlIExpbmtz - RWRpdGluZyBMaW5r - RWRpdGluZyBMaXN0aW5n - RWRpdGluZyBMaXN0aW5nIFR5cGU= - SW1wb3J0IExpbmtz - TGlua3M= - TGlua3MgRHVwbGljYXRlIENoZWNrZXI= - TGlua3MgRXhwb3J0 - TGlzdGluZyBUeXBlcw== - TmV3IExpbms= - TmV3IExpc3Rpbmc= - TmV3IExpc3RpbmcgVHlwZQ== - UGFpZCBMaXN0aW5ncw== - TGlzdGluZyBUeXBlcw== - U2hvcHBpbmcgQ2FydCBFbnRyeQ== - TWVyZ2U= - TmV3IEZpbGU= - TmV3IExpc3Rpbmc= - TmV3IExpc3RpbmcgVHlwZQ== - VXNlIGdyaWQgdG8gQXBwcm92ZSAvIERlY2xpbmU= - WW91IGFyZSBhYm91dCB0byBjYW5jZWwgeW91ciBsaW5rIGVuaGFuY2VtZW50Lg== - WW91IGFyZSBhYm91dCB0byBleHRlbmQgeW91ciBsaW5rIGVuaGFuY2VtZW50Lg== - Q2FuY2VsIExpbmsgRW5oYW5jZW1lbnQ= - QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGNhbmNlbCB5b3VyIGVuaGFuY2VkIGxpbms/IFRoZSBsaXN0aW5nIHR5cGUgd2lsbCBiZSByZXNldCB0byByZWd1bGFyLg== - Q2hvb3NlIExpc3RpbmcgVHlwZQ== - Q29uZmlybSBFbmhhbmNlbWVudCBDYW5jZWw= - Q29uZmlybSBFbmhhbmNlbWVudCBFeHRlbmQ= - RW5oYW5jZQ== - RW5oYW5jZSBMaW5r - VGhhbmsgeW91IGZvciBlbmhhbmNpbmcgeW91ciBsaW5rLiBZb3UgbGluayBlbmhhbmNlbWVudCBpcyBub3cgcGVuZGluZyBhZG1pbmlzdHJhdG9yIGFwcHJvdmFsLiBZb3Ugd2lsbCBiZSBub3RpZmllZCBieSBlbWFpbCB3aGVuIHlvdXIgbGluayBlbmhhbmNlbWVudCBpcyBhcHByb3ZlZC4= - RW5oYW5jZW1lbnQgc2V0IHRvIHJlbmV3IGF1dG9tYXRpY2FsbHkgb24= - RXh0ZW5kL0NhbmNlbCBFbmhhbmNlbWVudA== - RXh0ZW5kIExpbmsgRW5oYW5jZW1lbnQ= - QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGV4dGVuZCB5b3VyIGxpbmsgZW5oYW5jZW1lbnQ/ - Tm8gZGVzY3JpcHRpb24gZW50ZXJlZCE= - Tm8gbmFtZSBlbnRlcmVkIQ== - Tm8gVVJMIGVudGVyZWQh - RnJlZSBMaXN0aW5n - TGluayBFbmhhbmNlbWVudCBSZXN1bHRz - RXhwaXJhdGlvbiBEYXRl - TGlzdGluZyBUeXBl - TGlzdGluZyBUeXBl - QWZ0ZXIgc2VsZWN0aW5nIGxpc3RpbmcgdHlwZSBpdCB3aWxsIGJlIGFkZGVkIHRvIHlvdXIgc2hvcHBpbmcgY2FydC4gT25jZSB5b3UgY29tcGxldGUgY2hlY2tvdXQgYW5kIHlvdXIgb3JkZXIgaXMgYXBwcm92ZWQgeW91ciBsaW5rIHN0YXR1cyB3aWxsIGJlIHVwZ3JhZGVkLiBZb3Ugd2lsbCBiZSBub3RpZmllZCBieSBlbWFpbCB3aGVuIHRoaXMgaXMgZG9uZS4= - cGVuZGluZw== - TGlzdGluZyBUeXBl - dG8gY2FuY2VsIGxpbmsgZW5oYW5jZW1lbnQ= - - - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgYWRkZWQKCllvdXIgbGluayBoYXMgYmVlbiBhZGRlZC4NCjE= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBhZGRlZAoKQSBsaW5rIGhhcyBiZWVuIGFkZGVk - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBhcHByb3ZlZAoKWW91ciBsaW5rIGhhcyBiZWVuIGFwcHJvdmVk - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBkZW5pZWQKCllvdXIgbGluayBoYXMgYmVlbiBkZW5pZWQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQKCkRlYXIgPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJGaXJzdE5hbWUiIC8+IDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iTGFzdE5hbWUiIC8+LA0KDQpUaGFuayB5b3UgZm9yIHN1Ym1pdHRpbmcgbGluayBlbmhhbmNlbWVudCByZXF1ZXN0LiBZb3Ugd2lsbCBiZSBub3RpZmllZCB3aGVuIHlvdXIgbGluayBlbmhhbmNlbWVudCBpcyBwcm9jZXNzZWQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgRW5oYW5jZW1lbnQgc3VibWl0dGVkCgpBIHVzZXIgaGFzIHN1Ym1pdHRlZCBhIGxpbmsgZW5oYW5jZW1lbnQgcmVxdWVzdC4gUGxlYXNlIHByb2NlZWQgdG8gYWRtaW5pc3RyYXRpdmUgY29uc29sZSB0byByZXZpZXcgaXQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgYXBwcm92ZWQKCkRlYXIgPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJGaXJzdE5hbWUiIC8+IDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iTGFzdE5hbWUiIC8+LA0KDQpZb3VyIHJlY2VudCBsaW5rIGVuaGFuY2VtZW50IHJlcXVlc3QgaGFzIGJlZW4gYXBwcm92ZWQuIFRoYW5rIHlvdSENCg== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgYXBwcm92ZWQKCkxpbmsgZW5oYW5jZW1lbnQgaGFzIGJlZW4gYXBwcm92ZWQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgY2FuY2VsbGVkCgpEZWFyIDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iRmlyc3ROYW1lIiAvPiA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9Ikxhc3ROYW1lIiAvPiwNCg0KWW91ciBsaW5rIGVuaGFuY2VtZW50IG9uIDxpbnAyOmNvbmZfQ29uZmlnVmFsdWUgbmFtZT0iU2l0ZV9OYW1lIi8+IGhhcyBiZWVuIGNhbmNlbGxlZC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgY2FuY2VsbGVkCgpMaW5rIGVuaGFuY2VtZW50IGhhcyBiZWVuIGNhbmNlbGxlZC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZGVuaWVkCgpEZWFyIDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iRmlyc3ROYW1lIiAvPiA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9Ikxhc3ROYW1lIiAvPiwNCg0KU29ycnksIGJ1dCB5b3VyIHJlY2VudCBsaW5rIGVuaGFuY2VtZW50IHJlcXVlc3QgaGFzIGJlZW4gZGVuaWVkLg== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZGVuaWVkCgpMaW5rIGVuaGFuY2VtZW50IGhhcyBiZWVuIGRlbmllZC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZXhwaXJlZAoKRGVhciA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9IkZpcnN0TmFtZSIgLz4gPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJMYXN0TmFtZSIgLz4sDQoNCllvdXIgZW5oYW5jZWQgbGluayBhdCA8aW5wMjpjb25mX0NvbmZpZ1ZhbHVlIG5hbWU9IlNpdGVfTmFtZSIvPiBoYXMgZXhwaXJlZC4gSWYgeW91IHdhbnQgdG8gcmVuZXcgeW91ciBlbmhhbmNlZCBsaW5rLCBwbGVhc2UgcmUtc3VibWl0IGxpbmsgZW5oYW5jZW1lbnQgcmVxdWVzdC4gVGhhbmsgeW91IQ== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZXhwaXJlZAoKRW5oYW5jZWQgbGluayBoYXMgZXhwaXJlZC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgcmVuZXdhbAoKRGVhciA8aW5wMjp1Li1pdGVtX0ZpZWxkIG5hbWU9IkZpcnN0TmFtZSIgLz4gPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJMYXN0TmFtZSIgLz4sDQoNClRoYW5rIHlvdSBmb3Igc3VibWl0dGluZyBsaW5rIGVuaGFuY2VtZW50IHJlbmV3YWwgcmVxdWVzdC4gWW91IHdpbGwgYmUgbm90aWZpZWQgd2hlbiB5b3UgcmVxdWVzdCBpcyBwcm9jZXNzZWQu - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgcmVuZXdhbCBzdWJtaXRlZAoKTGluayBlbmhhbmNlbWVudCByZW5ld2FsIHJlcXVlc3QgaGFzIGJlZW4gc3VibWl0dGVkLCBwbGVhc2UgcHJvY2VlZCB0byBhZG1pbmlzdHJhdGl2ZSBjb25zb2xlIHRvIHJldmlldyBpdC4= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZXh0ZW5kZWQKCkRlYXIgPGlucDI6dS4taXRlbV9GaWVsZCBuYW1lPSJGaXJzdE5hbWUiIC8+IDxpbnAyOnUuLWl0ZW1fRmllbGQgbmFtZT0iTGFzdE5hbWUiIC8+LA0KDQpZb3UgbGluayBlbmhhbmNlbWVudCBvbiA8aW5wMjpjb25mX0NvbmZpZ1ZhbHVlIG5hbWU9IlNpdGVfTmFtZSIvPiBoYXMgYmVlbiBleHRlbmRlZC4gVGhhbmsgeW91IQ== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgZXh0ZW5kZWQKCkxpbmsgZW5oYW5jZW1lbnQgaGFzIGJlZW4gZXh0ZW5kZWQ= - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IEVuaGFuY2UgTGluayBSZW5ld2FsIEZhaWxlZAoKRW5oYW5jZSBMaW5rIFJlbmV3YWwgRmFpbGVk - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IEVuaGFuY2UgTGluayBSZW5ld2FsIEZhaWxlZAoKRW5oYW5jZSBMaW5rIFJlbmV3YWwgRmFpbGVk - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgcmVuZXdhbCBub3RpY2UKCkRlYXIgPGlucDI6dV9GaWVsZCBuYW1lPSJGaXJzdE5hbWUiIC8+IDxpbnAyOnVfRmllbGQgbmFtZT0iTGFzdE5hbWUiIC8+LA0KDQpZb3VyIGxpbmsgZW5oYW5jZW1lbnQgb24gPGlucDI6Y29uZl9Db25maWdWYWx1ZSBuYW1lPSJTaXRlX05hbWUiLz4gaXMgYWJvdXQgdG8gZXhwaXJlLiBQbGVhc2UgbG9naW4gdG8geW91ciBhY2NvdW50IHRvIHJlbmV3IHlvdXIgbGluayBlbmhhbmNlbWVudC4gVGhhbmsgeW91IQ== - WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IExpbmsgZW5oYW5jZW1lbnQgYWJvdXQgdG8gZXhwaXJlCgpMaW5rIGVuaGFuY2VtZW50IGlzIGFib3V0IHRvIGV4cGlyZS4= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBtb2RpZmVkCgpZb3VyIGxpbmsgaGFzIGJlZW4gbW9kaWZpZWQ= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBtb2RpZmllZAoKQSBsaW5rIGhhcyBiZWVuIG1vZGlmaWVkLg== - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBhcHByb3ZlZAoKWW91ciBsaW5rIG1vZGlmaWNhdGlvbiBoYXMgYmVlbiBhcHByb3ZlZA== - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayBtb2RpZmljYXRpb24gZGVuaWVkCgpZb3VyIGxpbmsgbW9kaWZpY2F0aW9uIGhhcyBiZWVuIGRlbmllZC4= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYWRkZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gYWRkZWQ= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYWRkZWQKCkEgbGluayByZXZpZXcgaGFzIGJlZW4gYWRkZWQ= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYWRkZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gYWRkZWQgYW5kIGlzIHBlbmRpbmcgYXBwcm92YWwu - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgYXBwcm92ZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gYXBwcm92ZWQ= - WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTGluayByZXZpZXcgZGVjbGluZWQKCllvdXIgbGluayByZXZpZXcgaGFzIGJlZW4gZGVjbGluZWQ= - - - \ No newline at end of file Index: branches/unlabeled/unlabeled-1.28.2/in-link/admin/import/inlink_import.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.28.2/in-link/admin/import/inlink_import.php (revision 12746) +++ branches/unlabeled/unlabeled-1.28.2/in-link/admin/import/inlink_import.php (revision 0) @@ -1,914 +0,0 @@ -GetVariable('import_category_id'); - -if ( isset($_POST['Action']) && $_POST['Action'] == 'Import') -{ - $objSession->SetVariable('import_user_admin',$_POST['user_admin']); - $objSession->SetVariable('import_user_regular',$_POST['user_regular']); - $objSession->SetVariable('image_name',$_POST['link_image']); - - $objSession->SetVariable('importtodo','initialize'); - $objSession->SetVariable('importstart',0); - $objSession->SetVariable('importtotal',0); - - if((int)$_POST['init_cat'] > 0) - { - $c = $objCatList->GetItemByField('CategoryId', $root_cat_id); - $c->UpdateACL(); - $c->UpdateCachedPath(); - } - - -} -$allgroups = $objGroups->GetAllGroupList(); - -// connection related -$inlink_sql_type = $objSession->GetVariable('import_sql_type'); -$inlink_server = $objSession->GetVariable('import_server'); -$inlink_db = $objSession->GetVariable('import_db'); -$inlink_user = $objSession->GetVariable('import_user'); -$inlink_pass = $objSession->GetVariable('import_pass'); - -// import related -$user_admin = $objSession->GetVariable('user_admin_values'); -$user_regular = $objSession->GetVariable('user_regular_values'); - -if( !isset($c) || !is_object($c) && $root_cat_id ) -$c = $objCatList->GetItemByField('CategoryId', $root_cat_id); - -$image_name=$objSession->GetVariable('image_name'); -$start = $objSession->GetVariable('importstart'); - -$init_cat = $root_cat_id ? $c->Get('CategoryId') : 0; - -//In-Portal -$portalconn = &GetADODBConnection(); - -if( $init_cat == 0) -{ - /*$prefix = GetTablePrefix(); - $sql = 'SELECT ACL - FROM '.$prefix.'PermCache pc, '.$prefix.'Permissions p - WHERE p.PermissionId = pc.PermId AND p.CategoryId = 0 AND p.Permission = \'CATEGORY.VIEW\''; - $acl = $portalconn->GetCol($sql);*/ - $acl = Array(0 => 0); -} -else -{ - $acl = explode(',',$c->GetACL('CATEGORY.VIEW')); -} - -//IN-LINK connection -$linkconn = &ADONewConnection($inlink_sql_type); -$linkconn->NConnect($inlink_server, $inlink_user, $inlink_pass, $inlink_db); - -if(!$linkconn) -{ echo "Database connection failed. DB Type: $sql_type, DB Server: $inlink_server, DB User: $inlink_user, DB Name: $inlink_db"; //fatal; -echo $linkconn->ErrorMsg(); -die(); -} - -//admin only util -$pathtolocal = $pathtoroot.'kernel/'; -require_once ($pathtoroot.'admin/include/elements.php'); -require_once ($pathtoroot.'kernel/admin/include/navmenu.php'); -require_once ($pathtolocal.'admin/include/navmenu.php'); -require_once($pathtoroot.'admin/toolbar.php'); -//Set Section -$section = 'in-portal:inlink_inport'; -//Set Environment Variable -$envar = 'env=' . BuildEnv(); - -$sec = $objSections->GetSection($section); -$objCatToolBar = new clsToolBar(); - -$title = admin_language('la_performing_import').' - '.admin_language('la_Step').' 4'; - - - -$TablePrefix = 'ses_'.$objSession->GetSessionKey().'_'.GetTablePrefix(); - -$olddbname=$inlink_db; -//$newdbname='inportal'; -$newdbname=$g_DBName; -##############creating a temproary table have to be here - -if( GetVar('Action', true) == 'Import' ) -{ - $portalconn->Execute('DROP TABLE IF EXISTS '.$TablePrefix.'import'); - $portalconn->Execute('DROP TABLE IF EXISTS '.$TablePrefix.'importcat'); - $temptable = 'CREATE TABLE '.$TablePrefix.'import (otname varchar(40), oid int(11), ocustomid int(11), oparentid int(11), ntname varchar(40), nid int(11), nrid int(11), npid int(11)) '; - - $portalconn->Execute($temptable); - $cattable ='CREATE TABLE '.$TablePrefix.'importcat (op int(11), np int(11), flag int(11)) '; - $portalconn->Execute($cattable); - $newcat = 1; -} - -global $admin, $pathtoroot; - -require_once ($pathtoroot.'in-link/'.$admin.'/import/status.php'); #for status bar and all visual effects - -$todo= $objSession->GetVariable('importtodo'); - -$total = $objSession->GetVariable('importtotal'); -switch ($todo) -{ - case 'users': - status($start, $total, 'users'); - usersimport(); - //setstart(0,'cats'); #for debugging - break; - case 'cats': - status($start, $total, 'cats'); - catmanager(); - //setstart(0,'links'); #for debugging - break; - case 'links': - status($start, $total, 'links'); - linksimport(); - //setstart(0,'custom');#For debugging only - break; - case 'custom': - status($start, $total, 'custom'); - - customimport(); - //setstart(0,'relcat');#for debuggin only - break; - - case 'relcat': - status($start, $total, 'relcat'); - relcatimport(); - //setstart(0,'terminate'); #for debuggin only - break; - case 'terminate': - terminator(); - status(1,1,'terminate'); - break; - default: - status(0,0,'initializing'); - setstart(0,'users'); #to start importing from users first - break; -} - -function terminator() -{ - global $portalconn, $TablePrefix, $adminURL, $objSession; - $query='DROP TABLE IF EXISTS '.$TablePrefix.'import, '.$TablePrefix.'importcat'; - $portalconn->Execute($query); - - $objSession->SetVariable('PermCache_UpdateRequired', 1); - $objSession->SetVariable('ReturnScript', 'browse.php'); // redirect to catalog when finished - m_ParseEnv(); // sets default values to "m" prefix, because it is not passed through import anymore - echo ''; -} - -function reload() -{ - //global $newurl; - print ''; -} -function setstart($mystart, $part) -{ - global $objSession; - - $objSession->SetVariable('importstart',$mystart); - $objSession->SetVariable('importtodo',$part); - reload(); -} -function settotal($total) -{ - global $objSession; - $objSession->SetVariable('importtotal',$total); -} - -//users import from inlink to inportal -function usersimport() -{ - global $objUsers, $objSession, $linkconn, $portalconn, $olddbname, - $user_admin,$objGroups, $user_regular, $start, $TablePrefix; - - $counter = 0; - $limit = 350; - $oldtablename = 'inl_users'; - $newtablename = $objUsers->SourceTable; - if ($start == 0) - { - $query='select count(*) as NumUsers from inl_users'; - $row =$linkconn->Execute($query); - if ($row && !$row->EOF) - { - settotal($row->fields['NumUsers']); - - } - } - $query="select * from inl_users LIMIT $start, $limit"; - $row =$linkconn->Execute($query); - while($row && !$row->EOF) - { - $counter++; #needed to know when close to time out - - if ($row->fields['user_name'] != 'root') { - $olduserid=$row->fields['user_id']; - //$Login, $Password, $Email, $CreatedOn, $FirstName='', $LastName='', $Status=2, - // $Phone='', $Street='', $City='', $State='', $Zip='', $Country='' - - if($row->fields['user_status']==1) - { - $Status=1; - } - else - { - if($row->fields['user_pend']==0) - { - $Status=2; - } - else - $Status=0; - } - $u = $objUsers->Add_User( $row->fields['user_name'], $row->fields['user_pass'], $row->fields['email'], - $row->fields['user_date'], $row->fields['first'], $row->fields['last'], - $Status); - $oldid=$row->fields['user_id']; - $oldcustom = $row->fields['user_cust']; - $newid = $u->Get('PortalUserId'); - $resid = $u->Get('ResourceId'); - #adding user to usergroup - - $userpermission = $row->fields['user_perm']; - if ($userpermission==2 || $userpermission==1) - { - $glist = explode(',',$user_admin); - $Primary=1; - for($i=0;$iGetItem($glist[$i]); - $group->AddUser($newid,$Primary,false); - $Primary = 0; - } - } - else - { - $glist = explode(',',$user_regular); - $Primary=1; - for($i=0;$iGetItem($glist[$i]); - $group->AddUser($newid,$Primary,false); - $Primary = 0; - } - } - //$group=$objGroups->GetItem($g); - //$group->AddUser($newid,1); - - #inserting values to the temproary table - $totemp = 'INSERT INTO '.$TablePrefix.'import (otname,oid,ocustomid,oparentid,ntname,nid,nrid,npid) '; - $tovalues= " VALUES ('$oldtablename',$olduserid,$oldcustom,0,'$newtablename', $newid, $resid, 0 )"; - $totemp=$totemp.$tovalues; - $portalconn->Execute($totemp); - } - $row->moveNext(); - } - if ($counter == $limit) - { - setstart($start+$limit, 'users'); - } - else - setstart(0,'cats'); - -} -//END OF USERS IMPORT ^^^^^^^^^^^^^^^^^^^^^ - -//Categories Import -function catmanager() -{ - global $portalconn, $init_cat,$start,$TablePrefix; - if ($start == 0) - { - $counter = catimport(0,$init_cat); - setstart($counter,'cats'); - $portalconn->Execute('UPDATE '.$TablePrefix.'importcat SET flag = 1 WHERE np = '.$init_cat); - } - else - { - - $query='select * from '.$TablePrefix.'importcat WHERE flag=0 LIMIT 0,1'; - $row =$portalconn->Execute($query); - if($row && !$row->EOF) - { - $oldid= $row->fields['op']; - $newid = $row->fields['np']; - $counter= catimport($oldid,$newid); - $query2='UPDATE '.$TablePrefix.'importcat SET flag = 1 WHERE op = '.$oldid.' AND np = '.$newid; - $portalconn->Execute($query2); - setstart($counter+$start-1,'cats'); - //$x=5; - } - else - { - setstart(0,'links'); - } - } -} -#pushes into the quque -function pushid($op,$np) -{ - global $linkconn, $portalconn, $TablePrefix; - $addnew = 'INSERT INTO '.$TablePrefix.'importcat (op,np,flag) VALUES ('.$op.','.$np.',0)'; - $portalconn->Execute($addnew); - -} -function checkifexist($id) -{ - global $linkconn; - $addnew = 'select * from inl_cats where cat_sub = '.$id; - $row =$linkconn->Execute($addnew); - if ($row && !$row->EOF) - { - - if ($row->fields['cat_id'] !=0) - { - return true; - } - else - { - return false; - } - } - else - { - return false; - } -} -#import itself -function catimport($oldparentid, $parentid) -{ - global $objCatList, $linkconn, $objUsers, $linkconn, $portalconn, - $olddbname, $user_admin,$objGroups, $user_regular, $acl,$allgroups, - $c, $start, $TablePrefix, $init_cat; - $counter=0; - - $objCacheCount = new clsCacheCountList(); - if ($start == 0) - { - $query='select count(*) as CatCount from inl_cats'; - $row =$linkconn->Execute($query); - if ($row && !$row->EOF) - { - settotal($row->fields['CatCount']); - $catcount = $row->fields['CatCount']; - - if( is_object($c) ) - { - $catcount += (int)$c->Get('CachedDescendantCatsQty'); - $c->Set('CachedDescendantCatsQty',$catcount); - $c->Update(); - } - - - } - } - - $query='select * from inl_cats WHERE cat_sub = '.$oldparentid; - $oldtablename = 'inl_cats'; - $newtablename = 'Category'; - $row =$linkconn->Execute($query); - if($row && !$row->EOF) - { - $RowCount = $row->NumRows(); - $ResInc = $RowCount; - $ResourceId = GetNextResourceId($ResInc); - } - if($parentid>0) - { - $ParentCat = new clsCategory($parentid); - $Path = $ParentCat->Get('ParentPath'); - } - else - { - global $objConfig; - $Path = prompt_language( $objConfig->Get('Root_Name') ); - } - while($row && !$row->EOF) - { - $counter++; - - if($row->fields['cat_pend'] == 1) - { - $Status = 2; - } - else - { - $Status = ($row->fields['cat_vis'] == 1) ? 1 : 0; - } - - $CreatedById = GetNewID( 'users', $row->fields['cat_id'] ); - - $fields_hash = Array( 'ParentId' => $parentid, - 'Name' => $row->fields['cat_name'], - 'Description' => $row->fields['cat_desc'], - 'CreatedOn' => $row->fields['cat_date'], - 'EditorsPick' => (int)$row->fields['cat_pick'], - 'Status' => $Status, - 'HotItem' => 2, - 'NewItem' => 2, - 'PopItem' => 2, - 'Priority' => 0, - 'MetaKeywords' => $row->fields['meta_keywords'], - 'MetaDescription' => $row->fields['meta_desc'], - 'AutomaticFilename' => 1, - 'Filename' => '', - 'CategoryTemplate' => '', - 'ItemTemplate' => '', - 'CreatedById' => (int)$CreatedById, - 'CachedDescendantCatsQty' => (int)$row->fields['cat_cats'], - 'ResourceId' => $ResourceId, - ); - - $cat =& $objCatList->Add_NEW($fields_hash, true); - $ResourceId++; - - $FullPath = $Path.$cat->Get('CategoryId').'|'; - $cat->Set('ParentPath',$FullPath); - $cat->SetViewPerms('CATEGORY.VIEW',$acl,$allgroups); - $cat->SetViewPerms('LINK.VIEW',$acl,$allgroups); - $cat->Update(); - $cat->UpdateCachedPath(); - - $objCacheCount->CategoryId= $cat->Get('CategoryId'); - $objCacheCount->SetValue(0,0,0,0,0); - - $newid = $cat->Get('CategoryId'); - $resid = $cat->Get('ResourceId'); - $oldid = $row->fields['cat_id']; - $oldcustom = $row->fields['cat_cust']; - $oldpid = $row->fields['cat_sub']; - - #inserting values to the temproary table - $totemp = 'INSERT INTO '.$TablePrefix.'import (otname,oid,ocustomid,oparentid,ntname,nid,nrid,npid) '; - $tovalues= " VALUES ('$oldtablename',$oldid,$oldcustom,$oldpid,'$newtablename', $newid, $resid, $parentid )"; - $totemp=$totemp.$tovalues; - $portalconn->Execute($totemp); - - #pushes into the queue - if(checkifexist($oldid)) - { - pushid($oldid,$newid); - } - $row->moveNext(); - } - // disable lost+found category (if found one) - $tmp_cat = $objCatList->GetItemByField('Name','Lost+Found'); - if( is_object($tmp_cat) ) - { - $tmp_cat->Set('Status',0); - $tmp_cat->Update(); - } - return $counter; -} - -//Links Import -function linksimport() -{ - global $objLinkList, $init_cat, $linkconn, $portalconn, $olddbname, - $user_admin,$objGroups, $user_regular, $start, $TablePrefix; - $limit = 200; #need to change to a higher number like 100, forty is only for debugging - $counter = 0; - set_time_limit(0); - if ($start == 0) - { - $query = 'select count(*) as LinkCount from inl_lc'; - $row =$linkconn->Execute($query); - if ($row && !$row->EOF) - { - settotal($row->fields['LinkCount']); - - } - } - - // create index - what links are in what categories - $LimitClause = ' LIMIT '.$start.','.$limit; - $sql = 'SELECT link_id FROM inl_links ORDER BY link_id'.$LimitClause; - $LinkIDs = $linkconn->GetCol($sql); - - if( count($LinkIDs) > 0 ) - { - $LinkCatIndex = Array(); - $PendingLinks = Array(); - $sql = "SELECT * FROM inl_lc WHERE link_id IN (%s)"; - - $rs = $linkconn->Execute( sprintf($sql, implode(',', $LinkIDs) ) ); - while(!$rs->EOF) - { - $rec =& $rs->fields; - if( !isset($PendingLinks[ $rec['link_id'] ]) && $rec['link_pend'] == 1 ) - $PendingLinks[ $rec['link_id'] ] = 1; - - $LinkCatIndex[ $rec['link_id'] ][] = $rec['cat_id']; - $rs->MoveNext(); - } - } - - // get links - $query = 'SELECT * FROM inl_links ORDER BY link_id'.$LimitClause; // get links info - $row = $linkconn->Execute($query); // row is recordset here, not easy to figure out by variable name :( - if($row && !$row->EOF) - { - $RowCount = $row->NumRows(); - $ResInc = $RowCount; - $ResourceId = GetNextResourceId($ResInc); - } - - $get_cat_sql = "SELECT nid FROM %simport WHERE ntname = 'Category' AND oid = %s"; - - while($row && !$row->EOF) - { - $counter++; - $oldid = $row->fields['link_id']; - $flag = 1; - - $Pending = isset($PendingLinks[$oldid]); - - // create new link - - #gets the new user id of the user who created a link - if( !$row->fields['link_user'] ) - $newuserid = -1; - else - $newuserid = GetNewID('users', $row->fields['link_user'] ); - - #adds link to the IN-PORTAL - $link = new clsLink(); - $Status = ($Pending == 0) ? 1 : 2; - - $link->Set( array( 'Name', 'Description', 'Url', 'CreatedOn', 'Status', 'EditorsPick', - 'NewItem','PopItem','HotItem', 'CreatedById', 'CachedRating', - 'CachedVotesQty','Hits', 'Priority','Expire'), - array( $row->fields['link_name'], $row->fields['link_desc'], $row->fields['link_url'], $row->fields['link_date'], $Status, - $row->fields['link_pick'], 2, 2, 2, $newuserid, (int)$row->fields['link_rating'], - (int)$row->fields['link_votes'],(int)$row->fields['link_hits'], 0,$row->fields['link_expires'])); - - $link->Set('ResourceId',$ResourceId); - $ResourceId++; - $link->Create(); - - // add link to desired categories (add 1st category found as primary) - $cats = $LinkCatIndex[$oldid]; - $PrimaryCat = 1; - foreach($cats as $OldCatID) - { - $categoryid = $portalconn->GetOne( sprintf($get_cat_sql, $TablePrefix, $OldCatID) ); - $link->AddToCategory($categoryid, '', $PrimaryCat); - if($PrimaryCat) - { - $PrimaryCat = 0; - $oldcatid = $OldCatID; - } - } - - $newid = $link->Get('LinkId'); - $resid = $link->Get('ResourceId'); - $oldcustom = $row->fields['link_cust']; - $linkimage = $row->fields['link_image']; - - if($linkimage) addimage($resid,$linkimage); - - #calls to import reviews - reviewimport($link,$oldid,$resid); - - $totemp = 'INSERT INTO '.$TablePrefix.'import (otname,oid,ocustomid,oparentid,ntname,nid,nrid,npid) '; - $tovalues= " VALUES ('inl_links',$oldid,$oldcustom,$oldcatid,'link', $newid, $resid, 0 )"; - $totemp = $totemp.$tovalues; - $portalconn->Execute($totemp); - - #prelast while - $row->moveNext(); - } - - if ($counter == $limit) - { - setstart($start + $limit, 'links'); - } - else - { - $sql = 'UPDATE '.GetTablePrefix().'CategoryItems SET CategoryId = '.$init_cat.' WHERE CategoryId = 0 AND PrimaryCat = 1'; - $portalconn->Execute($sql); - setstart(0,'custom'); - } - -} - -#importing image from the in-link -function addimage($resourceid, $imageurl) -{ - global $objImageList, $image_name; - #echo "
    IMAGE RESOURCEID: $resourceid IMAGE URL: $imageurl
    "; - if(!is_object($objImageList)) - $objImageList = new clsImageList(); - - $LocalImage = 0; - $LocalThumb = 0; - if(!strlen($image_name)) - $image_name='inlink_image'; - - $img = $objImageList->Add($image_name,'',$resourceid, 0, 0,'', $imageurl, 1,0, 1, 0,1); -} -#Reviews Import for links -function reviewimport($myclass,$oldid,$rid) -{ - global $objCustomFieldList, $linkconn, $portalconn; - #ITEM AddReview($createdBy,$reviewText,0) - - $query='select * from inl_reviews where rev_link = '.$oldid; - $row =$linkconn->Execute($query); - while($row && !$row->EOF) - { - $oldreviewuser= $row->fields['rev_user']; - if($oldreviewuser !=0) #meaning was not created by guest - { - $newrid = GetNewID('users', $oldreviewuser); - if ($newrid) - { - $temp=$myclass->AddReview($newrid, $row->fields['rev_text'], $row->fields['rev_pend'], '127.0.0.1', 1, 'In-Link', $row->fields['rev_date']); - } - else - { - $temp=$myclass->AddReview(0, $row->fields['rev_text'], $row->fields['rev_pend'], '127.0.0.1', 1, 'In-Link', $row->fields['rev_date']); - } - } - else #meaning was created by guest - { - $temp=$myclass->AddReview(0, $row->fields['rev_text'], $row->fields['rev_pend'], '127.0.0.1', 1, 'In-Link', $row->fields['rev_date']); - } - $row->moveNext(); - } -} -#HELPER FUNCTION THAT GETS THE NEW ID of the USER - -/** -* @return int -* @param string $IDType -* @param int $OldID -* @desc Returns new id for specified record type ($IDType) with id ($OldID) -*/ -function GetNewID($IDType, $OldID) -{ - global $TablePrefix; - $get_id_sql = "SELECT nid FROM %simport WHERE otname = 'inl_%s' AND oid = %s"; - $db =&GetADODBConnection(); - $id = $db->GetOne( sprintf($get_id_sql, $TablePrefix, $IDType, $OldID) ); - return $id; -} - -//^^^^^^^^^^^^^^^^^^^^^^ABOVE IS LINKS IMPORT - - -#########################################Custom Fields Import -#create a new CustomField first and then -#by selecting all and receiving from one record of inl_config the values of cc1,cc2,cc3,cc4,cc5,cc6,uc1,uc2,uc3,uc4,uc5,uc6,lc1,lc2,lc3,lc4,lc5,lc6 -#go through all import table and if ocustomid occures get the row from inl_custom and -#create CustomMetaData field -#--------------------- -#Regarding CustomField: -#FieldName= cc1,cc2 .... from inl_config -#FieldLabel= value of cc1, cc2 .... -#Type=4 for links 6 for users 0 category -#------------ -#Regarding CustomMetaData -#ResourceId <= link id -#CustomFieldId <= id from the top -#Value = Value from the table custom - -//VVVVV BELOW ARE CUSTOM FIELD IMPORT REQUIRES TO HAVE A TEMPROARY TABLE IMPORT -function customimport() -{ - global $linkconn, $portalconn, $start, $TablePrefix; - $limit = 40; #just for debugging purposes, in real life set it to higher number - - if ($start == 0) { - $r = buildfields(); - $query = 'SELECT count(*) as cc from '.$TablePrefix.'import WHERE NOT ocustomid=0'; - $row = $portalconn->Execute($query); - if ($row && !$row->EOF) settotal($row->fields['cc']); - } - else { - $r = getfields(); - } - - $query = 'SELECT * from '.$TablePrefix.'import WHERE ocustomid != 0 limit '.$start.','.$limit; - $row = $portalconn->Execute($query); - $counter = 0; - - while ($row && !$row->EOF) { - $counter++; - loadcustom($row->fields['ocustomid'],$row->fields['nrid'],$row->fields['otname'],$r); - $row->moveNext(); - } - - if ($counter == $limit) { - setstart($start + $limit, 'custom'); - } - else { - // goto next step - setstart(0, 'relcat'); - } -} - -function loadcustom($customid,$rid,$tablename,$r) -{ - global $linkconn, $objCustomDataList, $objSession; - - $objCustomDataList->Clear(); - switch ($tablename) { - case 'inl_cats': - $SessionVar = 'custom_category'; - $prefix = 'c'; - break; - - case 'inl_users': - $SessionVar = 'custom_user'; - $prefix = 'u'; - break; - - case 'inl_links': - $SessionVar = 'custom_links'; - $prefix = 'l'; - break; - } - $fields = explode(',', $objSession->GetVariable($SessionVar) ); - - $query = 'select * from inl_custom Where cust_id = '.$customid; - $row = $linkconn->Execute($query); - if($row && $row->RecordCount() ) - { - for($x = 0; $x < count($fields); $x++) - { - $cust = $row->fields[ 'cust'.($x + 1) ]; - $fieldid = $r[ $fields[$x] ]; - $objCustomDataList->SetFieldValue($fieldid, $rid, $cust); - } - $objCustomDataList->SaveData($prefix, $rid); - } -} - -function buildfields() #building and populating an array -{ - global $objCustomFieldList, $objSession, $linkconn; - - $application =& kApplication::Instance(); - $ml_helper =& $application->recallObject('kMultiLanguageHelper'); - - // User Custom Fields: - $query = "SELECT * FROM inl_config WHERE name LIKE 'uc%'"; - $row = $linkconn->Execute($query); - $names = Array(); - while($row && !$row->EOF) - { - $data = $row->fields; - $fieldlabel = $data['name']; - if( strlen($data['value']) ) $fieldlabel = $data['value']; - //$f = $objCustomFieldList->AddField(6, $data['name'], $fieldlabel); - $f = $objCustomFieldList->AddField(6, $data['name'], $fieldlabel, 1, 'la_inlink', 'lu_fieldcustom__'.$data['name'], 'text', ''); - - $r[ $data['name'] ] = $f->Get('CustomFieldId'); // Save ID of created CustomField - $objSession->SetVariable('custom_'.$data['name'], $f->Get('CustomFieldId') ); // Save that ID to session - $names[] = $data['name']; - $row->MoveNext(); - } - $objSession->SetVariable('custom_user',implode(',',$names) ); // save list of user custom fields - $ml_helper->createFields('u-cdata', true); - unset($names); - - // Category Custom Fields: - $names = Array(); - $query = "SELECT * FROM inl_config WHERE name LIKE 'cc%'"; - $row = $linkconn->Execute($query); - while($row && !$row->EOF) - { - $data = $row->fields; - $fieldlabel = $data['name']; - if( strlen($data['value']) ) $fieldlabel = $data['value']; - // DT_USER, $pending_uf, '', 1, 'la_bb', 'lu_fieldcustom__'.$pending_uf, 'text', ''); - $f = $objCustomFieldList->AddField(1, $data['name'], $fieldlabel,1,'la_inlink', 'lu_fieldcustom__'.$data['name'], 'text', ''); - //$f = $objCustomFieldList->AddField(1, $data['name'], $fieldlabel); - - $r[ $data['name'] ] = $f->Get('CustomFieldId'); - $objSession->SetVariable('custom_'.$data['name'], $f->Get('CustomFieldId') ); - $names[] = $data['name']; - $row->MoveNext(); - } - $objSession->SetVariable('custom_category', implode(',',$names) ); - $ml_helper->createFields('c-cdata', true); - unset($names); - - // Links Custom Fields: - $names = Array(); - $query = "SELECT * FROM inl_config WHERE name LIKE 'lc%'"; - $row = $linkconn->Execute($query); - while($row && !$row->EOF) - { - $data = $row->fields; - $fieldlabel = $data['name']; - if( strlen($data['value']) ) $fieldlabel = $data['value']; - //$f = $objCustomFieldList->AddField(4, $data['name'], $fieldlabel); - $f = $objCustomFieldList->AddField(4, $data['name'], $fieldlabel,1,'la_inlink', 'lu_fieldcustom__'.$data['name'], 'text', ''); - $r[ $data['name'] ] = $f->Get('CustomFieldId'); - $objSession->SetVariable('custom_'.$data['name'], $f->Get('CustomFieldId') ); - $names[] = $data['name']; - $row->MoveNext(); - } - $objSession->SetVariable('custom_links', implode(',',$names) ); - $ml_helper->createFields('l-cdata', true); - return $r; -} - -function getfields() #building and populating an array -{ - global $objSession; - - $r = Array(); - $tmp_fields = explode(',', $objSession->GetVariable('custom_user') ); // Array(uc1,uc2,uc3,...) - foreach($tmp_fields as $tmp_name) $r[$tmp_name] = $objSession->GetVariable('custom_'.$tmp_name); - - $tmp_fields = explode(',', $objSession->GetVariable('custom_category') ); - foreach($tmp_fields as $tmp_name) $r[$tmp_name] = $objSession->GetVariable('custom_'.$tmp_name); - - $tmp_fields = explode(',', $objSession->GetVariable('custom_links') ); - foreach($tmp_fields as $tmp_name) $r[$tmp_name] = $objSession->GetVariable('custom_'.$tmp_name); - - return $r; -} - - -################################################Relationships Import - -function relcatimport() -{ - global $linkconn,$objSession, $start; - $limit = 100; - $counter =0; - if ($start == 0) - { - $query='SELECT count(*) from inl_rel_cats'; - $row =$linkconn->Execute($query); - if ($row && !$row->EOF) - { - settotal($row->fields[0]); - - } - } - - $objRelList = new clsRelationshipList(); - $query='select * from inl_rel_cats LIMIT '.$start.', '.$limit; - $row =$linkconn->Execute($query); - while($row && !$row->EOF) - { - $counter++; - $sourceid = newcatrid($row->fields['cat_id']); - $targetid = newcatrid($row->fields['rel_id']); - if ($sourceid !='' && $targetid !='') - { - $r = $objRelList->Add($sourceid, 1,$targetid, 1); - $r->Create(); - } - $row->moveNext(); - } - - if ($counter == $limit) - { - setstart($start + $limit, 'relcat'); - } - else - { - setstart(0,'terminate'); - } - -} -function newcatrid($oid) -{ - global $portalconn, $TablePrefix; - $query2='select * from '.$TablePrefix.'import where otname=\'inl_cats\' and oid = '.$oid; - $row =$portalconn->Execute($query2); - if ($row->fields['nrid']) - { - return $row->fields['nrid']; - } - else - { - return ''; - } -} -// END OF RELATIONSHIP IMPORT -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.28.2/in-link/units/listings/listings_event_handler.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.28.2/in-link/units/listings/listings_event_handler.php (revision 12746) +++ branches/unlabeled/unlabeled-1.28.2/in-link/units/listings/listings_event_handler.php (revision 0) @@ -1,701 +0,0 @@ -getObject(); - - $selected_ids = $this->Application->GetVar('selected_ids'); - if ($selected_ids['l']) { - $link_id = $selected_ids['l']; - $sql = 'SELECT ResourceId - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE '.$this->Application->getUnitOption('l', 'IDField').' = '.$link_id; - - $object->SetDBField($this->Application->RecallVar('dst_field'), $this->Conn->GetOne($sql)); - $object->IgnoreValidation = true; - // $this->RemoveRequiredFields($object); - $object->Update(); - } - - $this->finalizePopup($event); - } - - function OnPreSaveListing(&$event) - { - $event->redirect=false; - $object =& $event->getObject( Array('skip_autoload' => true) ); - $object->IgnoreValidation = true; - // $this->RemoveRequiredFields($object); - $event->CallSubEvent('OnPreSave'); - $this->Application->SetVar($event->getPrefixSpecial(true).'_id', $object->GetId()); - return; - } - - function OnBeforeItemUpdate(&$event) - { - $object =& $event->getObject(); - if($object->IgnoreValidation) - { - $object->UpdateFormattersMasterFields(); - } - } - - function OnBeforeItemCreate(&$event) - { - $object =& $event->getObject(); - if($object->IgnoreValidation) - { - $object->UpdateFormattersMasterFields(); - } - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnBeforeDeleteFromLive(&$event) - { - $object =& $event->getObject(); - $sql = 'SELECT * FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ListingId = '.$object->GetId(); - $original_values = $this->Conn->GetRow($sql); - - $type_modified = ($object->GetDBField('ListingTypeId') != $original_values['ListingTypeId']); - $link_modified = ($object->GetDBField('ItemResourceId') != $original_values['ItemResourceId']); - $status_modified = ($object->GetDBField('Status') != $original_values['Status']); - - if($status_modified) - { - $email_event = $object->GetDBField('Status') ? 'LINK.ENHANCE.APPROVE' : 'LINK.ENHANCE.APPROVE'; - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser($email_event, $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin($email_event); - } - - if( $type_modified || $link_modified ) - { - $this->ResetLink($original_values); - } - - if( $status_modified || $type_modified || $link_modified ) - { - $this->EnhanceLink($object, $original_values); - } - - if( $status_modified && !($type_modified || $link_modified) ) - { - $this->ResetLink($original_values); - } - } - - function EnhanceLink(&$object, $original_values) - { - if ($object->GetDBField('Status') != STATUS_ACTIVE) { - return false; - } - - if ($object->GetDBField('ExpiresOn') < adodb_mktime()) { - $object->SetDBField('Status', STATUS_PENDING); - $object->Update(); - $this->ResetLink($original_values); - return false; - } - - $this->UpdateLink('OnPurchase', $object->GetDBField('ItemResourceId'), $object->GetDBField('ListingTypeId')); - - $listtype_object =& $this->Application->recallObject('lst'); - if( $listtype_object->GetDBField('OnPurchaseAddToCatEnabled') ) - { - $link_object =& $this->Application->recallObject('l'); - $add_to_cat = (int)$listtype_object->GetDBField('OnPurchaseAddToCat'); - $sql = 'DELETE FROM '.$this->Application->getUnitOption('l-ci', 'TableName').' - WHERE CategoryId = '.$add_to_cat.' - AND ItemResourceId = '.$link_object->GetDBField('ResourceId').' - AND PrimaryCat = 0'; - $this->Conn->Query($sql); - $sql = 'INSERT INTO '.$this->Application->getUnitOption('l-ci', 'TableName').' - (CategoryId, ItemResourceId, PrimaryCat) - VALUES ('.$add_to_cat.', '.$link_object->GetDBField('ResourceId').', 0)'; - $this->Conn->Query($sql); - } - } - - function ResetLink($original_values) - { - static $has_been_reset = Array(); - - if( $original_values['Status'] != STATUS_ACTIVE || - getArrayValue($has_been_reset, $original_values['ListingId']) ) - { - return; - } - - $has_been_reset[$original_values['ListingId']] = 1; - - $this->UpdateLink('OnExpire', $original_values['ItemResourceId'], $original_values['ListingTypeId']); - - $listtype_object =& $this->Application->recallObject('lst'); - if( $listtype_object->GetDBField('OnExpireRemoveFromCatEnabled') ) - { - $remove_from_cat = $listtype_object->GetDBField('OnExpireRemoveFromCat'); - $sql = 'DELETE FROM '.$this->Application->getUnitOption('l-ci', 'TableName').' - WHERE ItemResourceId = '.$original_values['ItemResourceId'].' - AND CategoryId = '.$remove_from_cat.' - AND PrimaryCat = 0'; - $this->Conn->Query($sql); - } - } - - function UpdateLink($action_prefix, $resource_id, $listtype_id) - { - - $link_object =& $this->Application->recallObject('l', null, Array('skip_autoload' => true)); - $link_object->Load($resource_id, 'ResourceId'); - - // "-item", because can be called as regular after event, and just "lst" recalls list instead - $listtype_object =& $this->Application->recallObject('lst.-item', null, Array('skip_autoload' => true)); - $listtype_object->Load($listtype_id); - - $action_fields = Array( 'EdPick' => 'EditorsPick', - 'New' => 'NewItem', - 'Hot' => 'HotItem', - 'Pop' => 'PopItem' - ); - // $action_prefix = 'OnPurchase'; - - foreach($action_fields as $action => $field) - { - $action_value = $listtype_object->GetDBField($action_prefix.$action); - if( $action_value != 3 ) - { - $link_object->SetDBField($field, $action_value); - } - } - - $priority_value = $listtype_object->GetDBField($action_prefix.'PriorityValue'); - switch( $listtype_object->GetDBField($action_prefix.'PriorityAction') ) - { - case 1: // equal - $link_object->SetDBField('Priority', $priority_value); - break; - case 2: // increase - $original_priority = $link_object->GetDBField('Priority'); - $link_object->SetDBField('Priority', $original_priority + $priority_value); - break; - case 3: // decrease - $original_priority = $link_object->GetDBField('Priority'); - $link_object->SetDBField('Priority', $original_priority - $priority_value); - break; - default: - } - - $link_object->Update(); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnRequestEnhancement(&$event) - { - if ($this->Application->isModuleEnabled('In-Commerce')) { - $l_info = $this->Application->GetVar('l'); - if (!$l_info) { - return false; - } - - list($link_id, $link_info) = each($l_info); - $listing_type_id = $link_info['ListingTypeId']; - - $listing_type =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing_type->Load($listing_type_id); - - if ($listing_type->GetDBField('EnableBuying')) { - $add_to_cart_event =& new kEvent('ord:OnAddVirtualProductToCart'); - $this->Application->HandleEvent($add_to_cart_event); - - if($add_to_cart_event->redirect) - { - $event->SetRedirectParam('pass', 'm'); - $event->redirect = $add_to_cart_event->redirect; - } - return true; - } - } - - $event->CallSubEvent('OnListingCreate'); - } - - /** - * Create listing or extend existing listing period - * - * @param kEvent $event - */ - function OnListingCreate(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - - switch ($event->Name) { - case 'EnhanceLinkAfterOrderApprove': - case 'EnhancedLinkOnCompleteOrder': - // when order with listing virtual product is approved - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $listing_type_id = $item_data['ListingTypeId']; - $link_id = $item_data['LinkId']; - - $new_processing = getArrayValue($item_data, 'HasNewProcessing'); - break; - - case 'OnListingCreate': - // when requesting enhancement from front (and not via in-commerce) - $links_info = $this->Application->GetVar('l'); - if (!$links_info) return false; - - $event->redirect = false; - list($link_id, $link_info) = each($links_info); - $listing_type_id = $link_info['ListingTypeId']; - - $new_processing = false; - break; - } - - // get resource_id of link beeing enhanced - $sql = 'SELECT ResourceId - FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $resource_id = $this->Conn->GetOne($sql); - - // get listing by link's resource_id - $object->Load($resource_id, 'ItemResourceId'); - if ($object->isLoaded()) { - $original_values = $object->FieldValues; - } - else { - // set initial fields to listing - $object->SetDBField('ListingTypeId', $listing_type_id); - $object->SetDBField('ItemResourceId', $resource_id); - - if ($event->Name == 'OnListingCreate' || $new_processing) { - $item_status = STATUS_PENDING; - } - else { - $item_status = STATUS_ACTIVE; - } - - $object->SetDBField('Status', $item_status); - } - - // set date of purchase for new listings - $purchased_on = max(adodb_mktime(), $object->GetDBField('ExpiresOn')); - if (!$object->isLoaded()) { - $object->SetDBField('PurchasedOn_date', $purchased_on); - $object->SetDBField('PurchasedOn_time', $purchased_on); - } - - // set expiration time for listing - $listing_type =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $listing_type->Load($listing_type_id); - - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $listing_type->GetDBField('Duration'); - $duration_type = $listing_type->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $expiration_date = $purchased_on + $expiration_interval; - $object->SetDBField('ExpiresOn_date', $expiration_date); - $object->SetDBField('ExpiresOn_time', $expiration_date); - - // when extending enhancement mark listing as non-received renewal reminder - $object->SetDBField('RenewalReminderSent', 0); - - $action = $object->isLoaded() ? 'Update' : 'Create'; - if ($object->$action()) { - $event->status = erSUCCESS; - switch ($event->Name) { - case 'EnhanceLinkAfterOrderApprove': - case 'EnhancedLinkOnCompleteOrder': - // when order with listing virtual product is approved - if (getArrayValue($original_values, 'Status') != STATUS_ACTIVE) { - $this->EnhanceLink($object, Array()); - } - break; - - case 'OnListingCreate': - // when requesting enhancement from front (and not via in-commerce) - $event->redirect = $this->Application->GetVar('success_template'); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE'); - break; - } - - - } - else { - $event->status = erFAIL; - } - - - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function EnhancedLinkOnCompleteOrder(&$event) - { - // create enhancement, but pending - $this->OnListingCreate($event); - - // save created listing_id back to itemdata - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - unset($item_data['ListingTypeId']); - $item_data['ListingId'] = $object->GetID(); - - $orditems_idfield = $this->Application->getUnitOption('orditems', 'IDField'); - $orditems_table = $this->Application->getUnitOption('orditems', 'TableName'); - - $this->Conn->doUpdate( Array('ItemData' => serialize($item_data)), $orditems_table, $orditems_idfield.' = '.$fields['OrderItemId'] ); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function EnhanceLinkAfterOrderApprove(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - - if ( getArrayValue($item_data, 'HasNewProcessing') ) { - // new processing: just approve created listing here - $listing_id = $item_data['ListingId']; - $object->Load($listing_id); - $object->SetDBField('Status', STATUS_ACTIVE); - $object->Update(); - - $this->EnhanceLink($object, Array()); - return true; - } - else { - // create listing & approve it at the same time - $this->OnListingCreate($event); - } - } - - /** - * Delete listing - * - * @param kEvent $event - */ - function EnhanceLinkAfterOrderDeny(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $listing_id = $item_data['ListingId']; - - $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial().'_TempHandler', 'kTempTablesHandler'); - $temp_handler->DeleteItems($event->Prefix, $event->Special, Array($listing_id)); - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function ExpireLink(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $fields = $event->getEventParam('field_values'); - $item_data = unserialize($fields['ItemData']); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$item_data['LinkId']; - $listing_id = $this->Conn->GetOne($sql); - $object->Load($listing_id); - $original_values = $object->FieldValues; - $object->SetDBField('Status', 2); - - if($object->Update()) - { - $event->status = erSUCCESS; - $this->ResetLink($original_values); - } - else - { - $event->status = erFAIL; - } - } - - function iterateItems(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $this->StoreSelectedIDs($event); - - if($event->Name == 'OnMassApprove') - { - $ids = $this->getSelectedIDs($event); - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') != 1) - { - $original_values = $object->FieldValues; - $object->SetDBField('Status', 1); - $this->EnhanceLink($object, $original_values); - } - } - } - if($event->Name == 'OnMassDecline') - { - $ids = $this->getSelectedIDs($event); - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') == 1) - { - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.DENY', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.DENY'); - } - } - } - parent::iterateItems($event); - if($event->Name == 'OnMassApprove') - { - $lst_object =& $this->Application->recallObject('lst', null, Array('skip_autoload' => true)); - $ids = $this->getSelectedIDs($event); - if($ids) - { - foreach($ids as $id) - { - $object->Load($id); - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $owner_id = $this->Conn->GetOne($sql); - if($object->GetDBField('PendingRenewal') == 1) - { - $lst_object->Load( $object->GetDBField('ListingTypeId') ); - $dur_type_mapping = Array( 1 => 1, - 2 => 60, - 3 => 3600, - 4 => 3600*24, - 5 => 3600*24*7, - 6 => 3600*24*365/12, - 7 => 3600*24*365 - ); - $duration = $lst_object->GetDBField('Duration'); - $duration_type = $lst_object->GetDBField('DurationType'); - $expiration_interval = $duration * $dur_type_mapping[$duration_type]; - $renewal_begins = max( adodb_mktime(), $object->GetDBField('ExpiresOn') ); - $expiration_date = $renewal_begins + $expiration_interval; - - $object->SetDBField('ExpiresOn_date', $expiration_date); - $object->SetDBField('ExpiresOn_time', $expiration_date); - - $object->SetDBField('RenewalReminderSent', 0); - $object->SetDBField('PendingRenewal', 0); - - if( $object->Update() ) - { - $event->status=erSUCCESS; - $event->redirect_params = Array('opener' => 's', 'pass_events' => true); //stay! - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.RENEW', $owner_id); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.RENEW'); - } - else - { - $event->status=erFAIL; - $event->redirect=false; - break; - } - } - else - { - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.APPROVE', $owner_id); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.APPROVE'); - } - } - } - } - } - - /** - * Enter description here... - * - * @param kEvent $event - */ - function OnCancel(&$event) - { - parent::OnCancel($event); - $event->SetRedirectParam('opener', 's'); - $event->redirect = $this->Application->GetVar('cancel_template'); - } - - function OnExtendEnhancement(&$event) - { - $link_id = $this->Application->GetVar('l_id'); - $sql = 'SELECT ResourceId FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $link_resource_id = $this->Conn->GetOne($sql); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$link_resource_id; - - $object =& $event->getObject( Array('skip_autoload' => true) ); - $object->Load( $this->Conn->GetOne($sql) ); - - $object->SetDBField('PendingRenewal', 1); - $object->Update(); - $event->redirect = $this->Application->GetVar('success_template'); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.EXTEND', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.EXTEND'); - } - - function OnCancelEnhancement(&$event) - { - $link_id = $this->Application->GetVar('l_id'); - $sql = 'SELECT ResourceId FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE LinkId = '.$link_id; - $link_resource_id = $this->Conn->GetOne($sql); - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ItemResourceId = '.$link_resource_id; - - $object =& $this->Application->recallObject($event->Prefix, null, Array('skip_autoload' => true)); - $object->Load( $this->Conn->GetOne($sql) ); - $original_values = $object->FieldValues; - $original_values['Status'] = 1; - $this->ResetLink($original_values); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.CANCEL', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.CANCEL'); - - $object->Delete(); - $event->redirect = $this->Application->GetVar('success_template'); - } - - function OnCheckExpiredPaidListings(&$event) - { - $sql = 'SELECT ListingId FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - WHERE ExpiresOn < '.adodb_mktime().' AND Status = 1'; - $expired_listings = $this->Conn->GetCol($sql); - if(is_array($expired_listings) && count($expired_listings) > 0) - { - $object =& $this->Application->recallObject($event->Prefix.'.-item', null, Array('skip_autoload' => true)); - foreach($expired_listings as $listing_id) - { - $object->Load($listing_id); - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - $object->SetDBField('Status', 2); - $object->Update(); - - $sql = 'SELECT CreatedById FROM '.$this->Application->getUnitOption('l', 'TableName').' - WHERE ResourceId = '.$object->GetDBField('ItemResourceId'); - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.EXPIRE', $this->Conn->GetOne($sql)); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.EXPIRE'); - } - } - - $sql = 'SELECT ls.ListingId, l.CreatedById FROM '.$this->Application->getUnitOption($event->Prefix, 'TableName').' ls - LEFT JOIN '.$this->Application->getUnitOption('lst', 'TableName').' lst - ON ls.ListingTypeId = lst.ListingTypeId - LEFT JOIN '.$this->Application->getUnitOption('l', 'TableName').' l - ON ls.ItemResourceId = l.ResourceId - WHERE ls.Status = 1 - AND ls.ExpiresOn < '.adodb_mktime().' + lst.RenewalReminder * 3600 *24 - AND ls.RenewalReminderSent = 0'; - $res = $this->Conn->Query($sql); - if(is_array($res) && count($res) > 0) - { - $listing_ids = Array(); - foreach($res as $record) - { - $email_event_user =& $this->Application->EmailEventUser('LINK.ENHANCE.RENEWAL.NOTICE', $record['CreatedById']); - $email_event_admin =& $this->Application->EmailEventAdmin('LINK.ENHANCE.RENEWAL.NOTICE'); - $listing_ids[] = $record['ListingId']; - } - $sql = 'UPDATE '.$this->Application->getUnitOption($event->Prefix, 'TableName').' - SET RenewalReminderSent = 1 - WHERE ListingId IN ('.implode(',', $listing_ids).')'; - $this->Conn->Query($sql); - } - } - - function OnMassDelete(&$event) - { - $object =& $event->getObject( Array('skip_autoload' => true) ); - $this->StoreSelectedIDs($event); - - $ids = $this->getSelectedIDs($event); - foreach($ids as $id) - { - $object->Load($id); - if($object->GetDBField('Status') == 1) - { - $original_values = $object->FieldValues; - $this->ResetLink($original_values); - } - } - parent::OnMassDelete($event); - } - - /** - * Moves enhancement from original link to it's pending copy, that is going to be approved - * - * @param kEvent $event - */ - function OnMoveEnhancement(&$event) - { - $id_field = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'IDField'); - $item_table_name = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'TableName'); - - $pending_id = $event->MasterEvent->getEventParam('id'); - $original_id = $event->MasterEvent->getEventParam('original_id'); - - $sql = 'SELECT ResourceId, '.$id_field.' - FROM '.$item_table_name.' - WHERE '.$id_field.' IN ('.$pending_id.','.$original_id.')'; - $resource_ids = $this->Conn->GetCol($sql, $id_field); - - $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); - $sql = 'UPDATE '.$table_name.' - SET ItemResourceId = '.$resource_ids[$pending_id].' - WHERE ItemResourceId = '.$resource_ids[$original_id]; - $this->Conn->Query($sql); - } -} - -?> \ No newline at end of file Index: branches/unlabeled/unlabeled-1.65.2/in-link/units/links/links_config.php =================================================================== diff -u -N --- branches/unlabeled/unlabeled-1.65.2/in-link/units/links/links_config.php (revision 12746) +++ branches/unlabeled/unlabeled-1.65.2/in-link/units/links/links_config.php (revision 0) @@ -1,370 +0,0 @@ - 'l', - 'ItemClass' => Array('class'=>'kCatDBItem','file'=>'','build_event'=>'OnItemBuild'), - 'ListClass' => Array('class'=>'kCatDBList','file'=>'','build_event'=>'OnListBuild'), - 'EventHandlerClass' => Array('class' => 'LinksEventHandler', 'file' => 'links_event_handler.php', 'require_classes' => Array('kCatDBEventHandler'), 'build_event'=>'OnBuild'), - 'TagProcessorClass' => Array('class'=>'LinkTagProcessor','file'=>'link_tag_processor.php', 'require_classes' => Array('kCatDBTagProcessor'), 'build_event'=>'OnBuild'), - 'AutoLoad' => true, - - 'ConfigPriority' => 0, - 'Hooks' => Array ( - Array ( - 'Mode' => hBEFORE, - 'Conditional' => false, - 'HookToPrefix' => '', - 'HookToSpecial' => '*', - 'HookToEvent' => Array('OnAfterConfigRead'), - 'DoPrefix' => 'cdata', - 'DoSpecial' => '*', - 'DoEvent' => 'OnDefineCustomFields', - ), - ), - - 'QueryString' => Array( - 1 => 'id', - 2 => 'Page', - 3 => 'Reviews_Page', // depricated (for old in-link) - 4 => 'event', - 5 => 'mode', - ), - 'CatalogItem' => true, - 'AdminTemplatePath' => 'links', - 'AdminTemplatePrefix' => 'links_', - 'IDField' => 'LinkId', - 'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events - - 'ItemType' => 4, - - 'StatisticsInfo' => Array( - 'pending' => Array( - 'icon' => 'icon16_link_pending.gif', - 'label' => 'la_Text_Links', - 'js_url' => '#url#', - 'url' => Array('t' => 'in-portal/advanced_view', 'SetTab' => 'l', 'pass' => 'm,l.showall', 'l.showall_event' => 'OnSetFilterPattern', 'l.showall_filters' => 'show_active=0,show_pending=1,show_disabled=0,show_new=1,show_hot=1,show_pop=1,show_pick=1'), - 'status' => STATUS_PENDING, - ), - ), - - 'TitlePhrase' => 'la_Text_Link', // phrase used to specify item type in relationship list - - 'ViewMenuPhrase' => 'la_title_Links', - 'UsePendingEditing' => true, // item editing is controlled by LINK.ADD/EDIT, LINK.ADD/EDIT.PENDING permissions - - 'CatalogSelectorName' => 'linklist', // used in old catalog section - - 'ItemPropertyMappings' => Array( - 'NewDays' => 'Link_NewDays', // number of days item to be NEW - 'MinPopVotes' => 'Link_MinPopVotes', // minimum number of votes for an item to be POP - 'MinPopRating' => 'Link_MinPopRating', // minimum rating for an item to be POP - 'MaxHotNumber' => 'Link_MaxHotNumber', // maximum number of HOT items - - 'HotLimit' => 'Link_HotLimit', // variable name in inp_Cache table - 'ClickField' => 'Hits', // item click count is stored here (in item table) - ), - - 'TitleField' => 'Name', - - 'TitlePresets' => Array( - 'default' => Array( 'new_status_labels' => Array('l'=>'!la_title_AddingLink!'), - 'edit_status_labels' => Array('l'=>'!la_title_EditingLink!'), - 'new_titlefield' => Array('l'=>'!la_title_NewLink!'), - ), - - 'links_edit' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_General!"), - - 'link_list'=>Array( 'prefixes' => Array('c_List', 'l_List'), - 'format' => "!la_title_Categories! (#c_recordcount#) - !la_title_Links! (#l_recordcount#)", - ), - 'link_edit'=>Array( 'prefixes' => Array('l'), - 'new_titlefield' => Array('l'=>'!la_title_NewLink!'), - 'format' => "#l_status# '#l_titlefield#' - !la_title_General!", - ), - - 'links_categories'=>Array('prefixes' => Array('l','l-ci_List'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Categories!"), - 'links_relations'=> Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Relations!"), - 'links_images' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Images!"), - 'links_reviews' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Reviews!"), - 'links_custom' => Array('prefixes' => Array('l'), 'format' => "#l_status# '#l_titlefield#' - !la_title_Custom!"), - - 'images_edit' => Array( 'prefixes' => Array('l', 'l-img'), - 'new_status_labels' => Array('l-img'=>'!la_title_Adding_Image!'), - 'edit_status_labels' => Array('l-img'=>'!la_title_Editing_Image!'), - 'new_titlefield' => Array('l-img'=>'!la_title_New_Image!'), - 'format' => "#l_status# '#l_titlefield#' - #l-img_status# '#l-img_titlefield#'", - ), - - 'reviews_edit' => Array( 'prefixes' => Array('l', 'l-rev'), - 'new_status_labels' => Array('l-rev'=>"!la_title_Adding_Review! '!la_title_New_Review!'"), - 'edit_status_labels' => Array('l-rev'=>'!la_title_Editing_Review!'), - 'format' => "#l_status# '#l_titlefield#' - #l-rev_status#", - ), - - 'relations_edit' => Array( 'prefixes' => Array('l', 'l-rel'), - 'new_status_labels' => Array('l-rel'=>"!la_title_Adding_Relationship! '!la_title_New_Relationship!'"), - 'edit_status_labels' => Array('l-rel'=>'!la_title_Editing_Relationship!'), - 'format' => "#l_status# '#l_titlefield#' - #l-rel_status#", - ), - - 'links_export' => Array('format' => '!la_title_LinksExport!'), - - 'links_import' => Array('format' => '!la_title_ImportLinks!'), - - 'duplicate_links' => Array('prefixes' => Array('l.duplicates_List'), 'format' => "!la_title_DuplicateLinks! (#l.duplicates_recordcount#)"), - - 'tree_in-link' => Array('format' => '!la_Text_Version! '.$this->Application->findModule('Name', 'In-Link', 'Version')), - ), - - 'PermItemPrefix' => 'LINK', - - 'PermTabText' => 'In-Link', - 'PermSection' => Array('main' => 'CATEGORY:in-link:links_list', 'search' => 'in-link:configuration_search', 'email' => 'in-link:configuration_email', 'custom' => 'in-link:configuration_custom'), - - 'Sections' => Array( - 'in-link' => Array( - 'parent' => 'in-portal:root', - 'icon' => 'settings_in-link', - 'label' => 'la_title_In-Link', - 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view'), - 'priority' => 3.1, - 'type' => stTREE, - ), - - 'in-link:inlink_general' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_general', - 'label' => 'la_tab_GeneralSettings', - 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 1, - 'type' => stTREE, - ), - - 'in-link:configuration_output' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_output', - 'label' => 'la_tab_ConfigOutput', - 'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 2, - 'type' => stTREE, - ), - - 'in-link:configuration_search' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_search', - 'label' => 'la_tab_ConfigSearch', - 'url' => Array('t' => 'config/config_search', 'module_key' => 'links', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 3, - 'type' => stTREE, - ), - - 'in-link:configuration_email' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_email', - 'label' => 'la_tab_ConfigE-mail', - 'url' => Array('t' => 'config/config_email', 'pass_section' => true, 'pass' => 'm'), - 'permissions' => Array('view', 'edit'), - 'priority' => 4, - 'type' => stTREE, - ), - - 'in-link:configuration_custom' => Array( - 'parent' => 'in-link', - 'icon' => 'settings_custom', - 'label' => 'la_tab_ConfigCustom', - 'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 4, 'pass_section' => true, 'pass' => 'm,cf'), - 'permissions' => Array('view', 'add', 'edit', 'delete'), - 'priority' => 5, - 'type' => stTREE, - ), - - 'in-link:duplicate_checker' => Array( - 'parent' => 'in-link', - 'icon' => 'duplicate_checker', - 'label' => 'la_tab_DuplicateChecker', - 'url' => Array('t' => 'in-link/duplicate_checker', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit', 'delete'), - 'priority' => 6, - 'type' => stTREE, - ), - - 'in-link:validation_list' => Array( - 'parent' => 'in-link', - 'icon' => 'validate', - 'label' => 'la_tab_LinkValidation', - 'url' => Array('index_file' => '../in-link/admin/validation.php', 'pass' => 'm'), - 'permissions' => Array('view', 'add', 'edit'), - 'priority' => 7, - 'type' => stTREE, - ), - ), - - 'FilterMenu' => Array( - 'Groups' => Array( - Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_new'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_hot'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_pop'), 'type' => HAVING_FILTER), - Array('mode' => 'AND', 'filters' => Array('show_pick'), 'type' => WHERE_FILTER), - ), - 'Filters' => Array( - 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ), - 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ), - 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ), - 's1' => Array(), - 'show_new' => Array('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ), - 'show_hot' => Array('label' => 'la_Text_Hot', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ), - 'show_pop' => Array('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ), - 'show_pick' => Array('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '%1$s.`EditorsPick` != 1' ), - ) - ), - - 'TableName' => TABLE_PREFIX.'Link', - - 'CalculatedFields' => Array( - '' => Array ( - 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.CreatedById = -1, "root", IF (%1$s.CreatedById = -2, "Guest", "n/a")), u.Login)', - 'CategoryId' => TABLE_PREFIX.'%3$sCategoryItems.CategoryId', - 'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename', - 'CategoryFilename' => TABLE_PREFIX.'Category.NamedParentPath', - ), - ), - - 'CacheModRewrite' => true, - - 'AggregatedCalculatedFields' => Array( - - 'duplicates' => Array ( - 'DupeCount' => 'COUNT(*)', - ), - ), - - - 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId - LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'PermCache perm ON perm.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId - LEFT JOIN '.TABLE_PREFIX.'%3$sLinkCustomData cust ON %1$s.ResourceId = cust.ResourceId', - - ), // key - special, value - list select sql - - 'ListSortings' => Array( - '' => Array( - 'ForcedSorting' => Array('EditorsPick' => 'desc', 'Priority' => 'desc'), - 'Sorting' => Array('Name' => 'asc', 'Description' => 'desc'), - ) - ), - 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s - FROM %1$s - LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId - LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId - LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId - LEFT JOIN '.TABLE_PREFIX.'%3$sLinkCustomData cust ON %1$s.ResourceId = cust.ResourceId'), - - 'SubItems' => Array('l-rev', 'l-ci', 'l-rel', 'l-img', 'l-cdata'), - - 'Fields' => Array ( - 'LinkId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,), - 'Name' => Array('type' => 'string', /*'formatter' => 'kMultiLanguage',*/ 'not_null' => 1, 'required' => 1, 'max_len' => 255, 'default' => ''), - 'AutomaticFilename' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1), - 'Description' => Array('type' => 'string', /*'formatter' => 'kMultiLanguage',*/ 'default' => null), - 'Url' => Array('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''), - 'CreatedOn' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'), - 'Modified' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'), - 'Expire' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null), - 'Hits' => Array('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0), - 'CachedRating' => Array('type' => 'string', 'not_null' => 1, 'formatter' => 'kFormatter', 'default' => 0), - 'CachedVotesQty' => Array('type' => 'int', 'formatter' => 'kFormatter', 'not_null' => 1, 'default' => 0), - 'CachedReviewsQty' => Array('type' => 'int', 'formatter' => 'kFormatter', 'default' => null), - 'CreatedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => -1), - 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => -1), - 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => 0), - 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2), - 'EditorsPick' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0), - 'ResourceId' => Array('type' => 'int', 'default' => null), - 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2), - 'OrgId' => Array('type' => 'int', 'default' => null), - ), - - 'VirtualFields' => Array( - 'UserName' => Array('type' => 'string', 'default' => ''), - 'DupeCount' => Array('type' => 'string', 'default' => ''), - - // export related fields: begin - 'CategoryId' => Array('type' => 'int', 'default' => 0), - 'ExportFormat' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'CSV', /*2 => 'XML'*/), 'default' => 1), - 'ExportFilename' => Array('type' => 'string', 'default' => ''), - 'FieldsSeparatedBy' => Array('type' => 'string', 'default' => ','), - 'FieldsEnclosedBy' => Array('type' => 'string', 'default' => '"'), - 'LineEndings' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'Windows', 2 => 'UNIX'), 'default' => 1), - 'LineEndingsInside' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'CRLF', 2 => 'LF'), 'default' => 2), - 'IncludeFieldTitles' => Array('type' => 'int', 'default' => 1), - 'ExportColumns' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array()), - 'AvailableColumns' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array()), - 'CategoryFormat' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_MixedCategoryPath', 2 => 'la_SeparatedCategoryPath'), 'default' => 1), - 'CategorySeparator' => Array('type' => 'string', 'default' => ':'), - 'IsBaseCategory' => Array('type' => 'int', 'default' => 0), - // export related fields: end - - // import related fields: begin - 'FieldTitles' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Automatic', 2 => 'la_Manual'), 'default' => 1), - 'ImportSource' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Upload', 2 => 'la_Local'), 'default' => 2), - 'ImportFilename' => Array('type' => 'string', 'formatter' => 'kUploadFormatter', 'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => '/admin/export/'), - 'ImportLocalFilename' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'default' => ''), - 'CheckDuplicatesMethod' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_IDField', 2 => 'la_OtherFields'), 'default' => 1), - 'ReplaceDuplicates' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 0), - 'DuplicateCheckFields' => Array('type' => 'string', 'formatter' => 'kOptionsFormatter', 'options' => Array('Name' => 'NAME', 'Url' => 'URL'), 'default' => '|Name|Url|'), - 'SkipFirstRow' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'default' => 1), - // import related fields: end - - 'ThumbnailImage' => Array('type' => 'string', 'default' => ''), - 'FullImage' => Array('type' => 'string', 'default' => ''), - 'ImageAlt' => Array('type' => 'string', 'default' => ''), - - 'Filename' => Array('type' => 'string','not_null' => 1,'default' => ''), - 'CachedNavbar' => Array('type' => 'string', 'default' => ''), - ), - - 'Grids' => Array( - 'Default' => Array( - 'Icons' => Array(0 => 'icon16_link_disabled.gif', 1 => 'icon16_link.gif', 2 => 'icon16_link_pending.gif', -2 => 'icon16_link_pending.gif', 'HOT' => 'icon16_link_hot.gif', 'POP' => 'icon16_link_pop.gif', 'NEW' => 'icon16_link_new.gif', 'PICK' => 'icon16_link_pick.gif'), - 'Fields' => Array( - 'Name' => Array( 'title'=>'la_col_LinkName' , 'data_block' => 'grid_checkbox_td'), - 'Url' => Array( 'title'=>'la_col_LinkUrl' ), - 'Description' => Array( 'title'=>'la_col_Description' ), - 'Modified' => Array( 'title'=>'la_col_Modified' ), - ), - - ), - - - 'Duplicates' => Array( 'Icons' => Array('default' => 'icon16_link.gif'), - 'Fields' => Array( - 'Name' => Array( 'title'=>'la_col_LinkName' , 'data_block' => 'grid_checkbox_td'), - 'Url' => Array( 'title'=>'la_col_LinkUrl' ), - 'Description' => Array( 'title'=>'la_col_Description' ), - 'Modified' => Array( 'title'=>'la_col_Modified' ), - ), - - ), - ), - - - 'ConfigMapping' => Array( - 'PerPage' => 'Perpage_Links', - 'ShortListPerPage' => 'Perpage_Links_Short', - 'DefaultSorting1Field' => 'Link_SortField', - 'DefaultSorting2Field' => 'Link_SortField2', - 'DefaultSorting1Dir' => 'Link_SortOrder', - 'DefaultSorting2Dir' => 'Link_SortOrder2', - ), - ); -?> \ No newline at end of file