|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
5 R& x" N6 w2 R: A" x// Theme Option
5 |2 \' `' ]$ `3 B6 ?! R! ?* P, U2 J; m////////////////////////////////////////////////////////////////////////////////2 ~" d: g) y+ R+ Y3 D. T) D
4 w) Z s; ^! O8 E8 l
$themename = "Zenx";! Y4 l! p! Z$ O1 H
$shortname = str_replace(' ', '_', strtolower($themename));
# y- g2 e% H1 B) a+ P; g% U9 l2 x. Q1 a. R# ]* L* L
function get_theme_option($option)
$ m0 A+ h6 L; t% Z: _4 O t3 ~{; r! t% {. o! B& E
global $shortname;
9 U% X7 z5 `8 V& L- e5 o4 l return stripslashes(get_option($shortname . '_' . $option));+ K2 b: w! X2 E$ S
}
: s }+ b. ]8 V/ L! q* R. j
. M# {4 k( `0 h) |' O2 Z ~function get_theme_settings($option)
9 B8 [. S' v- j4 l- o{
2 ?# t/ b2 O U w9 V/ O. Y return stripslashes(get_option($option));9 }3 y i$ \' J; `
}
8 Y- q- K& |% s$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");) ~' x7 k4 E! S0 i2 q, V+ y
$wp_getcat = array();
! B1 V; X( f' o& u2 Sforeach ($wp_dropdown_rd_admin as $category_list) {
/ D; c: j M" O0 o0 R+ o$wp_getcat[$category_list->term_id] = $category_list->name;. O5 {/ G) M- a% t+ s" Z" V
}
" Q; g U' ^, @! [7 [$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");4 B: i% y! E% p8 P
$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
- P+ u9 Y" I: B' `( q$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");9 }( o' }) l" a& h, ~5 M
: O* S* q, b9 Y$ f8 u$options = array (
$ i( Y- h. C! L
' r; L8 b8 |* i% \" G! N4 y# C0 \& u: c6 k0 g
array( "name" => "Blog Header Settings",+ F" I/ _. a2 |; f& H& S. ?6 N
"type" => "heading",% X( S! B o0 ^- E. F
),! H. C2 ] k$ E1 C5 U5 a
+ a% U. |# o/ r/ {- O3 z% {1 i
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
& Z6 @) K" e! ^5 e r. w C "id" => $shortname."_header_logo_activate",
+ X; e+ n9 X4 _0 g/ } "type" => "select",5 f$ @! I8 r9 c8 |8 n$ K( I
"std" => "No",9 u/ `$ D% ~% Q$ u5 E% w& l; l
"options" => array("No", "Yes")),
E& @+ E6 ?0 a+ C5 [& \5 }& h
. W4 K7 x6 I: u/ p ~% T array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",, H' e+ r: V) z, K
"id" => $shortname."_logo_url",
) ^& Z C& w2 s& F "type" => "text",, w9 n y" o, [
"box" => "social",
% o% h$ d" u! C& H "std" => "", X1 S0 O! T0 r t7 K7 i0 H" T
), x$ q1 A% F+ K4 _
; \5 X2 {- Q8 ?. Q8 I) x array( "name" => "Insert Header Banner HTML Code (Header)
; T% ~1 p; E, V5 ] <br /><em>*Recommended Size 468 x 60</em>. h! l4 x5 K8 @: I/ N" }0 n$ w3 X3 m1 P
<br /><em>*leave blank if not use</em>",
! A5 C% o/ Z9 N, p7 ~8 l8 x "id" => $shortname."_header_banner",/ u3 k0 q. q' d# y
"type" => "textarea",
! R; {- q3 l# d. E: x: F& q$ B "std" => "",2 h% e1 ]8 e& G" U. d4 q
),
% S1 g# d: F l, U: W
$ P# v9 t. m% x+ A array( "name" => "</div></div>",
8 F1 X1 g% t# t2 O% M "type" => "close",
+ C: G2 F* @2 _( S | ),
8 z5 Y, h, U v) Q8 J% U8 L0 J0 i) q# }! ^9 ]# S D& I
' F% p2 m1 g/ \8 {' h* g! p array( "name" => "Header Navigation Settings",4 k9 w( s8 Y" P, r) B
"type" => "heading",. i5 ]- e e1 ?2 M4 x
),
, Z& H: f/ [. ?! c6 v. e P9 R! f" p- A: |0 X$ T5 W* m, r
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
) l$ \! x" K; `. U, @- ? <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
8 V# F7 W5 S( O <em>*Enter the page post ID number only</em><br />
?7 [' d) t: T" `* l! ?# q <em>*separate by comma</em><br />
* a- r7 j7 k% X4 T: t <em>*Exclude pages which you don't want to show on the header navigation</em>",
# W/ d: z2 p% \2 A; k- @2 F7 ` "id" => $shortname."_header_page_navigation",
$ f& [# E' ~$ p$ p9 `- x+ i "type" => "text",
- I5 w: D2 m: T1 ^ "std" => "",
+ r% R0 w, O$ C2 ]. r; R8 y ),& H3 t% r# @, R9 H
# ^* e' {: p% S4 j2 H- G array( "name" => "</div></div>",
! \! f& t- S! a# Z* S "type" => "close",! j8 D5 M8 u5 i
),5 g- @+ c5 `) u* O% v
7 R+ S5 J0 t* I3 i7 y! ?
# a8 n, j+ ~# C
array( "name" => "Post Auto Thumbnails Settings",4 z: Y( d5 \" x, L0 b
"type" => "heading",
* K- @% o: m! B/ @' K ),
. T. b- c' i/ ]0 W9 k( \0 l+ f
5 q% n5 ?0 J, [, h array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
% J& _3 j! ^- v9 A: @$ V. G "id" => $shortname."_timthumb_activate",6 d' I& {/ S% Z
"type" => "select",
( r0 }6 ~: ]1 d "std" => "No"," q5 z; {5 C2 V% m8 I4 N& {5 ^
"options" => array("No", "Yes")),
! y" B' m7 T% ^( H( D3 z
1 r4 r B1 }* Z# `+ Q: g. a array( "name" => "If Timthumb is enabled, Please choose its cropping method"," f; i; h4 E0 B2 E' r0 ~, B
"id" => $shortname."_timthumb_cropping"," j i- [) t5 u' i& X, R. N# K3 s
"type" => "select",4 B$ N, w6 ^. I- p
"std" => "",9 H% H/ e7 ~/ }. W! p+ j7 S
"options" => $crop_position),
; |. b& s0 V+ P% W, i9 \& _0 `0 t+ E
array( "name" => "Insert Width Of Thumbnail Image<br />
9 N1 Z6 r5 l0 F! |1 T( V$ N7 K <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br /># L& I9 P8 \, d: I' E+ J3 c. b' x
<em>*Leave Blank To Use Default: 250</em><br />",% |: L9 @$ Y2 h: Q
"id" => $shortname."_thumb_width",' ~- a( W6 m2 H V- ] T
"type" => "text",
/ m; L0 k: i4 _ "std" => "",
& u n9 {+ H) O ),; t4 c. ^6 h% @" [2 [; [2 l6 Q
9 y( l) t6 s: T ~, P. [6 V array( "name" => "Insert Height Of Thumbnail Image<br />
9 r5 M! h# I/ }0 g <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
+ R) c1 b+ f; y, k0 v7 B0 T/ [ <em>*Leave Blank To Use Default: 200</em><br />",
* n' n/ R( l5 h n# y5 ` "id" => $shortname."_thumb_height",
, ]0 E9 k, I4 h+ n: @ "type" => "text",+ }: I; \, i! n& }+ b" S! ^! x
"std" => "",
/ Q4 } i/ ~9 q ),+ o$ A3 e/ m7 s
" Y. a0 V& H! w& E$ ^: u3 ~ array( "name" => "</div></div>",& S4 ]3 l9 U5 ~( c5 L" ]# k7 \8 O
"type" => "close",: j' o! m$ g; D; B$ C- g0 J2 H
),
, A1 x7 W% I. C6 I7 i
- ?; ? Q3 V I5 [ array( "name" => "Featured Content Slider Settings",% m4 p7 l" H. T, L; s* c
"type" => "heading",1 ^) k* L) r- k+ o( o9 N; @) \
),
. l$ y" J+ }! S6 D3 D3 [, G
/ ?/ v" X; V1 W array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
: ?, G. z' i# p/ r; t5 J; G7 P0 _ "id" => $shortname."_featured_activate",+ k: q: v! ]( C3 |2 _# m5 D
"type" => "select",' w* q, a$ }" ^2 `: @
"std" => "No",
: ?$ d9 ]+ C$ Y& |7 o" j$ t8 |; ~" } "options" => array("No", "Yes")),1 d7 q6 f8 z2 C) \; F/ T
0 F0 n4 y: o3 [- a( J( o
7 |6 C) \7 _, P# H array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
) ~; n4 h' V" q "id" => $shortname."_featured_category",- P4 R7 T: b# x+ ^* x- y; \1 S
"type" => "select",; E) L' }4 C' \5 X* D9 Q
"std" => "Choose a category:",
+ w( B; `; @- z3 ]+ I) V" k* E1 J; M "options" => $wp_getcat),/ o' S7 Y; P. \' z0 F1 q J' [
7 z, e& F" f; ^8 O2 u array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
6 v) b+ r# T" `# X; \& {! i0 d1 M "id" => $shortname."_featured_number",) D- a7 ?" X( o( p
"type" => "select",
! M0 ?" o5 C) z: P+ N% Z* D "std" => "Number of post:",) D( x7 k8 k6 ?2 E/ Z; S0 `
"options" => $number_entries),
; E( `; a* O7 a4 p9 b! V3 H7 q( a$ U2 r" T
array( "name" => "</div></div>",1 e/ b" E j1 A* _& ~4 z4 }; l
"type" => "close",
" _, d' Q6 M6 S- u( w. i ),
: |# H4 `7 a; r
/ R G" X- l8 [! U array( "name" => "Featured Category Settings",
' I* g3 e3 z4 H- _) k. ~% f" p% q "type" => "heading",& y! T! A. v- Z
),
& H! P" ?; \) d7 C. y# \( G, X R# K
' R# N+ Y4 C# V) o7 r array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
! X' c. O6 K! k3 A "id" => $shortname."_featured_category_activate",
8 X! V1 E' ]* I+ x) x "type" => "select",0 R' r% m. Y4 p1 h
"std" => "No",
& e: }5 b* j( R7 c Z: \* N" `# { "options" => array("No", "Yes")),
& w4 j; V( D' \# V( ~
' ~! | p8 E2 O! K; U array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",0 G6 |+ t2 _& E! F
"id" => $shortname."_featured_category_id1",) s( \: k, o: b" Z
"type" => "select",
1 e2 s! s; @4 k; b2 i( e6 Z0 N "std" => "Choose a category:"," {6 ~3 R9 s4 t6 E" |! T& N- C
"options" => $wp_getcat),4 O; U+ y0 P0 D, P% n
- n. G3 Q# E' U+ j5 P! B6 N" f array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
" j& T& }; E$ n9 d" E# b" B# O "id" => $shortname."_featured_number1",
+ f) N$ X* L' C3 w q+ P+ n. n* u "type" => "select",6 C K! s& F* L1 g5 R7 v+ q
"std" => "Number of post:",7 ~" ]& M8 Y) N, `& O q) M
"options" => $number_entries),/ U, i) e1 C8 x+ r! V5 o# a
3 ~+ G6 H0 f+ f" {/ a array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",# G! y# X+ s b6 A2 h5 ~" D
"id" => $shortname."_featured_category_id2",
! Q( W& d f7 A0 G8 D8 e "type" => "select",; i! _5 C. e7 M8 H! ?' f
"std" => "Choose a category:",9 |" Q5 e$ K5 W
"options" => $wp_getcat),* n3 q. [0 T. ?# }) V9 E
; o. \& d0 C5 T$ j8 H; [8 n
array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",- y) s0 u% i: k: h' S/ U
"id" => $shortname."_featured_number2",
, b. w2 p; P/ ~# z "type" => "select",# N( i+ x7 n; h |) G1 @; X2 u% E
"std" => "Number of post:",- r# r% v5 \' M% |7 F1 I( d
"options" => $number_entries),
# i7 b, N" N& P" t 7 N$ k/ S6 X1 }2 d3 U
. r) w' S Y- [* l9 R) z. Q array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",6 S- M7 ?: G5 S$ @8 C: X1 r
"id" => $shortname."_featured_category_id3",6 \4 F- W0 @$ `1 i: P$ x; H, H
"type" => "select",
7 Y$ Q' @" g' @- v' x "std" => "Choose a category:",4 L" ^& Z4 A8 o, }; o I
"options" => $wp_getcat),
4 m8 l+ R5 U4 Y$ a4 S" I " d0 z0 z( O# S
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
% D5 t8 _- U$ r& \% |* Y" v6 X "id" => $shortname."_featured_number3",
0 }% D. E& K; t "type" => "select",
! K& F, c% q! I, W0 w) m* T "std" => "Number of post:",
6 r) ^ R3 G! c3 L- C) Z0 r+ ~- ^* {% ? "options" => $number_entries),1 c; f1 i T3 w( m7 A3 a
& h# g5 g: d! m0 R& W
5 w/ |6 R, {' M. d* c- K* z$ J* _( G array( "name" => "</div></div>",# k& p) x* p# V! ^- E E& Q7 ~
"type" => "close",
# E7 y b m4 N# c8 f8 W8 {1 a ),. `) K+ ~& H/ c/ g: t- J
( V2 _; s# p# i4 f$ _( l" x, b" b- X3 O+ N
array( "name" => "Google Adsense & Analytics Settings",& l% Y8 k, |9 u- e& E' U z
"type" => "heading",: I( s# J6 P% l: \* R. }
),8 ~6 @& Q/ |5 }, [* t8 i
9 e5 v8 J/ C; q array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",& ^& \; s0 X- B
"id" => $shortname."_adsense_loop_activate",
/ i# w4 }* g' } o: b" A "type" => "select",
2 g* @' T3 T8 ~9 s, W- o "std" => "Disable",. }/ x% k% r5 \
"options" => array("Disable", "Enable")),5 P% I' N# s% B% P8 G3 E) F$ a9 C
! x: D- }9 ?) B% b array( "name" => "Insert Google Adsense Code For Loops Here<br />
; x1 f: K3 X! w: s+ f7 @ <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
. `3 X, l+ R/ M5 }! R# a n' c- G "id" => $shortname."_adsense_loop",: g5 { h/ F8 Z7 u
"type" => "textarea",4 Z/ v1 D$ D% R
"std" => "",! _/ V6 A. \) V+ V! `2 G8 x# A
),
! v% h$ b2 b/ m) ?( m4 K3 X2 P9 l7 w% g# U+ Z/ H. S
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",/ V: ]5 R1 v4 Z
"id" => $shortname."_adsense_single_activate",7 T, m# J) S! _2 u, H) E t
"type" => "select",
3 w5 W) c, w7 I: J- s) T. ]" j "std" => "Disable",4 a4 l% x) n" M* V) H
"options" => array("Disable", "Enable")),
0 t6 H4 ~; i {, p1 B* x
. C" D4 `1 {, _3 |6 U6 } array( "name" => "Insert Google Adsense Code For Single Page Here<br />- A; v6 I4 {) Z2 _+ c
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",; `7 q: D3 s0 G1 f' e
"id" => $shortname."_adsense_single",: L; {5 ~5 L9 y* ^
"type" => "textarea",6 D9 J; W7 K, Q/ V
"std" => ""," e% r0 k+ L0 e2 D2 ?7 A
),. ?9 D/ D% ?, R$ v
# v# h' f9 |2 I1 @6 u+ u& c+ t
# P6 z4 F+ K' c# |; ~+ k: U
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",1 D; P7 t! J7 `8 Q* C: Z; W
"id" => $shortname."_google_analytics",/ j8 t5 L/ z4 F# |
"type" => "textarea"," }9 _6 j. s( P: n
"std" => "",+ ~3 _3 L* h6 y9 Z* w& [
),: B* [$ U& Y( [6 Q. u* G
$ t( q2 {$ j* V& r array( "name" => "</div></div>",
. V; r, J5 N* ?" H/ r "type" => "close",$ H4 o( Y" T$ i3 ]0 V$ {
),9 v! W8 \) W4 v7 \) h) u0 n1 a+ K
! }6 W/ H8 |3 @
' U1 }, a7 [' b* O, m array( "name" => "AddThis Social Bookmarking Settings",
0 C B( |* n+ ~7 h4 L4 E! z "type" => "heading",
: Y P$ E0 J# k( \# x( ] `9 d7 x ),
+ N' y: c3 \; l8 A2 r6 w
9 p! B# _3 J- `+ u9 n array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
! Y o$ q- R( ?3 f1 r* K3 o <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
) G2 H! q' G7 B$ ~- M "id" => $shortname."_addthis", Y1 y( G1 r1 W" ^% ^4 t. m* v/ N( r
"type" => "text",
1 Q* Q% A) A a* @& q "box" => "social",
6 K8 [; @, D J1 \+ a! [# S "std" => "",
+ M* c6 W$ J j) ^; n ),% T$ o$ t: H* J) K
" ^: e) c3 j& m P2 C% b# ^, g' z
array( "name" => "</div></div>",9 b- w7 K; v7 W7 D1 I* d+ j* z
"type" => "close", R n. I6 p8 N: h% G; ?' R7 N
), V" \! d' Y8 P7 [
, S) k) `3 U5 A
) e% P! N, o" \3 R
% \6 @+ f3 j! `" W array( "name" => "YouTube Video Settings",7 r% L& ^ f4 U4 c1 k
"type" => "heading",% @& ^- D2 ?0 @! |5 R0 @; V' w0 l
),
* \& J* [# W" y) m" Q) }- W3 g9 [3 Y7 v: R/ D
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",4 z9 r9 v) w& E% L$ N, G5 U- C
"id" => $shortname."_emvideo_activate",
2 U; u7 J( Y7 \" F9 J "type" => "select",
8 ?% f; y5 I0 @ I6 S; P9 V* l "std" => "No",
* K! P$ j* I% i/ c( F; H$ ^" J3 B$ ~$ s "options" => array("No", "Yes")),
( v% H* s4 V$ d8 @
/ E4 p9 I0 R2 j1 y( `8 A6 B array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>",! K% W1 l X" L4 s" G
"id" => $shortname."_emvideo",
2 M. r f5 `- \ "std" => "",* B. Z6 s0 d$ R: Q: P
"type" => "text"),2 v, j8 E" c- M# D6 _. j8 s4 }
* K( V: ]( O# J. @8 v# ]
array( "name" => "</div></div>",
+ C" T( @2 H3 j* _ "type" => "close",
/ `+ M; R( p' L ),
- L3 ]# K$ O7 O7 E0 k5 m k
2 j* w& x1 C# @/ q# ]% Q) t array( "name" => "Twitter Settings",
: W' t" Z$ }, s "type" => "heading",& |% ]/ h3 _$ N& x$ s
),
+ R, x: `6 i% @, o- m0 u% g8 o( D' V8 H# P
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
4 v' d Z5 T a, S "id" => $shortname."_twitter_activate",: Z$ {- d" f% n2 \
"type" => "select",& ?* j$ `" i( R8 [, [# e* m( K
"std" => "No",
9 T. v, s- `0 r, G- l, j "options" => array("No", "Yes")),
. @0 Z! G' x" g0 u& ?: c
# _. H2 ]; M+ w8 T2 t array( "name" => "Insert Your Twitter ID here
& H, [. N" Z2 q8 _3 I! v <br /><em>*leave blank if not necessary</em>
( g/ y) f9 `" J0 N <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
8 ?% U% `! C0 F* i6 {. G+ ?: ]; J "id" => $shortname."_twitter",
4 W* z. d5 @7 l) V% r "type" => "text",3 v1 G% J6 h4 S* |( S/ x* B f
"box" => "social",6 b" f @, C F9 ?0 J. K; x
"std" => "",
9 Z& s- b/ y' }0 P ),
) S8 i( j8 G; y' J, O
3 w& `+ K* y( C5 Y0 V+ z9 _, y0 k3 ~ array( "name" => "Enter Twitter Feed Count here) Q& v' x4 e1 c0 I
<br /><em>*leave blank if not necessary</em>) s" D; [) g5 x9 ?; v# G' j4 C l
<br /><em>*Enter How Many Twitter Feed To Display</em>",
- R6 u) S9 s2 p! j/ ]. Q- Y' V "id" => $shortname."_twitter_count",
8 w0 y. g$ Q1 i0 E# g2 h4 D "type" => "text",
: z: I* H6 `* T# V "box" => "social",- ^/ \3 Z3 T, ]9 R8 n( s- Y _
"std" => "",
- a/ O$ n2 G0 ^ N% ? ),7 n: Z' `# ?; q7 k- H8 ]; Y
% J7 e# F: [% b1 A
array( "name" => "</div></div>",
& v: b7 O H7 M: p$ i "type" => "close",% \0 Y2 E! V* l1 ?( H9 T, u
),
9 u) w6 [7 \) P4 o0 I5 s' }9 Z
& A# ]6 @8 a& U* j2 p
# g8 h1 r5 g) W, O% d- B array( "name" => "125 x 125 Banners Advertisement Settings",
' j6 ]: C& ]4 |2 a, f) J' A5 k, C "type" => "heading",
/ s3 k- @* G8 E& D1 x( } p; s ),
$ `4 q+ E% t% N: i1 u v 6 F0 s* [% H3 ]: x! M! d! I" Z
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
1 }5 X; p/ }: \ "id" => $shortname."_sponsor_activate",
/ U. O; I' B! [! d5 k "type" => "select",
5 g T5 F) m/ T4 ]' S2 ~ I: l "std" => "No",/ C" X/ }+ s8 g" ?2 ]5 g
"options" => array("No", "Yes")),
: u+ S. y$ d% l2 o8 q
+ u1 }; @7 Q9 I1 w+ I
u, I* |, D, ~ array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>", \; h8 A* T# W0 d5 |$ i! h, ?
"id" => $shortname."_sponsor_banner_one",
; u! e6 {8 z9 [1 n "type" => "textarea",
- w3 r7 l* @- X, ` "std" => "",) v: r0 S @5 U$ c) f- T3 _
), . H7 ]- G. [ q% X
& E: f9 |' Z" [- r w
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
, H* b$ d* g; o( f/ s "id" => $shortname."_sponsor_banner_two",
/ Y2 ^5 ?* i$ X# j "type" => "textarea",
4 \) y" S' W Z! `0 p7 c( o! s "std" => "",
. s& y2 {/ S. } ),: v, i% h0 }4 V1 E: ?# y
! B( ]% w- q+ n3 ?
array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
! P- _4 T {3 Z% h "id" => $shortname."_sponsor_banner_three",# P& v/ J. J b0 ~
"type" => "textarea",
) U: q) D# L; w+ t) _) e" g3 l8 n4 @ a "std" => "",$ J1 i( }2 r( X; V* M1 C
),
3 {1 ~7 `6 {% f; m0 K' [( T$ y6 a
; R* V3 e- W. Q: R4 k. _ array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",+ E4 T7 a6 T. L- x/ |8 n
"id" => $shortname."_sponsor_banner_four",7 e1 w$ M. i. b
"type" => "textarea",
3 P, \" @! h5 \& p1 Z "std" => "",/ f/ i0 b# W, T- V8 x
),, z/ x- r. m# s j8 K6 {3 j
! S; n l4 X3 p( a( l# k array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",7 @: t8 D- z5 e1 m9 E0 e" c
"id" => $shortname."_sponsor_banner_five",2 r" y' B5 K& }; j' [
"type" => "textarea",& q# c/ {& h6 B
"std" => "",
0 {4 M+ ~! j8 v" d* s; d$ L ),
5 a; I) i8 i' V3 K V6 N! r! B9 d1 C5 X3 {: }9 z9 W
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
* t3 h: n9 y1 D "id" => $shortname."_sponsor_banner_six",
# c- P( t& U' `: L% {; I& V& j; L0 S "type" => "textarea",5 ?$ u4 ]$ v& ~/ i' u" V) C+ _% P
"std" => "",6 z& j3 X" J' F8 L. l
),
1 L$ V8 i* E4 i. P* a1 F3 A- ~9 ]& \2 L- S" y) U- k0 z* T3 Z
array( "name" => "</div></div>",
/ s7 G$ L0 _! Y9 u6 f "type" => "close",* p4 g! n. a/ M# b0 ^* J, Y( F
),
0 h6 \1 N. C2 n/ N% h5 m( k
; z" q5 I0 j2 g1 {) K6 e: {+ r/ R" x, \
; j2 m7 T r: F( |4 p. a, @
);
. T' \1 B2 U! V* f6 h9 y$ R2 {- I1 t
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
; j- F2 h7 E' u+ w
; Y, W6 f2 G* n/ B- Techo "<div id=\"admin-options\"> ";
) G2 c) j r! \8 h! E( V- \
5 h9 h7 I( R* l$ ^: lglobal $themename, $shortname, $options;
6 W* `$ ]5 `" k8 Jif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';* d7 [5 C9 H4 C
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';0 d b8 q5 }4 M4 W& \/ }5 X! s( _1 C( h
?>/ S' [$ @8 g; w* p3 f7 n. U; d6 m+ h
4 |8 F- p# S% N5 n<h4><?php echo "$themename"; ?> Theme Options</h4>
; i/ x# {1 n9 ?9 S$ ?' \$ R7 q9 g) y; B3 m# o
<div class="annouce">% | l6 F P7 y* u! j
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
% n+ `7 T; u9 d" n/ X# Q<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>; M+ G$ W2 n" k! X
</div>
# E' Z$ P# \4 s6 ~# J& z2 N
6 T6 C3 ~* e/ L- a- s<form action="" method="post">
) B0 B$ r \: J7 _- I0 N, `" K3 f' `% `) K& L* N9 Z
<?php foreach ($options as $value) { ?>
3 l- u* S# w8 e/ k! T6 N5 b
7 J, o N1 e2 S: z" [; _" R<?php switch ( $value['type'] ) { case 'heading': ?>
: z5 O8 |5 Y3 N+ Q
3 Z; Q8 z' H" R7 q<div class="get-option">, m1 j9 l) {- b! V- K( r+ E
3 s# H: F- m9 n<h2><?php echo $value['name']; ?></h2>! h& O( ~: H( m$ p
" v4 k3 A6 x+ L$ B0 }6 c" [<div class="option-save">
) Y! w- Z% z& ?6 K& Y9 @# n* d% p5 k8 |1 l
<?php
% O, n, H) _4 _9 e Lbreak;2 l' p4 J2 c3 x! A- N0 g0 Q M
case 'text':2 e: C/ Q& O2 u7 J7 R
?>
) c8 J! Y: ^, j: i r$ t R+ v* p/ y" b/ ~
<div class="description"><?php echo $value['name']; ?></div>" D: D; r/ v7 w9 ~
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (- E" M' }5 S5 F5 M1 z
. s4 [. [# U8 Lget_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>
4 H( ~7 {* s; t7 ~% O9 Y
+ o. b5 a" B- J# r9 G<?php
/ l2 ]; z7 C) @' U6 K$ Xbreak;
( b3 S$ g+ T0 W3 U# u/ gcase 'select':
& O* O# H6 `& i% f. c5 p?>
9 `" P7 {( n! u' [9 e* d
, e, V' A* q- x# q" i& @! }- e# L6 F7 r<div class="description"><?php echo $value['name']; ?></div>; J9 Y0 ~# E9 U$ V- `7 |
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">; m" C' y. c5 z F! V
<?php foreach ($value['options'] as $option) { ?>
8 q/ T, P) U$ `2 R# i: @2 N<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>
7 q! ]5 O6 x6 K+ a6 j Y6 Z2 a<?php } ?>
. N9 z8 T% H& u& S& F; G, u</select>0 q; V5 e; v, X2 g& a" S* ~
</p>) w/ ^ Z3 A9 \ {
0 ^; U; P) H0 n<?php9 c/ B* ?. g2 E' o6 n( u& r6 b* Y/ o
break;2 I: K& d! D* w
case 'textarea':4 N( X/ X* T) c4 q: z2 x1 u
$valuex = $value['id'];
! w/ q, s5 j( x; @% @$valuey = stripslashes($valuex);; Y5 S# N7 W9 _! O8 Y) R" H
$video_code = get_settings($valuey);. I8 m- D! X/ l/ r+ {/ L
?>
/ ], s& p- i- B& H( b7 O2 H* R7 Y
/ D# Z; q x9 g<div class="description"><?php echo $value['name']; ?></div>8 ~! l5 E1 M# C5 | |
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
' ]& e4 n# R, r# c8 [ i
. V1 I6 C( _3 A W. ^* \0 helse { echo $value['std']; } ?></textarea></p>
/ `! E: x" h( ^) J! S0 w) D) p" @* V4 j$ X: ] }" x* k
<?php
$ `7 V5 k0 D5 j9 Abreak;
! Z% l. \; q$ t7 |8 M- N; Scase 'close':
0 i5 ?9 n _! {0 D, z: p6 K?>
( [7 s. a1 K2 `- o; o o0 c
% ~( f8 B1 |* w( X' i1 M<div class="clearfix"></div>
) \1 I' D! O9 H# V</div><!-- OPTION SAVE END --># H- G- z# K. K; {. k5 B% m
& _3 h% ^4 E& J. Z- M
<div class="clearfix"></div>, c" S* z% ~" S9 h) X
</div><!-- GET OPTION END -->
3 j* o1 B1 ?' ]+ p+ B
2 U; Y: V. _3 G6 h<?php
- ]& z! ?1 n' f6 V& rbreak;
* z. k+ w! Y" L8 [- c6 \default;# y4 @. o, P; h+ ~3 S. d$ d
?>4 z( P& D3 V- m
; I ?: P( O. w
! Z+ X0 L! c, G/ q% |/ y
<?php
: V3 |- A* ?; n/ u% v7 pbreak; } ?>
/ B3 |3 G$ v3 G& J) H6 ^
1 Q/ w0 @8 k3 A+ Y* Z<?php } ?>$ a. E3 Z& o G$ z6 M5 z* {( Y* Q7 e7 K9 t
) K t4 q! c6 x5 _8 U0 ~# d8 }" Q7 `<p class="save-p">1 S7 ~2 q% ^# ], k6 k5 L
<input name="save" type="submit" class="sbutton" value="Save Options" />9 `, V ~( w7 w4 U
<input type="hidden" name="action" value="save" />
$ }7 s) ~ |# f# p) A</p>. h' ]! c7 t: ~, e, t8 L1 a8 w" v
</form>
& K9 r: y) j7 G8 ]: H% Z: I! c
. t& q* E2 D1 P% H+ s% O; x7 }* {<form method="post">! ]. O6 U; j1 p: z4 s
<p class="save-p">
W1 K9 x3 ^# f<input name="reset" type="submit" class="sbutton" value="Reset Options" />- [1 e0 ~8 T7 c+ N3 W. E
<input type="hidden" name="action" value="reset" />$ D! y: H; p! Q/ x
</p>/ s# j/ d8 k& {0 \
</form> w# T z/ ^ d* w3 n
5 x+ u1 Q3 \+ r# L3 j( K! O' ^' k
</div><!-- ADMIN OPTIONS END -->: N* ^+ W7 _( z1 \
, ~' h/ U/ _2 y& [! b5 C+ x Z
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }/ C9 m8 @. g5 \/ W$ L2 x- N
* l8 B) \9 P6 k2 a# |/ c9 Wfunction mytheme_admin_register() {$ D8 N5 R0 o; c q1 p$ H2 _
global $themename, $shortname, $options;) g$ Z0 T+ \" {) s, m. z. g7 x. I
if ( $_GET['page'] == basename(__FILE__) ) {
; ^! u, M+ Q/ h+ X' b; X" \if ( 'save' == $_REQUEST['action'] ) {, _. d3 v1 K1 W. a8 }2 d* _ h
foreach ($options as $value) {
& c9 h ]/ ~6 B+ y J& X) Z! Qupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
+ F- q; ?* y, z5 h1 M1 X0 ^) Bforeach ($options as $value) {
$ k( d( |( X; D+ Z k: ?if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }# }- M, H3 x, v7 P4 [/ T
header("Location: themes.php?page=functions.php&saved=true");2 X! b& {' w E4 T& h% P
die;* l5 c' M+ k# ~: N1 d. E6 J- ~. f
} else if( 'reset' == $_REQUEST['action'] ) {
; ~/ P% [& ^$ U, e* E( pforeach ($options as $value) {( g' r+ |5 d: U% r8 H9 f6 [
delete_option( $value['id'] ); }
5 _2 h6 I1 l4 W4 P1 _; Zheader("Location: themes.php?page=functions.php&reset=true");' M1 g9 n1 ~" g* S- z( E; e
die;7 H4 w: ^8 H8 l' [6 p) \4 @
}
/ ?0 l) y n" v. p" Z& Y}
! o# J: S. c( w3 `# Padd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');8 k. ~ |' }2 k; q: d& n4 |: E
}
B( y; y3 Q$ d. S& k0 e9 ?
k* p! Q$ \! z6 g) ?2 @function mytheme_admin_head() { ?>* @! L" d5 t& T5 c) J
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
% R9 ]. ^0 F; e6 l, f* {& I: E<?php }
9 c+ [8 R; o5 C: I2 u, e |
|