|
|

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