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