|
|

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