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