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