|
|

楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////0 E/ Y! D9 w, n
// Theme Option4 N9 A5 B) g3 x( r5 h
////////////////////////////////////////////////////////////////////////////////$ P ~2 i6 }: k: W* V2 {& G0 ]
, B; Z5 a% |9 c1 g1 A K$themename = "Zenx";
; E7 a$ q% ]6 N0 T4 S$shortname = str_replace(' ', '_', strtolower($themename));
- s" g( z' @0 }
7 K( A% b' H+ i" \# h! j% R dfunction get_theme_option($option)
; F; U# }( b! j. i$ H* P{
4 R* {8 ]0 ?8 T7 U, i global $shortname;" c* a2 \; T1 V! N: r
return stripslashes(get_option($shortname . '_' . $option));
* B( }9 ~. I; H! Q( J}2 n9 W* t U4 U
1 S, S0 a* |1 Z1 T! tfunction get_theme_settings($option)
& p! Q; L: c$ j5 K+ K3 n{
5 ?, c1 G& t A0 O# f+ M( i return stripslashes(get_option($option));) a1 s, ~7 G! f0 V3 ?
}
/ h6 N) G0 t4 u; j N' |$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");! V8 ?" `( x7 y4 J7 n. v$ D
$wp_getcat = array();! `+ l$ a0 J: r. d
foreach ($wp_dropdown_rd_admin as $category_list) {; h7 j8 o/ f3 W# [
$wp_getcat[$category_list->term_id] = $category_list->name;
9 W" i: F& Y0 [}
3 q: }& w8 b& l$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
* M/ L! h* V1 t$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
4 J1 I. U) J* ?: e9 o# y% s$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");
9 q3 n: K* p+ w9 M5 [# v/ e5 B" J) {5 o
$options = array (" h) C" X- `0 J+ e5 ^
+ |* ^( {: z4 E( x) a4 |% g, U: ]3 y
array( "name" => "Blog Header Settings",4 c7 ?( J3 x# A$ n r
"type" => "heading",
, @; {# P) P2 K% I1 ~# f4 l; I ),# H) h/ {0 S4 m
! X/ H8 x2 u) m2 ?) _0 s array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
8 I: V$ s _+ b2 g" h5 K "id" => $shortname."_header_logo_activate",
7 ^7 @& D. Q( U7 _5 Z8 Z "type" => "select",/ @8 A, a+ ~6 [0 F$ q) g# `( S6 l2 J
"std" => "No",) @' W+ |, l& K
"options" => array("No", "Yes")),. \6 u' H7 h7 h; L0 _: C3 \
; C7 Z+ }1 h5 i( a* z) o& f# D) Z array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",! B |: M2 I7 T: R
"id" => $shortname."_logo_url",
8 U: m) J0 }6 N8 a* { "type" => "text",! }4 d2 E' K, B1 q2 _, G4 B
"box" => "social",# ]4 l5 j1 Y! D, K9 U) I* S
"std" => "",1 `9 l3 N6 ^6 g, z
),
5 [) Q/ b( U( V0 \ 7 c6 l9 T! K0 B9 Y+ w4 d
array( "name" => "Insert Header Banner HTML Code (Header)
8 {& k' x' B7 J3 C+ M( D <br /><em>*Recommended Size 468 x 60</em>
: ~' ~. {8 V4 o: k <br /><em>*leave blank if not use</em>",2 Y5 [6 a% R8 U4 S
"id" => $shortname."_header_banner",( H% I5 `6 f( U! Y) d; R
"type" => "textarea",, j2 f, [7 l0 {$ G, d# n
"std" => "",
3 o0 ]( ~: I }* z" @. M ),. ~; ~ p8 r2 U" {1 x5 A
. C! r+ i- q# o U1 {' H! U array( "name" => "</div></div>",
1 o: q3 O. m" | "type" => "close",+ A6 T ]6 ^& u
),
& C3 E; e6 _- _2 {" G: D1 r" v' ]6 N# Q. E0 ~5 m2 V+ m
7 Y4 o0 u- k# C# j, V1 j array( "name" => "Header Navigation Settings",
7 u$ X; n8 M( V3 v! y1 Z5 {5 a "type" => "heading",
# ~% q3 l+ ]) O ),# ]# b6 _: F- d
! [3 m& ^8 p; t1 H1 _3 R array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
( F P0 D; p6 k <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
" K" s$ y; W, f! I& `5 P4 W M <em>*Enter the page post ID number only</em><br />8 `9 m9 J+ s2 F4 @( p- |4 }/ {' @
<em>*separate by comma</em><br />
* A: M4 g4 X3 Y1 Q <em>*Exclude pages which you don't want to show on the header navigation</em>",6 M# O/ C, D/ K7 K6 R
"id" => $shortname."_header_page_navigation",
" k& v4 C# a; V) U% G6 S: G8 M! s( E "type" => "text",$ \* m$ m4 O, ~
"std" => "",
/ s' |' `- m, k ),* `* ?. d7 a6 D& a {$ y# Q# U7 o
& m1 O3 F: V6 e& W/ h3 b9 g c* c7 Y array( "name" => "</div></div>",
2 B# x! b' l0 a U6 ~1 d0 S "type" => "close",
0 \( O' Y5 A5 ^ q$ K ),% V h) k% o" P
1 j, D! b/ U, [7 ~8 v: e5 C! g7 i/ u
array( "name" => "Post Auto Thumbnails Settings",
^! K' h% m4 { "type" => "heading",. q G$ i# o0 }
),, V6 i' t# W5 C- G* B7 A
# B- I2 R, R1 t/ c c array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>", E2 N/ u* D9 n; u% Z A3 B
"id" => $shortname."_timthumb_activate",0 i" r+ x9 O4 S( |( ]) j* L
"type" => "select",
3 n. K) Z: I$ c8 b& O+ Y "std" => "No",
& C) J6 \; E: Y0 C5 [ "options" => array("No", "Yes")),' ?. A8 E: E1 B- M* F( S
+ _; ^& `" o9 I, _! F- M7 P) {
array( "name" => "If Timthumb is enabled, Please choose its cropping method",
! F. M2 K0 k I! W5 l5 | "id" => $shortname."_timthumb_cropping",
1 a6 L2 u" n4 d2 A- p/ s "type" => "select",
5 |1 w% F( i s4 Z3 Z "std" => "",; z+ ^0 U2 S$ l$ O/ ?" U% Z
"options" => $crop_position),, z5 D8 V7 O$ p0 y6 e& P
/ C9 b7 W! B9 t a6 B array( "name" => "Insert Width Of Thumbnail Image<br />4 D2 t, }" `# ]& q) W& e
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />- u0 q" R4 K! ?7 n1 F
<em>*Leave Blank To Use Default: 250</em><br />",9 x2 Z. V: W. O& y( u5 t2 P* L
"id" => $shortname."_thumb_width",4 a; n' R" y1 D3 ]& E0 f9 T$ [
"type" => "text",
" U; p1 @% C; v "std" => "",/ g1 ^4 L: ^: W' A2 l. |: l
),
5 h; q9 K, A9 W! F" j
- q* P) J3 n7 x, I0 T' X- l array( "name" => "Insert Height Of Thumbnail Image<br />
9 p" l2 T& P1 \! v5 ^0 A$ N. A6 m <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
9 w2 Z" Q7 N% k6 R5 J% _- p- Q <em>*Leave Blank To Use Default: 200</em><br />",1 g) I( m6 n q" T
"id" => $shortname."_thumb_height",
6 R, W, `* }4 w "type" => "text",; h) C, `1 l {3 J0 R* l7 y
"std" => "",( W& v0 n7 e F% E* Y ~
),0 {: V3 c1 W4 ?4 p. ]
h, m: r" V5 u: F$ r/ h6 a; e array( "name" => "</div></div>"," n* S) W7 s( u! e! _2 X- i' O
"type" => "close",1 N/ c% W/ x5 ^% ~ `6 H3 u _# o% r
),
" E- Q( m3 F4 { a r3 r" Z/ S, U; e6 D2 m5 W# ]+ G% F. i
array( "name" => "Featured Content Slider Settings",0 Z2 C F1 y. M& \" N
"type" => "heading",
& G N! U, r! @: N ),+ Z8 i4 i& D& T4 F
8 O5 @/ F: U0 i! m' |, u" @. m& U array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>", H+ M+ G* n9 Y: L5 e W! R+ c% i
"id" => $shortname."_featured_activate",' h- b" f0 F2 e; T+ \7 i X
"type" => "select",4 ?, e5 d: ^/ m1 z2 i* \
"std" => "No",
5 X! V5 j/ k2 g8 q$ C: D "options" => array("No", "Yes")),
# Z6 q: D# y+ z
! |2 T' B3 Q* i5 Z& G
w* o& E' u {- Y/ q" C3 m array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",! z3 c, O& w4 u, t- i+ i1 K* e
"id" => $shortname."_featured_category",: ^( T3 D' L. A2 I1 s/ P7 p
"type" => "select",2 c* c! H! o" g- m# I( d
"std" => "Choose a category:",: Q# T1 i' n: n1 D, U; h
"options" => $wp_getcat),6 u4 g2 W0 ^3 M8 p/ V: H% L2 X( y( @
# n, K8 q' I" i# n+ `+ K" V array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
! y0 X2 _7 w9 U; j "id" => $shortname."_featured_number",( {% n% ^1 I6 V! z
"type" => "select"," ~0 @( o. Q+ ^8 g1 D4 t% A
"std" => "Number of post:",& w$ |7 Y+ Y* E
"options" => $number_entries),2 Z$ D8 k l/ N
- w+ S X# o' F# L' s1 j8 ]
array( "name" => "</div></div>",8 a5 v) m) u8 ~2 B) I
"type" => "close",: h! a4 |' |; ~3 Y4 u6 a3 D s6 _
),. ~; y; X" {3 P: ^: b G0 H4 V$ r1 w
* b+ t4 P) d* N* `
array( "name" => "Featured Category Settings",
# Y/ `( Z' j: c& J# b8 |8 \; g. k! j! _ "type" => "heading",
+ R$ p( V( Z, b7 v; J+ a3 l ),
8 u& f, F+ v; G* q
9 E( d0 Z. {; C! \( G. C) N array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",% x- w4 t! e9 B# {. \
"id" => $shortname."_featured_category_activate",
# _# V! I, F4 c; W- ^2 A5 @ "type" => "select",' `, Y% y, q5 B% O6 I
"std" => "No",
$ ]" z& p% w. j X "options" => array("No", "Yes")),
: `3 I7 ^' V4 q( c& O4 w6 k4 p
- v' P, Y7 T: F: k! F- N8 I8 R array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
) t; f" N0 j0 \1 k! U9 C "id" => $shortname."_featured_category_id1",$ L5 D; p) W3 u$ [. v- d
"type" => "select",/ H9 u; a, M& p1 ~0 W
"std" => "Choose a category:"," Y2 u! _) i {
"options" => $wp_getcat),) ?/ ]: h- x* b, N- S# W) w
0 f$ R! P! J3 q* C8 i/ T array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
: {% f- W# Y$ L* z$ T0 D "id" => $shortname."_featured_number1",5 b& ]. H K4 K: m7 f* T' c& H7 N
"type" => "select",3 ]8 t$ Z9 {. q3 _" c
"std" => "Number of post:",- l- y9 K0 F0 S4 r
"options" => $number_entries),
1 | e& h) {' ^$ B& g9 | . D( {' c( }* G# Q7 l* D0 ]# I7 P
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
! e" d' O* X! h3 ^, E7 h "id" => $shortname."_featured_category_id2",( @# R4 `1 p# \
"type" => "select",
1 c! O7 n/ N) f) |& j "std" => "Choose a category:",6 E& }8 E& y- J7 z% a
"options" => $wp_getcat),. c0 ]; J" K- n* F
. U! j, n2 u8 h2 q) I( T! I array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
# I$ n: e" j6 f+ W' N N "id" => $shortname."_featured_number2",2 i& V1 k: [# n4 A7 \( i9 p
"type" => "select",+ b0 c6 w5 i4 W2 ^% C
"std" => "Number of post:",7 c4 ?5 n2 N" g8 V
"options" => $number_entries),* N. N* G' b j2 I/ q
- t- [7 |0 H- U I" C
4 u0 I) u/ U9 B array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",* Y; L+ V; X( b3 P
"id" => $shortname."_featured_category_id3",9 F, A# U6 G1 A+ M& @; o: q
"type" => "select",0 M/ f- ~ A1 `6 I6 E! ]
"std" => "Choose a category:",
+ x( Q* r, n i' c' V6 f. ] "options" => $wp_getcat), U1 m. T; J+ q) U
2 j- {7 O; J( E1 F" M2 Z array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",7 b/ P+ }# g6 G8 T: @: N" d5 z* @
"id" => $shortname."_featured_number3",% _2 v/ ~% ]6 l% S
"type" => "select",0 I# m) k9 r6 @7 b
"std" => "Number of post:",5 r$ u" T% c4 [/ A0 n; D
"options" => $number_entries),
; I) [, s' H) _* e, D; o
; `3 ~' H' `+ {' g6 E" U' A7 i
2 m" t6 v) }" z1 V% O array( "name" => "</div></div>",) I# x- h: H0 m4 [
"type" => "close",7 v2 \( V! O- h, f# o5 J
),
5 O7 Z: f2 z; l7 q+ n3 |, t% k' R. X, P" a
. u# t! }0 {$ }/ D! K
array( "name" => "Google Adsense & Analytics Settings",4 l& t+ q6 ~/ d* b9 X3 u8 W
"type" => "heading"," Q5 K" r. A/ ^
),7 Z; o0 e7 i, p7 u
. J0 {( m; ]7 t' U4 @" B) `. ]" F array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",
' a9 x* ]! m0 U: x& K "id" => $shortname."_adsense_loop_activate",
# S) ] c' j7 Y/ T* ^% `( Y "type" => "select",
4 s& P" r, |6 v% ~ "std" => "Disable",
- V* O: J+ F0 X/ S; F "options" => array("Disable", "Enable")),! c0 y" Z" U) p" _4 u- A2 T
: C! h' S% }" Z5 h7 o7 x array( "name" => "Insert Google Adsense Code For Loops Here<br />
7 P" I5 ^! R0 w) z! [, l <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
0 H" E! @ z: j" E( J7 p "id" => $shortname."_adsense_loop",6 |, E' g7 d" t9 X( Z% B
"type" => "textarea",) A! p( D M( {' J/ M
"std" => "",% p( ?7 |6 v1 v1 ~, q; }2 A
),% P9 j$ s @* b$ S) O& O p
1 T' m; F! ]7 M! ]/ F2 Z$ W/ `
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
' a7 M# [* k! ] T "id" => $shortname."_adsense_single_activate",
. A5 x+ \1 l( m6 D4 l "type" => "select",$ s) j/ O x6 h2 d+ O$ o9 H) Q
"std" => "Disable",: ?/ q3 X% s: }+ A3 |# E" M, U
"options" => array("Disable", "Enable")),% A6 S% B! f- C( \0 ]2 [0 B0 Q- u5 X
8 l L# i& D9 S0 Z+ v0 D; ~1 ^
array( "name" => "Insert Google Adsense Code For Single Page Here<br />* K" q0 a* _# K9 }4 L2 E
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",: v6 v& X" I3 ]# A
"id" => $shortname."_adsense_single",7 W# _3 X1 S/ x! q( D0 g
"type" => "textarea", r8 }" L$ y0 d
"std" => "",) J, R- P! F7 v# [
),. a' X( U, `# c. F
" p( a( d2 z r
" s- g7 Y. @. Y# a9 D0 x4 C
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",6 E. L, N! `, j$ K& v( s' D
"id" => $shortname."_google_analytics",& w! c/ X: h j, J+ u8 V! u0 W
"type" => "textarea",
1 T1 ]6 x( S* `5 B: V! | "std" => "",
& u N5 h( j; C( J ),! M1 G2 Z; [. ~, P
: @! c; l! `2 i- a n/ P6 O array( "name" => "</div></div>",- c& t! ?2 {, {9 j+ d4 n% w
"type" => "close",
2 N6 U, v5 N. t+ {: Z ),
) y/ T# W9 a9 D5 Z, n$ ~/ y1 N7 ?# I: y , w* f7 S# P' M+ G2 ^4 q/ }+ J4 c
( h' } t) V8 m! X
array( "name" => "AddThis Social Bookmarking Settings",
8 m# I2 e! j8 p5 a# | {/ c2 m "type" => "heading",
: Q& H) ^0 {# u0 `* w5 j+ ^ ),
: v5 m: Q5 x( E. v& \+ z4 g$ s0 H
, k7 q$ O9 |1 `( l$ E array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
, T+ O: H G3 r9 s* U# R <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",1 o% m" k6 ]6 `0 o
"id" => $shortname."_addthis",7 R( R6 j+ c3 A7 f
"type" => "text",
- B/ ~ Z5 N' @! W" F "box" => "social",
( N# A, k2 w7 S( t: v3 w) [ "std" => "",
1 n, @$ X) O6 \4 ~- i! _ ),
7 H/ P! Y6 h4 D( q9 F2 K. K( p; b: p" z# C- v( x; v
array( "name" => "</div></div>",+ R7 M& D6 s! J% e% d
"type" => "close",$ }; B) O8 F) K9 h+ J
),
) Z( ^2 g) w7 ?( }( Z
( N3 K5 Q4 Q$ ?( I0 e 8 D2 F! T9 k2 s7 j4 K) S$ F
$ B) [/ I/ A+ p/ ]. u' o( l, b+ t$ L
array( "name" => "YouTube Video Settings",
) U: a" p" a4 Z5 w! h w- q% M: t "type" => "heading",7 j. s. `/ ^ m
),, t" `) |2 q3 ~( p& D
( O V# e/ i! R+ c [; J- M array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",5 h) H+ X; X$ s2 H* h" F y* O
"id" => $shortname."_emvideo_activate",
- }" z' D5 H3 V% d3 v/ _. q "type" => "select",
" D4 o' o1 J( ^0 l "std" => "No",$ Y5 w- e! h/ O$ D
"options" => array("No", "Yes")),
; S1 K; y+ U7 P
. ^0 F: @! }# m9 [ 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>",
, p% o( y/ _! q, ^, @; F "id" => $shortname."_emvideo",; V+ G" E0 ?9 l/ b8 G
"std" => "",. G1 A8 X6 l$ F T
"type" => "text"),6 j8 B* E4 ?/ k$ J7 Z; t3 s
3 A/ Z1 o" S5 N* U2 ^8 \/ r/ i array( "name" => "</div></div>",0 v0 |- P' m0 r6 @, L; p
"type" => "close",
/ {; w' D" E/ f, A1 n ),( ] r' k. ~( `* f& e. }+ K. q
3 I; d4 l- ~% V( s, T array( "name" => "Twitter Settings",% R- {' y" B0 Q; ?' k( I& _. F& |
"type" => "heading",3 t4 c/ Q7 M( ^
),
% o4 ?; ~; F: D# I( `4 V+ @. L& E9 D" y) y; {3 g
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",$ b4 X$ u. d7 Y, C/ @# N
"id" => $shortname."_twitter_activate",
# Z+ j& [8 p% M/ T; A "type" => "select",- a( T {* n! P( n
"std" => "No",
9 y4 ^) f9 W/ S. Z "options" => array("No", "Yes")),
% @& y+ H$ z7 K. L9 l- r" z6 u- f! j$ }9 a; W6 f
array( "name" => "Insert Your Twitter ID here
7 N9 r E N* p' V$ S( ~+ _ <br /><em>*leave blank if not necessary</em>
; f$ K+ i4 S6 I1 w <br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>", w1 h) ?2 j1 [, E; E8 n% c5 W
"id" => $shortname."_twitter",& X. x" J$ R0 Y$ x- U' l- c
"type" => "text",+ P; n; Q2 v2 @+ P) i: y
"box" => "social",
6 O* U$ I: [# R1 g* ~ "std" => "",
1 V" l- \8 t; h% l8 G ),
% d9 q& j' \5 i0 v! Q( d
+ ` D+ h! f0 |! T2 I array( "name" => "Enter Twitter Feed Count here: l q( W! n+ q( ^ `8 E+ w
<br /><em>*leave blank if not necessary</em>. ]* K) N4 U1 w+ e
<br /><em>*Enter How Many Twitter Feed To Display</em>",
1 v1 s/ x G" f% f( @! E "id" => $shortname."_twitter_count",
9 e& i. G9 ^! r "type" => "text",
x6 Y$ \9 u' K5 K) q5 G9 o "box" => "social",
) _+ s# ^4 Z* R9 `9 D- C. r* e "std" => "",9 t( e9 u, L) |1 r/ r
),
. l8 T: Z& q8 C5 b
' C9 s: A/ n8 _- t& ~' t array( "name" => "</div></div>",2 n; q0 O; W- c) {# p) M/ b
"type" => "close",0 i" q4 o& J, }9 b
),1 Z$ L k; [- z3 q/ W
7 p8 ?+ @2 G) K. E* Z' K) Z2 g- x2 c) d9 l3 `" \
array( "name" => "125 x 125 Banners Advertisement Settings",
% f5 H$ b; ^3 N. X9 j "type" => "heading",& j3 j& r# c/ f" q
),% l5 H8 b: c* h1 h5 \+ x3 s
; |2 Q, V" t, p array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",5 t, ^# L4 k& B; z8 C& L
"id" => $shortname."_sponsor_activate",, L0 @" U+ p: m' ~- R! Q1 r
"type" => "select",* I! b. a( i: ~4 f5 s* `
"std" => "No",
% Z- E# D" a, K! t2 b: `# b "options" => array("No", "Yes")),' a- v& r4 g* K1 L5 X, }2 l
; \0 B* i- X0 R0 G' v$ q" V3 u# k
& s5 G% \+ \* c; d. @0 G4 @1 e, i array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",0 r# g6 D: R4 b3 O+ r
"id" => $shortname."_sponsor_banner_one",6 c; Z9 L8 C, t1 A j4 q' O4 h
"type" => "textarea",
, ^$ l+ p; j$ w$ R; ` "std" => "",8 L6 a$ W H; ~: O* r
), 1 w* m% P" e) v) s! A" Y0 P- z
7 y* b" w( N1 a* l2 b8 w6 S! K6 N array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",* X4 c5 w2 V0 P/ \
"id" => $shortname."_sponsor_banner_two",
P5 [9 b6 y9 t% P+ @+ L+ s" S "type" => "textarea",6 \/ U8 ^# h8 Z+ w9 D' c
"std" => "",
1 ?( W; c/ s3 [8 t4 j6 b [ ),
6 a7 h$ ?3 k: p* s' f2 Q; ?
! g1 a) E! a8 T& ` array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
: r* k, T" a% _; d "id" => $shortname."_sponsor_banner_three",
9 R5 C! E8 a. L3 }" ? "type" => "textarea",1 O/ P$ O; A j Z
"std" => "",) A' p9 f: i1 P( w
),
1 y$ O2 _9 I' {# l; q3 U4 {
- k1 y: h5 B/ J4 A8 \6 V% i array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
2 U. y0 n" g; `( b: a9 T "id" => $shortname."_sponsor_banner_four",
# _' _1 Y4 ~) v! S0 C8 ]5 n "type" => "textarea",
; U3 Q" M% U8 }: p4 L- w "std" => "",
- B+ P E: {$ V r ),% d, q" w: A7 `7 K! p8 v2 K5 f4 |
: ^( t4 ^, u* D7 N/ h
array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",
4 ?+ }7 ^) g$ Z: E6 _/ b "id" => $shortname."_sponsor_banner_five",0 s9 c# n- k! z o& h
"type" => "textarea",
% ~1 m- A6 L- X9 } E "std" => "",) M; ?6 x+ F) z2 k% G2 R9 ?
)," L4 g3 A' P$ K7 K
# ]) J+ ?" \9 K. L. b* z/ K; p array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",, [4 |0 j4 D, T
"id" => $shortname."_sponsor_banner_six", l# A& [, l9 o+ t6 n, `
"type" => "textarea",
5 r6 e9 l0 z3 t "std" => "",% k2 R4 l' b& [% e; f' n, Y
),
8 E0 ?8 r: q" E" r2 X; H7 O1 N/ v6 {5 f9 @# w
array( "name" => "</div></div>",. C& R% V' G9 O+ } R4 F
"type" => "close",; T7 i) o, B7 o; f' M
), b* m* e1 y" I$ O; @
# ]) F4 K0 c8 P6 L3 L/ y
- u6 [: v. t. `1 n: }% E* P, P- H8 f E+ L% J! w6 J
);
% N! M/ t" k1 `) f! H. m" [$ P) \
* t4 m* E& h. j) a% Rfunction mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {. N0 a0 b) |' o1 m
p; v c- i8 T, `6 |% Becho "<div id=\"admin-options\"> ";1 s+ d# X4 ?" U! w" P- x
( ]! Q1 e, l! j$ h Z8 x- y9 w, I
global $themename, $shortname, $options;7 n/ L5 W2 M6 w6 y, ?% Z' G S
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';' L" V# y% O8 q; ~2 c4 @
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';
" V4 n- w3 l) H, |6 p+ ~" `?>
4 K: n' }1 P+ X/ a+ }9 }, Z1 H/ {* }" e# ~/ A& R3 U9 Q
<h4><?php echo "$themename"; ?> Theme Options</h4>+ z8 u @) X' X" B( O
+ W( y4 ~) o9 l3 M" J<div class="annouce">6 U/ \# s5 v B8 l; Z
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>! u. W5 E0 K( d$ u5 r8 [$ Z/ u7 g" F
<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>
$ ]$ f# e# j& X. p* F( S</div>
/ k# C/ v, C# g& q8 D0 `! X: ?4 \2 l5 `. D; Z$ u9 \3 ]
<form action="" method="post">
7 N3 X6 q6 Q+ w8 l* }" f0 V
& V! o6 W+ U* i<?php foreach ($options as $value) { ?>
9 g" w1 v! o* F) A2 }! f) ]- U* \$ _5 A- W. U$ M0 m1 A2 q
<?php switch ( $value['type'] ) { case 'heading': ?>
8 L: ]' F# `* {9 ?3 O7 y% B3 p9 D) E% y( ~( p4 B z. t' T
<div class="get-option">- V$ ], k) m) D
( z- o$ L$ u" o
<h2><?php echo $value['name']; ?></h2>6 @ ~9 ]8 R, O- u5 Z
% v, B n, r2 H5 F( U, D- v<div class="option-save">$ x; _$ x/ N& k+ T
: s+ Q6 O: I- P1 N6 g1 c8 B
<?php
( e% i8 B2 o$ ~6 E3 @1 _/ V/ Jbreak;
1 L# I. O) K- O/ B8 Wcase 'text':7 t5 @- U; @- A
?>% C% b4 G6 m9 s5 b
4 I% G3 f* m/ O5 L' r<div class="description"><?php echo $value['name']; ?></div>
4 @" s+ |: d% c* b) o b<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (1 J: l3 x& B5 Z! R& {9 d
, z6 _7 ?" G6 h9 c$ u
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>! c2 m6 ~4 f0 t' W" C
' @5 F2 k7 C4 a<?php( V: X6 v4 o, ?' o
break;5 N* Y+ S. C2 f% y
case 'select':
' Z- {1 n" L7 u+ i; H6 g( o) e?>
1 a9 y3 s3 y _8 `+ A' n7 b* o( U: T$ S8 ]0 y
<div class="description"><?php echo $value['name']; ?></div>
' B+ v( r4 o7 ^: T; P9 v<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">4 z1 h, i5 q6 f- ~3 {
<?php foreach ($value['options'] as $option) { ?>+ a( l- d' X0 z5 W* Q
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option># M( O' ~/ |+ u9 v/ J. C; E3 @2 b
<?php } ?>" {" [9 b; O7 x) {& m
</select>
3 v: T; p/ G3 D+ U+ N2 r0 @</p>) D! B1 [3 r. q( o/ Z, b
5 C$ F; } z8 |% l
<?php
5 I3 t, `& _( e! b$ {5 r, e* X0 dbreak;* D3 r- T0 A% P* y; k6 L& w A
case 'textarea':
- Y0 i( {* G) N$valuex = $value['id'];) p2 A& u: V' i; h
$valuey = stripslashes($valuex);
& Q% c# N. e7 {$ ~( G- m$video_code = get_settings($valuey);# _3 t5 i6 _* k
?>/ T; J9 U2 q) x4 Y4 \% K
7 B# ^ k3 N( R# V8 }- n
<div class="description"><?php echo $value['name']; ?></div>4 Z) `% T, q+ K% G
<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
. Y2 E* P) `: F5 t/ H, k' _. {8 J5 U7 o3 i
else { echo $value['std']; } ?></textarea></p>
' K/ r) H$ e/ H0 x9 ]( d& Y. i/ |! s/ |
<?php
& z3 k: r( Z# w5 ~1 N( W( Nbreak;" |1 @' m3 k4 p& x
case 'close':& k1 q9 T9 q4 M& K" ?
?>8 \( I9 I5 d4 q
3 f& j0 [) }4 S2 H: q+ Q( R
<div class="clearfix"></div>+ j" r0 H, L, \. j5 m
</div><!-- OPTION SAVE END --> x3 B. `0 O4 G8 Q
; N) ^( T5 V- N<div class="clearfix"></div>7 h) Z; [9 z/ a
</div><!-- GET OPTION END -->
( Y4 K3 _6 I+ u5 \5 v: h
# z7 B* {- T; Z) q+ {4 B8 c<?php
% U0 s% r$ u; ~; A8 l* ^8 \+ v% Kbreak;
9 u* K1 `/ ~/ v; K, Odefault;
, ~$ r$ Z1 }3 p! a" k5 ~: X?>7 h) H( w& S4 e
* N, ]2 k: T' U2 e8 ?! H1 p% S. ?
; j* V" p# l' }<?php# L {# a) r! Q& g
break; } ?>
n' h! {# p E$ X1 _2 x, Q& ~" w+ `7 D: G) Y- B, p6 t* y. D
<?php } ?>
, K) C* E' g5 o2 z/ v' N8 d
: o# a8 _! R: z9 a<p class="save-p">" G- i* _ E* |, m3 u( x
<input name="save" type="submit" class="sbutton" value="Save Options" />: M" d/ m" N8 o3 C
<input type="hidden" name="action" value="save" />5 j8 p0 ?' K6 ^3 k. \. C% W- V
</p>
/ f. q& i# O" Y" S( y6 T</form>
2 s1 o8 e6 S3 k# Y* d F& O. ?& r" g% A0 n4 }, H. [
<form method="post">' n* n) c! V z
<p class="save-p">
- j Y5 v: _; y; Z8 z6 |& e9 V* f<input name="reset" type="submit" class="sbutton" value="Reset Options" />8 H: p( V! ~% D
<input type="hidden" name="action" value="reset" />5 U h* q1 h$ m+ \1 Y
</p>0 w/ O" D4 }1 |& k/ |# v' ]
</form>
+ ]3 C' Q) t& |1 @( m
. J) a+ x' F5 d- W</div><!-- ADMIN OPTIONS END -->7 O( e7 N0 i% v; b& {7 D
, F# x% N. \* O$ \$ H" Q9 k
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }4 T; z6 K0 a/ C5 D5 G: a- M9 B* A
2 ~+ p5 g( w1 ` h: [5 E% g7 ?( c% N
function mytheme_admin_register() {
1 ?0 l3 b% k2 X, U- B7 C7 ?6 `global $themename, $shortname, $options;7 K8 X$ a/ l6 }$ j E& B
if ( $_GET['page'] == basename(__FILE__) ) {
7 v" y' d$ [: T6 iif ( 'save' == $_REQUEST['action'] ) {# a) {* ^. Y* C% z: a4 [
foreach ($options as $value) {
! l! S0 c( ?; g8 j7 L# q, n2 r$ F9 [update_option( $value['id'], $_REQUEST[ $value['id'] ] ); }5 \& m9 J2 {4 K+ r/ v
foreach ($options as $value) {
7 ?; w# s- |8 Eif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }' c1 C9 G' P9 z+ Y0 d6 m; {' r* Q4 i2 i
header("Location: themes.php?page=functions.php&saved=true");& Y' [. e& z% t. Z7 R
die;
* i t' y: ], \/ e/ W4 g. x* e} else if( 'reset' == $_REQUEST['action'] ) {
$ E9 [$ G+ c! }" `2 t) H5 Rforeach ($options as $value) {: j( r( @- ]+ P( y% F5 |2 n, L' L
delete_option( $value['id'] ); }* u! a" H( A) S& |" f/ B
header("Location: themes.php?page=functions.php&reset=true");
- i% [& |1 D' y4 ^! O8 |* }die;! }- P2 U0 D1 X0 j3 u
}
2 l9 }2 Y: T+ R1 s8 L- B}
7 U+ s# g- ^6 u: D1 {add_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
( B8 P! I. ]/ q4 G+ P( [9 p9 g2 _2 M1 H}
8 d1 E: j+ U0 E W8 S, B# w- E0 N' {# j2 c# J; F$ c C( v. l
function mytheme_admin_head() { ?>7 Z3 a# q+ [) D9 v8 K, d0 G, H
<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />4 h% o$ W0 {8 j
<?php }
/ m( C# R6 q6 T/ q |
|