|
|

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