|
|

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