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