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