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