|
|

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