|
|

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