|
|

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