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